Remove legacyCustomProtocolManager from NetworkSessionCreationParameters
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Apr 2018 22:29:25 +0000 (22:29 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Apr 2018 22:29:25 +0000 (22:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182178

Reviewed by Youenn Fablet.

Now that we only make NetworkSessions in the NetworkProcess, we don't need to pass this parameter around.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):

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

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm
Source/WebKit/Shared/WebsiteDataStoreParameters.cpp
Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 5ba62e1..00f81e5 100644 (file)
@@ -1,5 +1,27 @@
 2018-04-04  Alex Christensen  <achristensen@webkit.org>
 
+        Remove legacyCustomProtocolManager from NetworkSessionCreationParameters
+        https://bugs.webkit.org/show_bug.cgi?id=182178
+
+        Reviewed by Youenn Fablet.
+
+        Now that we only make NetworkSessions in the NetworkProcess, we don't need to pass this parameter around.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        * NetworkProcess/NetworkSessionCreationParameters.h:
+        (WebKit::NetworkSessionCreationParameters::decode):
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+        * NetworkProcess/mac/RemoteNetworkingContext.mm:
+        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
+        * Shared/WebsiteDataStoreParameters.cpp:
+        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::parameters):
+
+2018-04-04  Alex Christensen  <achristensen@webkit.org>
+
         Move PingHandle to WebKitLegacy
         https://bugs.webkit.org/show_bug.cgi?id=184145
 
index 7977da1..3b0ff20 100644 (file)
@@ -272,9 +272,6 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&&
     m_logCookieInformation = parameters.logCookieInformation;
 #endif
 
-#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
-    parameters.defaultSessionParameters.legacyCustomProtocolManager = supplement<LegacyCustomProtocolManager>();
-#endif
     SessionTracker::setSession(PAL::SessionID::defaultSessionID(), NetworkSession::create(WTFMove(parameters.defaultSessionParameters)));
 
     for (auto& supplement : m_supplements.values())
index a7e4567..8069e3d 100644 (file)
@@ -41,7 +41,6 @@ struct NetworkSessionCreationParameters {
     static std::optional<NetworkSessionCreationParameters> decode(IPC::Decoder&);
     
     PAL::SessionID sessionID { PAL::SessionID::defaultSessionID() };
-    LegacyCustomProtocolManager* legacyCustomProtocolManager { nullptr };
     String boundInterfaceIdentifier;
     AllowsCellularAccess allowsCellularAccess { AllowsCellularAccess::Yes };
 };
@@ -69,7 +68,7 @@ inline std::optional<NetworkSessionCreationParameters> NetworkSessionCreationPar
     if (!allowsCellularAccess)
         return std::nullopt;
 
-    return {{ sessionID, nullptr, WTFMove(*boundInterfaceIdentifier), WTFMove(*allowsCellularAccess) }};
+    return {{ sessionID, WTFMove(*boundInterfaceIdentifier), WTFMove(*allowsCellularAccess) }};
 }
 
 } // namespace WebKit
index b3c8cd6..f1c9bb8 100644 (file)
@@ -679,9 +679,10 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkSessionCreationParameters&& para
         configuration._CTDataConnectionServiceType = ctDataConnectionServiceType;
 #endif
 
-    if (parameters.legacyCustomProtocolManager)
-        parameters.legacyCustomProtocolManager->registerProtocolClass(configuration);
-    
+#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
+    NetworkProcess::singleton().supplement<LegacyCustomProtocolManager>()->registerProtocolClass(configuration);
+#endif
+
 #if HAVE(TIMINGDATAOPTIONS)
     configuration._timingDataOptions = _TimingDataOptionsEnableW3CNavigationTiming;
 #else
index f51683c..7aef9f1 100644 (file)
@@ -73,7 +73,6 @@ void RemoteNetworkingContext::ensureWebsiteDataStoreSession(WebsiteDataStorePara
         session->setCacheStoragePerOriginQuota(parameters.cacheStoragePerOriginQuota);
     }
 
-    parameters.networkSessionParameters.legacyCustomProtocolManager = NetworkProcess::singleton().supplement<LegacyCustomProtocolManager>();
     SessionTracker::setSession(sessionID, NetworkSession::create(WTFMove(parameters.networkSessionParameters)));
 }
 
index 6620dad..47371d9 100644 (file)
@@ -89,7 +89,7 @@ std::optional<WebsiteDataStoreParameters> WebsiteDataStoreParameters::decode(IPC
 WebsiteDataStoreParameters WebsiteDataStoreParameters::privateSessionParameters(PAL::SessionID sessionID)
 {
     ASSERT(sessionID.isEphemeral());
-    return { { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }, { sessionID, { }, { }, AllowsCellularAccess::Yes }};
+    return { { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }, { sessionID, { }, AllowsCellularAccess::Yes }};
 }
 
 } // namespace WebKit
index daf89ed..62176d5 100644 (file)
@@ -58,7 +58,7 @@ WebsiteDataStoreParameters WebsiteDataStore::parameters()
     resolveDirectoriesIfNecessary();
 
     WebsiteDataStoreParameters parameters;
-    parameters.networkSessionParameters = { m_sessionID, nullptr, m_boundInterfaceIdentifier, m_allowsCellularAccess };
+    parameters.networkSessionParameters = { m_sessionID, m_boundInterfaceIdentifier, m_allowsCellularAccess };
 
     auto cookieFile = resolvedCookieStorageFile();
 
index d6f5293..8a5a412 100644 (file)
@@ -2803,7 +2803,7 @@ void WebPage::setLayerHostingMode(LayerHostingMode layerHostingMode)
 void WebPage::setSessionID(PAL::SessionID sessionID)
 {
     if (sessionID.isEphemeral())
-        WebProcess::singleton().addWebsiteDataStore({{ }, { }, { }, { }, { }, { }, { sessionID, { }, { }, { }}});
+        WebProcess::singleton().addWebsiteDataStore(WebsiteDataStoreParameters::privateSessionParameters(sessionID));
     m_page->setSessionID(sessionID);
 }