[SOUP] Remove SSLPolicyFlags from SoupNetworkSession
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2016 16:53:43 +0000 (16:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2016 16:53:43 +0000 (16:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162906

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-10-04
Reviewed by Michael Catanzaro.

Source/WebCore:

All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
the session like we do for all other construct parameters.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::createTestingSession):
(WebCore::SoupNetworkSession::setupLogger):
(WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
(WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
(WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
* platform/network/soup/SoupNetworkSession.h:
(WebCore::SoupNetworkSession::soupSession): Deleted.

Source/WebKit2:

* NetworkProcess/soup/NetworkProcessMainSoup.cpp:
(WebKit::NetworkProcessMainUnix):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Source/WebCore/platform/network/soup/SoupNetworkSession.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/soup/NetworkProcessMainSoup.cpp

index 2968caa..21ce5d9 100644 (file)
@@ -1,3 +1,22 @@
+2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=162906
+
+        Reviewed by Michael Catanzaro.
+
+        All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
+        the session like we do for all other construct parameters.
+
+        * platform/network/soup/SoupNetworkSession.cpp:
+        (WebCore::SoupNetworkSession::createTestingSession):
+        (WebCore::SoupNetworkSession::setupLogger):
+        (WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
+        (WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
+        (WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
+        * platform/network/soup/SoupNetworkSession.h:
+        (WebCore::SoupNetworkSession::soupSession): Deleted.
+
 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
index 6f51e77..e632deb 100644 (file)
@@ -111,6 +111,8 @@ SoupNetworkSession::SoupNetworkSession(SoupCookieJar* cookieJar)
         SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_PROXY_RESOLVER_DEFAULT,
         SOUP_SESSION_ADD_FEATURE, cookieJar,
         SOUP_SESSION_USE_THREAD_CONTEXT, TRUE,
+        SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
+        SOUP_SESSION_SSL_STRICT, FALSE,
         nullptr);
 
 #if SOUP_CHECK_VERSION(2, 53, 92)
@@ -195,30 +197,6 @@ void SoupNetworkSession::clearOldSoupCache(const String& cacheDirectory)
     }
 }
 
-void SoupNetworkSession::setSSLPolicy(SSLPolicy flags)
-{
-    g_object_set(m_soupSession.get(),
-        SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, flags & SSLUseSystemCAFile ? TRUE : FALSE,
-        SOUP_SESSION_SSL_STRICT, flags & SSLStrict ? TRUE : FALSE,
-        nullptr);
-}
-
-SoupNetworkSession::SSLPolicy SoupNetworkSession::sslPolicy() const
-{
-    gboolean useSystemCAFile, strict;
-    g_object_get(m_soupSession.get(),
-        SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, &useSystemCAFile,
-        SOUP_SESSION_SSL_STRICT, &strict,
-        nullptr);
-
-    SSLPolicy flags = 0;
-    if (useSystemCAFile)
-        flags |= SSLUseSystemCAFile;
-    if (strict)
-        flags |= SSLStrict;
-    return flags;
-}
-
 void SoupNetworkSession::setHTTPProxy(const char* httpProxy, const char* httpProxyExceptions)
 {
 #if PLATFORM(EFL)
index 7aa79e3..b704860 100644 (file)
@@ -47,12 +47,6 @@ public:
     static std::unique_ptr<SoupNetworkSession> createTestingSession();
     static std::unique_ptr<SoupNetworkSession> createForSoupSession(SoupSession*);
 
-    enum SSLPolicyFlags {
-        SSLStrict = 1 << 0,
-        SSLUseSystemCAFile = 1 << 1
-    };
-    typedef unsigned SSLPolicy;
-
     SoupSession* soupSession() const { return m_soupSession.get(); }
 
     void setCookieJar(SoupCookieJar*);
@@ -60,9 +54,6 @@ public:
 
     static void clearOldSoupCache(const String& cacheDirectory);
 
-    void setSSLPolicy(SSLPolicy);
-    SSLPolicy sslPolicy() const;
-
     void setupHTTPProxyFromEnvironment();
 
     void setAcceptLanguages(const Vector<String>&);
index bf36257..d642a3f 100644 (file)
@@ -1,3 +1,13 @@
+2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=162906
+
+        Reviewed by Michael Catanzaro.
+
+        * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
+        (WebKit::NetworkProcessMainUnix):
+
 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
index 4e68d4e..d5081ac 100644 (file)
 
 #include "ChildProcessMain.h"
 #include "NetworkProcessMainUnix.h"
-#include <WebCore/SoupNetworkSession.h>
-#include <libsoup/soup.h>
-
-using namespace WebCore;
 
 namespace WebKit {
 
-class NetworkProcessMain final: public ChildProcessMainBase {
-public:
-    bool platformInitialize() override
-    {
-        SoupNetworkSession::defaultSession().setSSLPolicy(SoupNetworkSession::SSLUseSystemCAFile);
-        return true;
-    }
-};
-
 int NetworkProcessMainUnix(int argc, char** argv)
 {
-    return ChildProcessMain<NetworkProcess, NetworkProcessMain>(argc, argv);
+    return ChildProcessMain<NetworkProcess, ChildProcessMainBase>(argc, argv);
 }
 
 } // namespace WebKit