Reviewed by Antonio Gomes.
[EFL] Add an API to get proxy address.
https://bugs.webkit.org/show_bug.cgi?id=52990
Gets the proxy URI from network backend. This API returns a proxy URI
which is set up by ewk_settings_proxy_uri_set(). But, it only implements
this API for libsoup backend.
* ewk/ewk_settings.cpp:
(ewk_settings_proxy_uri_get):
* ewk/ewk_settings.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@77243
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-01 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add an API to get proxy address.
+ https://bugs.webkit.org/show_bug.cgi?id=52990
+
+ Gets the proxy URI from network backend. This API returns a proxy URI
+ which is set up by ewk_settings_proxy_uri_set(). But, it only implements
+ this API for libsoup backend.
+
+ * ewk/ewk_settings.cpp:
+ (ewk_settings_proxy_uri_get):
+ * ewk/ewk_settings.h:
+
2011-01-29 Dan Winship <danw@gnome.org>
Reviewed by Xan Lopez.
#endif
}
+/**
+ * Gets the proxy URI from the network backend.
+ *
+ * @return current proxy URI or @c 0 if it's not set.
+ */
+const char* ewk_settings_proxy_uri_get()
+{
+#if USE(SOUP)
+ SoupURI* uri;
+ SoupSession* session = WebCore::ResourceHandle::defaultSession();
+ g_object_get(session, SOUP_SESSION_PROXY_URI, &uri, NULL);
+
+ if (!uri) {
+ ERR("no proxy uri");
+ return 0;
+ }
+
+ WTF::String proxy = soup_uri_to_string(uri, EINA_FALSE);
+ return eina_stringshare_add(proxy.utf8().data());
+#elif USE(CURL)
+ EINA_SAFETY_ON_TRUE_RETURN(1);
+#endif
+}
+
/**
* @internal
* Gets the default user agent string.
EAPI Evas_Object *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas);
EAPI void ewk_settings_proxy_uri_set(const char* proxy);
+EAPI const char* ewk_settings_proxy_uri_get();
#ifdef __cplusplus
}