Title: [123218] trunk
Revision
123218
Author
[email protected]
Date
2012-07-20 07:39:35 -0700 (Fri, 20 Jul 2012)

Log Message

[EFL] Proxy configuration should honor the no_proxy environment variable
https://bugs.webkit.org/show_bug.cgi?id=91747

Patch by Christophe Dumez <[email protected]> on 2012-07-20
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Implement a custom Proxy URI Resolver for libsoup
so that we can use it in EFL port. This custom
proxy resolver brings support for setting
exceptions so that the proxy is not used for the
specified hosts.

By default, the proxy is not used for localhost and
127.0.0.1.

No new tests, no behavior change for layout tests.

* PlatformEfl.cmake:
* platform/network/soup/ProxyResolverSoup.cpp: Added.
(soup_proxy_resolver_wk_init):
(soupProxyResolverWkFinalize):
(soupProxyResolverWkSetProperty):
(soupProxyResolverWkGetProperty):
(shouldBypassProxy):
(idle_return_proxy_uri):
(soupProxyResolverWkGetProxyURIAsync):
(soupProxyResolverWkGetProxyURISync):
(soup_proxy_resolver_wk_class_init):
(soup_proxy_resolver_wk_interface_init):
(soupProxyResolverWkNew):
* platform/network/soup/ProxyResolverSoup.h: Added.

Source/WebKit:

Add WebCore/platform/network/soup to INCLUDE paths.

* PlatformEfl.cmake:

Source/WebKit/efl:

Use the new custom proxy resolver from WebCore in
WebKit1-EFL's ewk_network_proxy_uri_set() / get(),
instead of the less flexible SOUP_SESSION_PROXY_URI
SoupSession property.

* ewk/ewk_network.cpp:
(ewk_network_proxy_uri_set):
(ewk_network_proxy_uri_get):

Source/WebKit2:

Use the new custom proxy resolver from WebCore in
WebKit2-EFL so that it is possible for the client
to set proxy exceptions via the "no_proxy"
environment variable.

By default, the proxy set in the "http_proxy"
environment variable will not be used for requests
to localhost or 127.0.0.1.

* WebProcess/efl/WebProcessMainEfl.cpp:
(WebKit::WebProcessMainEfl):

Tools:

Add ProxyResolverSoup to the list of classes that contain GObjects
in style checker script so that it does not complain about naming
convention issues that are mandated by GObject.

* Scripts/webkitpy/style/checker.py:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123217 => 123218)


--- trunk/Source/WebCore/ChangeLog	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebCore/ChangeLog	2012-07-20 14:39:35 UTC (rev 123218)
@@ -1,3 +1,36 @@
+2012-07-20  Christophe Dumez  <[email protected]>
+
+        [EFL] Proxy configuration should honor the no_proxy environment variable
+        https://bugs.webkit.org/show_bug.cgi?id=91747
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Implement a custom Proxy URI Resolver for libsoup
+        so that we can use it in EFL port. This custom
+        proxy resolver brings support for setting
+        exceptions so that the proxy is not used for the
+        specified hosts.
+
+        By default, the proxy is not used for localhost and
+        127.0.0.1.
+
+        No new tests, no behavior change for layout tests.
+
+        * PlatformEfl.cmake:
+        * platform/network/soup/ProxyResolverSoup.cpp: Added.
+        (soup_proxy_resolver_wk_init):
+        (soupProxyResolverWkFinalize):
+        (soupProxyResolverWkSetProperty):
+        (soupProxyResolverWkGetProperty):
+        (shouldBypassProxy):
+        (idle_return_proxy_uri):
+        (soupProxyResolverWkGetProxyURIAsync):
+        (soupProxyResolverWkGetProxyURISync):
+        (soup_proxy_resolver_wk_class_init):
+        (soup_proxy_resolver_wk_interface_init):
+        (soupProxyResolverWkNew):
+        * platform/network/soup/ProxyResolverSoup.h: Added.
+
 2012-07-20  Pierre Rossi  <[email protected]>
 
         ColorChooserClient should expose the element's location

Modified: trunk/Source/WebCore/PlatformEfl.cmake (123217 => 123218)


--- trunk/Source/WebCore/PlatformEfl.cmake	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebCore/PlatformEfl.cmake	2012-07-20 14:39:35 UTC (rev 123218)
@@ -85,6 +85,7 @@
   platform/network/soup/CredentialStorageSoup.cpp
   platform/network/soup/DNSSoup.cpp
   platform/network/soup/GOwnPtrSoup.cpp
+  platform/network/soup/ProxyResolverSoup.cpp
   platform/network/soup/ProxyServerSoup.cpp
   platform/network/soup/ResourceHandleSoup.cpp
   platform/network/soup/ResourceRequestSoup.cpp

Added: trunk/Source/WebCore/platform/network/soup/ProxyResolverSoup.cpp (0 => 123218)


--- trunk/Source/WebCore/platform/network/soup/ProxyResolverSoup.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/network/soup/ProxyResolverSoup.cpp	2012-07-20 14:39:35 UTC (rev 123218)
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ProxyResolverSoup.h"
+
+#include <libsoup/soup.h>
+#include <string.h>
+#include <wtf/Vector.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+static const char defaultNoProxyValue[] = "localhost,127.0.0.1";
+
+typedef struct {
+    SoupURI* proxyURI;
+    CString noProxy;
+    Vector<String> proxyExceptions;
+} SoupProxyResolverWkPrivate;
+
+#define SOUP_PROXY_RESOLVER_WK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), SOUP_TYPE_PROXY_RESOLVER_WK, SoupProxyResolverWkPrivate))
+
+static void soup_proxy_resolver_wk_interface_init(SoupProxyURIResolverInterface* proxyResolverInterface);
+
+G_DEFINE_TYPE_EXTENDED(SoupProxyResolverWk, soup_proxy_resolver_wk, G_TYPE_OBJECT, 0,
+                       G_IMPLEMENT_INTERFACE(SOUP_TYPE_SESSION_FEATURE, 0)
+                       G_IMPLEMENT_INTERFACE(SOUP_TYPE_PROXY_URI_RESOLVER, soup_proxy_resolver_wk_interface_init))
+
+enum {
+    PROP_0,
+    PROP_PROXY_URI,
+    PROP_NO_PROXY,
+    LAST_PROP
+};
+
+static void soup_proxy_resolver_wk_init(SoupProxyResolverWk* resolverWk)
+{
+}
+
+static void soupProxyResolverWkFinalize(GObject* object)
+{
+    SoupProxyResolverWkPrivate* priv = SOUP_PROXY_RESOLVER_WK_GET_PRIVATE(object);
+
+    g_clear_pointer(&priv->proxyURI, soup_uri_free);
+
+    G_OBJECT_CLASS(soup_proxy_resolver_wk_parent_class)->finalize(object);
+}
+
+static void soupProxyResolverWkSetProperty(GObject* object, uint propID, const GValue* value, GParamSpec* pspec)
+{
+    SoupProxyResolverWkPrivate* priv = SOUP_PROXY_RESOLVER_WK_GET_PRIVATE(object);
+
+    switch (propID) {
+    case PROP_PROXY_URI: {
+        SoupURI* uri = static_cast<SoupURI*>(g_value_get_boxed(value));
+        if (priv->proxyURI)
+            soup_uri_free(priv->proxyURI);
+
+        priv->proxyURI = uri ? soup_uri_copy(uri) : 0;
+        break;
+    }
+    case PROP_NO_PROXY:
+        priv->noProxy = g_value_get_string(value);
+        priv->proxyExceptions.clear();
+        String::fromUTF8(priv->noProxy.data()).replace(' ', "").split(',', priv->proxyExceptions);
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
+        break;
+    }
+}
+
+static void soupProxyResolverWkGetProperty(GObject* object, uint propID, GValue* value, GParamSpec* pspec)
+{
+    SoupProxyResolverWkPrivate* priv = SOUP_PROXY_RESOLVER_WK_GET_PRIVATE(object);
+
+    switch (propID) {
+    case PROP_PROXY_URI:
+        g_value_set_boxed(value, priv->proxyURI);
+        break;
+    case PROP_NO_PROXY:
+        g_value_set_string(value, priv->noProxy.data());
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propID, pspec);
+        break;
+    }
+}
+
+static bool shouldBypassProxy(SoupProxyResolverWkPrivate* priv, SoupURI* uri)
+{
+    const size_t exceptionCount = priv->proxyExceptions.size();
+    for (size_t i = 0; i < exceptionCount; ++i) {
+        if (String::fromUTF8(uri->host).endsWith(priv->proxyExceptions[i], false))
+            return true;
+    }
+
+    return false;
+}
+
+typedef struct {
+    SoupProxyURIResolver* proxyResolver;
+    SoupURI* uri;
+    SoupProxyURIResolverCallback callback;
+    void* userData;
+} SoupWkAsyncData;
+
+static gboolean idle_return_proxy_uri(void* data)
+{
+    SoupWkAsyncData* ssad = static_cast<SoupWkAsyncData*>(data);
+    SoupProxyResolverWkPrivate* priv = SOUP_PROXY_RESOLVER_WK_GET_PRIVATE(ssad->proxyResolver);
+
+    SoupURI* proxyURI = 0;
+    if (!shouldBypassProxy(priv, ssad->uri))
+        proxyURI = priv->proxyURI;
+
+    ssad->callback(ssad->proxyResolver, SOUP_STATUS_OK, proxyURI, ssad->userData);
+    g_object_unref(ssad->proxyResolver);
+    soup_uri_free(ssad->uri);
+    g_slice_free(SoupWkAsyncData, ssad);
+
+    return false;
+}
+
+static void soupProxyResolverWkGetProxyURIAsync(SoupProxyURIResolver* proxyResolver, SoupURI* uri, GMainContext* asyncContext, GCancellable* cancellable, SoupProxyURIResolverCallback callback, void* userData)
+{
+    SoupWkAsyncData* ssad;
+
+    ssad = g_slice_new0(SoupWkAsyncData);
+    ssad->proxyResolver = SOUP_PROXY_URI_RESOLVER(g_object_ref(proxyResolver));
+    ssad->uri = soup_uri_copy(uri);
+    ssad->callback = callback;
+    ssad->userData = userData;
+    soup_add_completion(asyncContext, idle_return_proxy_uri, ssad);
+}
+
+static uint soupProxyResolverWkGetProxyURISync(SoupProxyURIResolver* proxyResolver, SoupURI* uri, GCancellable* cancellable, SoupURI** proxyURI)
+{
+    SoupProxyResolverWkPrivate* priv = SOUP_PROXY_RESOLVER_WK_GET_PRIVATE(proxyResolver);
+
+    if (!shouldBypassProxy(priv, uri))
+        *proxyURI = soup_uri_copy(priv->proxyURI);
+
+    return SOUP_STATUS_OK;
+}
+
+static void soup_proxy_resolver_wk_class_init(SoupProxyResolverWkClass* wkClass)
+{
+    GObjectClass* object_class = G_OBJECT_CLASS(wkClass);
+
+    g_type_class_add_private(wkClass, sizeof(SoupProxyResolverWkPrivate));
+
+    object_class->set_property = soupProxyResolverWkSetProperty;
+    object_class->get_property = soupProxyResolverWkGetProperty;
+    object_class->finalize = soupProxyResolverWkFinalize;
+
+    g_object_class_install_property(object_class, PROP_PROXY_URI,
+                                    g_param_spec_boxed(SOUP_PROXY_RESOLVER_WK_PROXY_URI,
+                                                       "Proxy URI",
+                                                       "The HTTP Proxy to use",
+                                                       SOUP_TYPE_URI,
+                                                       static_cast<GParamFlags>(G_PARAM_READWRITE)));
+
+    g_object_class_install_property(object_class, PROP_NO_PROXY,
+                                    g_param_spec_string(SOUP_PROXY_RESOLVER_WK_NO_PROXY,
+                                                       "Proxy exceptions",
+                                                       "Comma-separated proxy exceptions",
+                                                       defaultNoProxyValue,
+                                                       static_cast<GParamFlags>(G_PARAM_READWRITE)));
+}
+
+static void soup_proxy_resolver_wk_interface_init(SoupProxyURIResolverInterface* proxy_uri_resolver_interface)
+{
+    proxy_uri_resolver_interface->get_proxy_uri_async = soupProxyResolverWkGetProxyURIAsync;
+    proxy_uri_resolver_interface->get_proxy_uri_sync = soupProxyResolverWkGetProxyURISync;
+}
+
+SoupProxyURIResolver* soupProxyResolverWkNew(const char* httpProxy, const char* noProxy)
+{
+    SoupURI* proxyURI = soup_uri_new(httpProxy);
+    SoupProxyURIResolver* resolver = SOUP_PROXY_URI_RESOLVER(g_object_new(SOUP_TYPE_PROXY_RESOLVER_WK,
+                                                                          SOUP_PROXY_RESOLVER_WK_PROXY_URI, proxyURI,
+                                                                          SOUP_PROXY_RESOLVER_WK_NO_PROXY, noProxy ? noProxy : defaultNoProxyValue,
+                                                                          0));
+    soup_uri_free(proxyURI);
+
+    return resolver;
+}

Added: trunk/Source/WebCore/platform/network/soup/ProxyResolverSoup.h (0 => 123218)


--- trunk/Source/WebCore/platform/network/soup/ProxyResolverSoup.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/network/soup/ProxyResolverSoup.h	2012-07-20 14:39:35 UTC (rev 123218)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ProxyResolverSoup_h
+#define ProxyResolverSoup_h
+
+#include <libsoup/soup-proxy-uri-resolver.h>
+#include <libsoup/soup-uri.h>
+
+G_BEGIN_DECLS
+
+#define SOUP_TYPE_PROXY_RESOLVER_WK               (soup_proxy_resolver_wk_get_type ())
+#define SOUP_PROXY_RESOLVER_WK(object)            (G_TYPE_CHECK_INSTANCE_CAST ((object), SOUP_TYPE_PROXY_RESOLVER_WK, SoupProxyResolverWk))
+#define SOUP_PROXY_RESOLVER_WK_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_PROXY_RESOLVER_WK, SoupProxyResolverWkClass))
+#define SOUP_IS_PROXY_RESOLVER_WK(object)         (G_TYPE_CHECK_INSTANCE_TYPE ((object), SOUP_TYPE_PROXY_RESOLVER_WK))
+#define SOUP_IS_PROXY_RESOLVER_WK_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), SOUP_TYPE_PROXY_RESOLVER_WK))
+#define SOUP_PROXY_RESOLVER_WK_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_PROXY_RESOLVER_WK, SoupProxyResolverWkClass))
+
+static const char SOUP_PROXY_RESOLVER_WK_PROXY_URI[] = "proxy-uri";
+static const char SOUP_PROXY_RESOLVER_WK_NO_PROXY[] = "no-proxy";
+
+typedef struct {
+    GObject parent;
+} SoupProxyResolverWk;
+
+typedef struct {
+    GObjectClass parent_class;
+} SoupProxyResolverWkClass;
+
+GType soup_proxy_resolver_wk_get_type(void);
+
+SoupProxyURIResolver* soupProxyResolverWkNew(const char* httpProxy, const char* noProxy);
+
+G_END_DECLS
+
+#endif // ProxyResolverSoup_h

Modified: trunk/Source/WebKit/ChangeLog (123217 => 123218)


--- trunk/Source/WebKit/ChangeLog	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebKit/ChangeLog	2012-07-20 14:39:35 UTC (rev 123218)
@@ -1,3 +1,14 @@
+2012-07-20  Christophe Dumez  <[email protected]>
+
+        [EFL] Proxy configuration should honor the no_proxy environment variable
+        https://bugs.webkit.org/show_bug.cgi?id=91747
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add WebCore/platform/network/soup to INCLUDE paths.
+
+        * PlatformEfl.cmake:
+
 2012-07-18  Yong Li  <[email protected]>
 
         [BlackBerry] Move about: URL handling out of WebCore

Modified: trunk/Source/WebKit/PlatformEfl.cmake (123217 => 123218)


--- trunk/Source/WebKit/PlatformEfl.cmake	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebKit/PlatformEfl.cmake	2012-07-20 14:39:35 UTC (rev 123218)
@@ -13,6 +13,7 @@
     "${WEBCORE_DIR}/platform/efl"
     "${WEBCORE_DIR}/platform/graphics/cairo"
     "${WEBCORE_DIR}/platform/graphics/efl"
+    "${WEBCORE_DIR}/platform/network/soup"
     ${CAIRO_INCLUDE_DIRS}
     ${ECORE_X_INCLUDE_DIRS}
     ${EDJE_INCLUDE_DIRS}

Modified: trunk/Source/WebKit/efl/ChangeLog (123217 => 123218)


--- trunk/Source/WebKit/efl/ChangeLog	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-07-20 14:39:35 UTC (rev 123218)
@@ -1,3 +1,19 @@
+2012-07-20  Christophe Dumez  <[email protected]>
+
+        [EFL] Proxy configuration should honor the no_proxy environment variable
+        https://bugs.webkit.org/show_bug.cgi?id=91747
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Use the new custom proxy resolver from WebCore in
+        WebKit1-EFL's ewk_network_proxy_uri_set() / get(),
+        instead of the less flexible SOUP_SESSION_PROXY_URI
+        SoupSession property.
+
+        * ewk/ewk_network.cpp:
+        (ewk_network_proxy_uri_set):
+        (ewk_network_proxy_uri_get):
+
 2012-07-20  Thiago Marcos P. Santos  <[email protected]>
 
         [EFL] Fix build when protocol handler and custom scheme is disabled

Modified: trunk/Source/WebKit/efl/ewk/ewk_network.cpp (123217 => 123218)


--- trunk/Source/WebKit/efl/ewk/ewk_network.cpp	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebKit/efl/ewk/ewk_network.cpp	2012-07-20 14:39:35 UTC (rev 123218)
@@ -21,6 +21,7 @@
 #include "ewk_network.h"
 
 #include "NetworkStateNotifier.h"
+#include "ProxyResolverSoup.h"
 #include "ResourceHandle.h"
 #include "ewk_private.h"
 #include <Eina.h>
@@ -37,19 +38,21 @@
         return;
     }
 
-    SoupURI* uri = soup_uri_new(proxy);
-    EINA_SAFETY_ON_NULL_RETURN(uri);
-
-    g_object_set(session, SOUP_SESSION_PROXY_URI, uri, NULL);
-    soup_uri_free(uri);
+    SoupProxyURIResolver* resolverEfl = soupProxyResolverWkNew(proxy, 0);
+    soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolverEfl));
+    g_object_unref(resolverEfl);
 }
 
 const char* ewk_network_proxy_uri_get(void)
 {
     SoupURI* uri;
     SoupSession* session = WebCore::ResourceHandle::defaultSession();
-    g_object_get(session, SOUP_SESSION_PROXY_URI, &uri, NULL);
+    SoupProxyURIResolver* resolver = SOUP_PROXY_URI_RESOLVER(soup_session_get_feature(session, SOUP_TYPE_PROXY_RESOLVER));
+    if (!resolver)
+        return 0;
 
+    g_object_get(resolver, SOUP_PROXY_RESOLVER_WK_PROXY_URI, &uri, NULL);
+
     if (!uri) {
         ERR("no proxy uri");
         return 0;

Modified: trunk/Source/WebKit2/ChangeLog (123217 => 123218)


--- trunk/Source/WebKit2/ChangeLog	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-20 14:39:35 UTC (rev 123218)
@@ -1,3 +1,22 @@
+2012-07-20  Christophe Dumez  <[email protected]>
+
+        [EFL] Proxy configuration should honor the no_proxy environment variable
+        https://bugs.webkit.org/show_bug.cgi?id=91747
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Use the new custom proxy resolver from WebCore in
+        WebKit2-EFL so that it is possible for the client
+        to set proxy exceptions via the "no_proxy"
+        environment variable.
+
+        By default, the proxy set in the "http_proxy"
+        environment variable will not be used for requests
+        to localhost or 127.0.0.1.
+
+        * WebProcess/efl/WebProcessMainEfl.cpp:
+        (WebKit::WebProcessMainEfl):
+
 2012-06-01  Dinu Jacob  <[email protected]>
 
         [Qt][WK2] Add support for multi-select list

Modified: trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp (123217 => 123218)


--- trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp	2012-07-20 14:39:35 UTC (rev 123218)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WebProcessMainEfl.h"
 
+#include "ProxyResolverSoup.h"
 #include "WKBase.h"
 #include <Ecore.h>
 #include <WebCore/ResourceHandle.h>
@@ -67,11 +68,12 @@
     RunLoop::initializeMainRunLoop();
 
     SoupSession* session = WebCore::ResourceHandle::defaultSession();
-    const char* httpProxy = g_getenv("http_proxy");
+    const char* httpProxy = getenv("http_proxy");
     if (httpProxy) {
-        SoupURI* proxyUri = soup_uri_new(httpProxy);
-        g_object_set(session, SOUP_SESSION_PROXY_URI, proxyUri, NULL);
-        soup_uri_free(proxyUri);
+        const char* noProxy = getenv("no_proxy");
+        SoupProxyURIResolver* resolverEfl = soupProxyResolverWkNew(httpProxy, noProxy);
+        soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolverEfl));
+        g_object_unref(resolverEfl);
     }
 
     int socket = atoi(argv[1]);

Modified: trunk/Tools/ChangeLog (123217 => 123218)


--- trunk/Tools/ChangeLog	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Tools/ChangeLog	2012-07-20 14:39:35 UTC (rev 123218)
@@ -1,3 +1,16 @@
+2012-07-20  Christophe Dumez  <[email protected]>
+
+        [EFL] Proxy configuration should honor the no_proxy environment variable
+        https://bugs.webkit.org/show_bug.cgi?id=91747
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add ProxyResolverSoup to the list of classes that contain GObjects
+        in style checker script so that it does not complain about naming
+        convention issues that are mandated by GObject.
+
+        * Scripts/webkitpy/style/checker.py:
+
 2012-07-20  Zeno Albisser  <[email protected]>
 
         [Qt][WK2] Add configure tests for Xrender and GLX.

Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (123217 => 123218)


--- trunk/Tools/Scripts/webkitpy/style/checker.py	2012-07-20 14:38:44 UTC (rev 123217)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py	2012-07-20 14:39:35 UTC (rev 123218)
@@ -220,7 +220,9 @@
       "Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer1.cpp",
       "Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp",
       "Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp",
-      "Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp"],
+      "Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp",
+      "Source/WebCore/platform/network/soup/ProxyResolverSoup.cpp",
+      "Source/WebCore/platform/network/soup/ProxyResolverSoup.h"],
      ["-readability/naming"]),
 
     # For third-party Python code, keep only the following checks--
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to