Title: [122693] trunk/Source/WebKit/efl
- Revision
- 122693
- Author
- [email protected]
- Date
- 2012-07-15 20:22:36 -0700 (Sun, 15 Jul 2012)
Log Message
[EFL] Add a API for getting security origin string
https://bugs.webkit.org/show_bug.cgi?id=90936
Patch by Kihong Kwon <[email protected]> on 2012-07-15
Reviewed by Ryosuke Niwa.
Support to change from Ewk_Security_Origin to string on the API level.
Add ewk_security_origin_string_get for getting security origin string.
* ewk/ewk_security_origin.cpp:
(_Ewk_Security_Origin):
(ewk_security_origin_string_get):
(ewk_security_origin_free):
(ewk_security_origin_new):
* ewk/ewk_security_origin.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (122692 => 122693)
--- trunk/Source/WebKit/efl/ChangeLog 2012-07-16 02:53:19 UTC (rev 122692)
+++ trunk/Source/WebKit/efl/ChangeLog 2012-07-16 03:22:36 UTC (rev 122693)
@@ -1,3 +1,20 @@
+2012-07-15 Kihong Kwon <[email protected]>
+
+ [EFL] Add a API for getting security origin string
+ https://bugs.webkit.org/show_bug.cgi?id=90936
+
+ Reviewed by Ryosuke Niwa.
+
+ Support to change from Ewk_Security_Origin to string on the API level.
+ Add ewk_security_origin_string_get for getting security origin string.
+
+ * ewk/ewk_security_origin.cpp:
+ (_Ewk_Security_Origin):
+ (ewk_security_origin_string_get):
+ (ewk_security_origin_free):
+ (ewk_security_origin_new):
+ * ewk/ewk_security_origin.h:
+
2012-07-15 Gyuyoung Kim <[email protected]>
[EFL] Move files guarded by #ifdef to existing file list.
Modified: trunk/Source/WebKit/efl/ewk/ewk_security_origin.cpp (122692 => 122693)
--- trunk/Source/WebKit/efl/ewk/ewk_security_origin.cpp 2012-07-16 02:53:19 UTC (rev 122692)
+++ trunk/Source/WebKit/efl/ewk/ewk_security_origin.cpp 2012-07-16 03:22:36 UTC (rev 122693)
@@ -37,6 +37,7 @@
RefPtr<WebCore::SecurityOrigin> securityOrigin;
const char* protocol;
const char* host;
+ const char* originString;
};
const char* ewk_security_origin_protocol_get(const Ewk_Security_Origin* origin)
@@ -51,6 +52,12 @@
return origin->host;
}
+const char* ewk_security_origin_string_get(const Ewk_Security_Origin* origin)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
+ return origin->originString;
+}
+
uint32_t ewk_security_origin_port_get(const Ewk_Security_Origin* origin)
{
return origin->securityOrigin->port();
@@ -115,6 +122,7 @@
origin->securityOrigin = 0;
eina_stringshare_del(origin->host);
eina_stringshare_del(origin->protocol);
+ eina_stringshare_del(origin->originString);
delete origin;
}
@@ -140,6 +148,7 @@
origin->securityOrigin = coreOrigin;
origin->protocol = eina_stringshare_add(coreOrigin->protocol().utf8().data());
origin->host = eina_stringshare_add(coreOrigin->host().utf8().data());
+ origin->originString = eina_stringshare_add(origin->securityOrigin->toString().utf8().data());
return origin;
}
Modified: trunk/Source/WebKit/efl/ewk/ewk_security_origin.h (122692 => 122693)
--- trunk/Source/WebKit/efl/ewk/ewk_security_origin.h 2012-07-16 02:53:19 UTC (rev 122692)
+++ trunk/Source/WebKit/efl/ewk/ewk_security_origin.h 2012-07-16 03:22:36 UTC (rev 122693)
@@ -66,6 +66,17 @@
EAPI const char *ewk_security_origin_host_get(const Ewk_Security_Origin *o);
/**
+ * Convert this Ewk_Security_Origin into a string.
+ * The string representation of a security origin is similar to a URL, except it lacks a path component.
+ * The string representation does not encode the value of the security origin's domain property.
+ *
+ * @param o security origin object
+ *
+ * @return the string representation of security origin or @c 0 if there is not a proper security origin scheme
+ */
+EAPI const char *ewk_security_origin_string_get(const Ewk_Security_Origin *o);
+
+/**
* Returns the port of the security origin.
*
* @param o security origin object
@@ -158,7 +169,6 @@
*/
EAPI Ewk_Security_Origin *ewk_security_origin_new_from_string(const char *url);
-
#ifdef __cplusplus
}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes