2010-07-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jul 2010 14:34:26 +0000 (14:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jul 2010 14:34:26 +0000 (14:34 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Set proxy address for Soup
        https://bugs.webkit.org/show_bug.cgi?id=42721

        Sets the given proxy URI for libsoup network backend. This method will
        support libcurl network backend later.

        * EWebLauncher/main.c:
        (main): Invoke proxy set method
        * ewk/ewk_settings.cpp:
        (ewk_settings_proxy_uri_set): Sets proxy URI.
        * ewk/ewk_settings.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63972 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/efl/ChangeLog
WebKit/efl/EWebLauncher/main.c
WebKit/efl/ewk/ewk_settings.cpp
WebKit/efl/ewk/ewk_settings.h

index b5ad1d7..2a0e5c4 100644 (file)
@@ -1,3 +1,19 @@
+2010-07-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Set proxy address for Soup
+        https://bugs.webkit.org/show_bug.cgi?id=42721
+
+        Sets the given proxy URI for libsoup network backend. This method will
+        support libcurl network backend later.
+
+        * EWebLauncher/main.c:
+        (main): Invoke proxy set method
+        * ewk/ewk_settings.cpp:
+        (ewk_settings_proxy_uri_set): Sets proxy URI.
+        * ewk/ewk_settings.h:
+
 2010-07-16  Leandro Pereira  <leandro@profusion.mobi>
 
         Reviewed by Gustavo Noronha Silva.
index fd9a5f4..c1956a2 100644 (file)
@@ -772,6 +772,7 @@ main(int argc, char *argv[])
     char *url = NULL;
     char *userAgent = NULL;
     const char *tmp;
+    const char *proxyUri;
     char path[PATH_MAX];
 
     char *engine = NULL;
@@ -834,6 +835,10 @@ main(int argc, char *argv[])
     ewk_settings_icon_database_path_set(path);
     ewk_settings_web_database_path_set(path);
 
+    proxyUri = getenv("http_proxy");
+    if (proxyUri)
+        ewk_settings_proxy_uri_set(proxyUri);
+
     browserCreate(url, theme, userAgent, geometry, engine, isFullscreen);
     ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows);
 
index b50cd75..e775ac9 100644 (file)
 #include <sys/types.h>
 #include <unistd.h>
 
+#if USE(SOUP)
+#include "ResourceHandle.h"
+#include <libsoup/soup.h>
+#endif
+
 static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024;
 
 /**
@@ -223,3 +228,22 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c
     surface = icon->nativeImageForCurrentFrame();
     return ewk_util_image_from_cairo_surface_add(canvas, surface);
 }
+
+/**
+ * Sets the given proxy URI to network backend.
+ *
+ * @param proxy URI.
+ */
+void ewk_settings_proxy_uri_set(const char* proxy)
+{
+#if USE(SOUP)
+    SoupURI* uri = soup_uri_new(proxy);
+    EINA_SAFETY_ON_NULL_RETURN(uri);
+
+    SoupSession* session = WebCore::ResourceHandle::defaultSession();
+    g_object_set(session, SOUP_SESSION_PROXY_URI, uri, NULL);
+    soup_uri_free(uri);
+#elif USE(CURL)
+    EINA_SAFETY_ON_TRUE_RETURN(1);
+#endif
+}
index 87d015c..f2d77f7 100644 (file)
@@ -48,6 +48,7 @@ EAPI Eina_Bool        ewk_settings_icon_database_clear(void);
 EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url);
 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);
 
 #ifdef __cplusplus
 }