Make usesNetworkProcess always true
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Nov 2015 17:49:15 +0000 (17:49 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Nov 2015 17:49:15 +0000 (17:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151580

Reviewed by Darin Adler.

Source/WebKit2:

* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKInspectorToggleJavaScriptProfiling):
(WKContextSetUsesNetworkProcess):
(WKGraphicsContextGetCGContext):
* Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(WebKit::CustomProtocolManager::initializeConnection):
(WebKit::CustomProtocolManager::initialize):
* Shared/Network/CustomProtocols/CustomProtocolManager.h:
* Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::initialize):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetJavaScriptGarbageCollectorTimerEnabled):
(WKContextUseTestingNetworkSession):
(WKContextSetUsesNetworkProcess): Deleted.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup initWithInjectedBundleURL:]):
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::setProcessModel):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::updateProcessSuppressionState):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::cancel):
(WebKit::DownloadProxy::invalidate):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::m_processSuppressionDisabledForPageCounter):
(WebKit::WebProcessPool::networkingProcessConnection):
(WebKit::WebProcessPool::languageChanged):
(WebKit::WebProcessPool::textCheckerStateChanged):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::download):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
(WebKit::WebProcessPool::setCacheModel):
(WebKit::WebProcessPool::createDownloadProxy):
(WebKit::WebProcessPool::addMessageReceiver):
(WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost):
(WebKit::WebProcessPool::setHTTPPipeliningEnabled):
(WebKit::WebProcessPool::requestNetworkingStatistics):
(WebKit::WebProcessPool::setUsesNetworkProcess): Deleted.
(WebKit::WebProcessPool::usesNetworkProcess): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToNetworkingProcess):
(WebKit::WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::canTerminateChildProcess):
(WebKit::WebProcessProxy::updateTextCheckerState):
(WebKit::WebProcessProxy::didSaveToPageCache):
(WebKit::WebProcessProxy::didSetAssertionState):
(WebKit::WebProcessProxy::createDownloadProxy): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/efl/WebProcessPoolEfl.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::setIgnoreTLSErrors):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::blobSize):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):
(WebKit::WebPlatformStrategies::resourceLoadScheduler):
(WebKit::WebPlatformStrategies::loadResourceSynchronously):
(WebKit::WebPlatformStrategies::createPingHandle):
(WebKit::WebPlatformStrategies::createBlobRegistry):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
(WebKit::WebFrame::source):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::WebProcess::initializeConnection):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::destroyPrivateBrowsingSession):
(WebKit::WebProcess::pluginProcessConnectionManager):
(WebKit::WebProcess::shouldTerminate):
(WebKit::WebProcess::setInjectedBundleParameters):
(WebKit::WebProcess::networkConnection):
(WebKit::WebProcess::setEnhancedAccessibility):
(WebKit::WebProcess::prefetchDNS):
(WebKit::WebProcess::didCreateDownload): Deleted.
(WebKit::WebProcess::didDestroyDownload): Deleted.
(WebKit::WebProcess::downloadProxyConnection): Deleted.
(WebKit::WebProcess::downloadsAuthenticationManager): Deleted.
(WebKit::WebProcess::downloadManager): Deleted.
(WebKit::WebProcess::usesNetworkProcess): Deleted.
(WebKit::WebProcess::downloadRequest): Deleted.
(WebKit::WebProcess::resumeDownload): Deleted.
(WebKit::WebProcess::cancelDownload): Deleted.
* WebProcess/WebProcess.h:
(WebKit::WebProcess::textCheckerState):
(WebKit::WebProcess::eventDispatcher):
* WebProcess/WebProcess.messages.in:
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformClearResourceCaches):
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):
(WebKit::getCacheDiskFreeSize): Deleted.
(WebKit::setSoupSessionAcceptLanguage): Deleted.
(WebKit::languageChanged): Deleted.
(WebKit::WebProcess::setIgnoreTLSErrors): Deleted.
(WebKit::WebProcess::allowSpecificHTTPSCertificateForHost): Deleted.

Tools:

* TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):

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

33 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm
Source/WebKit2/Shared/API/c/WKDeprecatedFunctions.cpp
Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm
Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h
Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp
Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKContextPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKProcessGroup.mm
Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessPool.h
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/efl/WebProcessPoolEfl.cpp
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/Geolocation.cpp
Tools/TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp
Tools/WebKitTestRunner/TestController.cpp

index 45c071e..3801848 100644 (file)
@@ -1,3 +1,142 @@
+2015-11-30  Alex Christensen  <achristensen@webkit.org>
+
+        Make usesNetworkProcess always true
+        https://bugs.webkit.org/show_bug.cgi?id=151580
+
+        Reviewed by Darin Adler.
+
+        * NetworkProcess/mac/RemoteNetworkingContext.mm:
+        (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
+        * Shared/API/c/WKDeprecatedFunctions.cpp:
+        (WKInspectorToggleJavaScriptProfiling):
+        (WKContextSetUsesNetworkProcess):
+        (WKGraphicsContextGetCGContext):
+        * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
+        (WebKit::CustomProtocolManager::initializeConnection):
+        (WebKit::CustomProtocolManager::initialize):
+        * Shared/Network/CustomProtocols/CustomProtocolManager.h:
+        * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
+        (WebKit::CustomProtocolManager::initialize):
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/API/APIProcessPoolConfiguration.cpp:
+        (API::ProcessPoolConfiguration::createWithLegacyOptions):
+        (API::ProcessPoolConfiguration::copy):
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextSetJavaScriptGarbageCollectorTimerEnabled):
+        (WKContextUseTestingNetworkSession):
+        (WKContextSetUsesNetworkProcess): Deleted.
+        * UIProcess/API/C/WKContextPrivate.h:
+        * UIProcess/API/Cocoa/WKProcessGroup.mm:
+        (-[WKProcessGroup initWithInjectedBundleURL:]):
+        * UIProcess/API/efl/ewk_context.cpp:
+        (EwkContext::setProcessModel):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::updateProcessSuppressionState):
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::cancel):
+        (WebKit::DownloadProxy::invalidate):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::WebProcessPool):
+        (WebKit::m_processSuppressionDisabledForPageCounter):
+        (WebKit::WebProcessPool::networkingProcessConnection):
+        (WebKit::WebProcessPool::languageChanged):
+        (WebKit::WebProcessPool::textCheckerStateChanged):
+        (WebKit::WebProcessPool::ensureNetworkProcess):
+        (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
+        (WebKit::WebProcessPool::createNewWebProcess):
+        (WebKit::WebProcessPool::download):
+        (WebKit::WebProcessPool::resumeDownload):
+        (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
+        (WebKit::WebProcessPool::setCacheModel):
+        (WebKit::WebProcessPool::createDownloadProxy):
+        (WebKit::WebProcessPool::addMessageReceiver):
+        (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost):
+        (WebKit::WebProcessPool::setHTTPPipeliningEnabled):
+        (WebKit::WebProcessPool::requestNetworkingStatistics):
+        (WebKit::WebProcessPool::setUsesNetworkProcess): Deleted.
+        (WebKit::WebProcessPool::usesNetworkProcess): Deleted.
+        * UIProcess/WebProcessPool.h:
+        (WebKit::WebProcessPool::sendToNetworkingProcess):
+        (WebKit::WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::shutDown):
+        (WebKit::WebProcessProxy::removeWebPage):
+        (WebKit::WebProcessProxy::canTerminateChildProcess):
+        (WebKit::WebProcessProxy::updateTextCheckerState):
+        (WebKit::WebProcessProxy::didSaveToPageCache):
+        (WebKit::WebProcessProxy::didSetAssertionState):
+        (WebKit::WebProcessProxy::createDownloadProxy): Deleted.
+        * UIProcess/WebProcessProxy.h:
+        * UIProcess/efl/WebProcessPoolEfl.cpp:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        (WebKit::WebProcessPool::setIgnoreTLSErrors):
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerFileBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURL):
+        (WebKit::BlobRegistryProxy::unregisterBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
+        (WebKit::BlobRegistryProxy::blobSize):
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::cookiesForDOM):
+        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
+        (WebKit::WebPlatformStrategies::cookiesEnabled):
+        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
+        (WebKit::WebPlatformStrategies::getRawCookies):
+        (WebKit::WebPlatformStrategies::deleteCookie):
+        (WebKit::WebPlatformStrategies::resourceLoadScheduler):
+        (WebKit::WebPlatformStrategies::loadResourceSynchronously):
+        (WebKit::WebPlatformStrategies::createPingHandle):
+        (WebKit::WebPlatformStrategies::createBlobRegistry):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::startDownload):
+        (WebKit::WebFrame::convertMainResourceLoadToDownload):
+        (WebKit::WebFrame::source):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        (WebKit::m_webSQLiteDatabaseTracker):
+        (WebKit::WebProcess::initializeConnection):
+        (WebKit::WebProcess::initializeWebProcess):
+        (WebKit::WebProcess::ensureNetworkProcessConnection):
+        (WebKit::WebProcess::destroyPrivateBrowsingSession):
+        (WebKit::WebProcess::pluginProcessConnectionManager):
+        (WebKit::WebProcess::shouldTerminate):
+        (WebKit::WebProcess::setInjectedBundleParameters):
+        (WebKit::WebProcess::networkConnection):
+        (WebKit::WebProcess::setEnhancedAccessibility):
+        (WebKit::WebProcess::prefetchDNS):
+        (WebKit::WebProcess::didCreateDownload): Deleted.
+        (WebKit::WebProcess::didDestroyDownload): Deleted.
+        (WebKit::WebProcess::downloadProxyConnection): Deleted.
+        (WebKit::WebProcess::downloadsAuthenticationManager): Deleted.
+        (WebKit::WebProcess::downloadManager): Deleted.
+        (WebKit::WebProcess::usesNetworkProcess): Deleted.
+        (WebKit::WebProcess::downloadRequest): Deleted.
+        (WebKit::WebProcess::resumeDownload): Deleted.
+        (WebKit::WebProcess::cancelDownload): Deleted.
+        * WebProcess/WebProcess.h:
+        (WebKit::WebProcess::textCheckerState):
+        (WebKit::WebProcess::eventDispatcher):
+        * WebProcess/WebProcess.messages.in:
+        * WebProcess/soup/WebProcessSoup.cpp:
+        (WebKit::WebProcess::platformSetCacheModel):
+        (WebKit::WebProcess::platformClearResourceCaches):
+        (WebKit::WebProcess::platformInitializeWebProcess):
+        (WebKit::WebProcess::platformTerminate):
+        (WebKit::getCacheDiskFreeSize): Deleted.
+        (WebKit::setSoupSessionAcceptLanguage): Deleted.
+        (WebKit::languageChanged): Deleted.
+        (WebKit::WebProcess::setIgnoreTLSErrors): Deleted.
+        (WebKit::WebProcess::allowSpecificHTTPSCertificateForHost): Deleted.
+
 2015-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] UI process crash when the screensaver DBus proxy is being created while the web view is destroyed
index 223be36..8ec48ad 100644 (file)
@@ -93,8 +93,13 @@ void RemoteNetworkingContext::ensurePrivateBrowsingSession(SessionID sessionID)
     if (SessionTracker::storageSession(sessionID))
         return;
 
-    ASSERT(!SessionTracker::getIdentifierBase().isNull());
-    SessionTracker::setSession(sessionID, NetworkStorageSession::createPrivateBrowsingSession(SessionTracker::getIdentifierBase() + '.' + String::number(sessionID.sessionID()))
+    String base;
+    if (SessionTracker::getIdentifierBase().isNull())
+        base = [[NSBundle mainBundle] bundleIdentifier];
+    else
+        base = SessionTracker::getIdentifierBase();
+
+    SessionTracker::setSession(sessionID, NetworkStorageSession::createPrivateBrowsingSession(base + '.' + String::number(sessionID.sessionID()))
 #if USE(NETWORK_SESSION)
         , std::make_unique<NetworkSession>(NetworkSession::Type::Ephemeral, sessionID)
 #endif
index 937f87b..7a1351f 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "APIDictionary.h"
 #include "WKArray.h"
+#include "WKContextPrivate.h"
 #include "WKMutableDictionary.h"
 #include "WKPreferencesRefPrivate.h"
 #include "WKSharedAPICast.h"
@@ -134,6 +135,10 @@ void WKInspectorToggleJavaScriptProfiling(WKInspectorRef)
 {
 }
 
+void WKContextSetUsesNetworkProcess(WKContextRef, bool)
+{
+}
+
 #if PLATFORM(MAC)
 CGContextRef WKGraphicsContextGetCGContext(WKGraphicsContextRef graphicsContext)
 {
index 1653bcd..79180ff 100644 (file)
@@ -132,21 +132,6 @@ void CustomProtocolManager::initializeConnection(IPC::Connection* connection)
     connection->addWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName(), m_messageQueue.get(), this);
 }
 
-void CustomProtocolManager::initialize(const WebProcessCreationParameters& parameters)
-{
-    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty() || !parameters.usesNetworkProcess);
-    if (parameters.usesNetworkProcess) {
-        m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
-        m_messageQueue = nullptr;
-        return;
-    }
-
-    [NSURLProtocol registerClass:[WKCustomProtocol class]];
-
-    for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
-        registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
-}
-
 void CustomProtocolManager::initialize(const NetworkProcessCreationParameters& parameters)
 {
     [NSURLProtocol registerClass:[WKCustomProtocol class]];
index c4857b1..e555d63 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "Connection.h"
 #include "NetworkProcessSupplement.h"
-#include "WebProcessSupplement.h"
 #include <wtf/WorkQueue.h>
 #include <wtf/text/WTFString.h>
 
@@ -58,7 +57,7 @@ namespace WebKit {
 class ChildProcess;
 struct NetworkProcessCreationParameters;
 
-class CustomProtocolManager : public WebProcessSupplement, public NetworkProcessSupplement, public IPC::Connection::WorkQueueMessageReceiver {
+class CustomProtocolManager : public NetworkProcessSupplement, public IPC::Connection::WorkQueueMessageReceiver {
     WTF_MAKE_NONCOPYABLE(CustomProtocolManager);
 public:
     explicit CustomProtocolManager(ChildProcess*);
@@ -80,9 +79,6 @@ private:
     // ChildProcessSupplement
     void initializeConnection(IPC::Connection*) override;
 
-    // WebProcessSupplement
-    void initialize(const WebProcessCreationParameters&) override;
-
     // NetworkProcessSupplement
     void initialize(const NetworkProcessCreationParameters&) override;
 
index 86137eb..72f7f70 100644 (file)
@@ -46,18 +46,6 @@ void CustomProtocolManager::initializeConnection(IPC::Connection* connection)
     connection->addWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName(), m_messageQueue.get(), this);
 }
 
-void CustomProtocolManager::initialize(const WebProcessCreationParameters& parameters)
-{
-    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty() || !parameters.usesNetworkProcess);
-    if (parameters.usesNetworkProcess) {
-        m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
-        m_messageQueue = nullptr;
-        return;
-    }
-    for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
-        registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
-}
-
 void CustomProtocolManager::initialize(const NetworkProcessCreationParameters& parameters)
 {
     for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
index 22642ad..a932f0c 100644 (file)
@@ -43,7 +43,6 @@ WebProcessCreationParameters::WebProcessCreationParameters()
     , shouldEnableJIT(false)
     , shouldEnableFTLJIT(false)
 #endif
-    , usesNetworkProcess(false)
     , memoryCacheDisabled(false)
 #if ENABLE(SERVICE_CONTROLS)
     , hasImageServices(false)
@@ -91,14 +90,6 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
 #if ENABLE(CACHE_PARTITIONING)
     encoder << urlSchemesRegisteredAsCachePartitioned;
 #endif
-    encoder << urlSchemesRegisteredForCustomProtocols;
-#if USE(SOUP)
-    encoder << diskCacheDirectory;
-    encoder << cookiePersistentStoragePath;
-    encoder << cookiePersistentStorageType;
-    encoder.encodeEnum(cookieAcceptPolicy);
-    encoder << ignoreTLSErrors;
-#endif
     encoder.encodeEnum(cacheModel);
     encoder << shouldAlwaysUseComplexTextCodePath;
     encoder << shouldEnableMemoryPressureReliefLogging;
@@ -131,8 +122,6 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
     encoder << notificationPermissions;
 #endif
 
-    encoder << usesNetworkProcess;
-
     encoder << plugInAutoStartOriginHashes;
     encoder << plugInAutoStartOrigins;
     encoder << memoryCacheDisabled;
@@ -210,20 +199,6 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
     if (!decoder.decode(parameters.urlSchemesRegisteredAsCachePartitioned))
         return false;
 #endif
-    if (!decoder.decode(parameters.urlSchemesRegisteredForCustomProtocols))
-        return false;
-#if USE(SOUP)
-    if (!decoder.decode(parameters.diskCacheDirectory))
-        return false;
-    if (!decoder.decode(parameters.cookiePersistentStoragePath))
-        return false;
-    if (!decoder.decode(parameters.cookiePersistentStorageType))
-        return false;
-    if (!decoder.decodeEnum(parameters.cookieAcceptPolicy))
-        return false;
-    if (!decoder.decode(parameters.ignoreTLSErrors))
-        return false;
-#endif
     if (!decoder.decodeEnum(parameters.cacheModel))
         return false;
     if (!decoder.decode(parameters.shouldAlwaysUseComplexTextCodePath))
@@ -287,9 +262,6 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
         return false;
 #endif
 
-    if (!decoder.decode(parameters.usesNetworkProcess))
-        return false;
-
     if (!decoder.decode(parameters.plugInAutoStartOriginHashes))
         return false;
     if (!decoder.decode(parameters.plugInAutoStartOrigins))
index 0f68fe5..8088ddd 100644 (file)
@@ -99,14 +99,6 @@ struct WebProcessCreationParameters {
 #if ENABLE(CACHE_PARTITIONING)
     Vector<String> urlSchemesRegisteredAsCachePartitioned;
 #endif
-    Vector<String> urlSchemesRegisteredForCustomProtocols;
-#if USE(SOUP)
-    String diskCacheDirectory;
-    String cookiePersistentStoragePath;
-    uint32_t cookiePersistentStorageType;
-    HTTPCookieAcceptPolicy cookieAcceptPolicy;
-    bool ignoreTLSErrors;
-#endif
 
     CacheModel cacheModel;
 
@@ -154,8 +146,6 @@ struct WebProcessCreationParameters {
     HashMap<String, bool> notificationPermissions;
 #endif
 
-    bool usesNetworkProcess;
-
     HashMap<WebCore::SessionID, HashMap<unsigned, double>> plugInAutoStartOriginHashes;
     Vector<String> plugInAutoStartOrigins;
 
index 9af7529..fa2675e 100644 (file)
@@ -46,10 +46,8 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithLegacyOptions(
     // See https://bugs.webkit.org/show_bug.cgi?id=151418.
     configuration->m_processModel = WebKit::ProcessModelMultipleSecondaryProcesses;
     configuration->m_maximumProcessCount = 1;
-    configuration->m_useNetworkProcess = true;
 #else
     configuration->m_processModel = WebKit::ProcessModelSharedSecondaryProcess;
-    configuration->m_useNetworkProcess = false;
 #endif
     configuration->m_cacheModel = WebKit::CacheModelDocumentViewer;
 
@@ -83,7 +81,6 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::copy()
 
     copy->m_shouldHaveLegacyDataStore = this->m_shouldHaveLegacyDataStore;
     copy->m_processModel = this->m_processModel;
-    copy->m_useNetworkProcess = this->m_useNetworkProcess;
     copy->m_maximumProcessCount = this->m_maximumProcessCount;
     copy->m_cacheModel = this->m_cacheModel;
     copy->m_diskCacheSizeOverride = this->m_diskCacheSizeOverride;
index 6dc9f2a..ad1abda 100644 (file)
@@ -51,9 +51,6 @@ public:
     WebKit::ProcessModel processModel() const { return m_processModel; }
     void setProcessModel(WebKit::ProcessModel processModel) { m_processModel = processModel; } 
 
-    bool useNetworkProcess() const { return m_useNetworkProcess; }
-    void setUseNetworkProcess(bool useNetworkProcess) { m_useNetworkProcess = useNetworkProcess; } 
-
     unsigned maximumProcessCount() const { return m_maximumProcessCount; }
     void setMaximumProcessCount(unsigned maximumProcessCount) { m_maximumProcessCount = maximumProcessCount; } 
 
@@ -97,7 +94,6 @@ private:
     bool m_shouldHaveLegacyDataStore { false };
 
     WebKit::ProcessModel m_processModel { WebKit::ProcessModelMultipleSecondaryProcesses };
-    bool m_useNetworkProcess { true };
     unsigned m_maximumProcessCount { 0 };
     WebKit::CacheModel m_cacheModel { WebKit::CacheModelPrimaryWebBrowser };
     int64_t m_diskCacheSizeOverride { -1 };
index 7025313..cb2c793 100644 (file)
@@ -554,11 +554,6 @@ void WKContextSetJavaScriptGarbageCollectorTimerEnabled(WKContextRef contextRef,
     toImpl(contextRef)->setJavaScriptGarbageCollectorTimerEnabled(enable);
 }
 
-void WKContextSetUsesNetworkProcess(WKContextRef contextRef, bool usesNetworkProcess)
-{
-    toImpl(contextRef)->setUsesNetworkProcess(usesNetworkProcess);
-}
-
 void WKContextUseTestingNetworkSession(WKContextRef context)
 {
     toImpl(context)->useTestingNetworkSession();
index a5ed29d..9e5a38e 100644 (file)
@@ -77,7 +77,7 @@ WK_EXPORT void WKContextWarmInitialProcess(WKContextRef context);
 
 // FIXME: This function is temporary and useful during the development of the NetworkProcess feature.
 // At some point it should be removed.
-WK_EXPORT void WKContextSetUsesNetworkProcess(WKContextRef context, bool usesNetworkProcess);
+WK_EXPORT void WKContextSetUsesNetworkProcess(WKContextRef, bool);
 
 // Test only. Should be called before any secondary processes are started.
 WK_EXPORT void WKContextUseTestingNetworkSession(WKContextRef context);
index 84a7681..d7278eb 100644 (file)
@@ -193,7 +193,6 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
     auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
     configuration->setInjectedBundlePath(bundleURL ? String(bundleURL.path) : String());
 #if PLATFORM(IOS)
-    configuration->setUseNetworkProcess(true);
     configuration->setProcessModel(ProcessModelMultipleSecondaryProcesses);
 #endif
 
index 69719d7..8486d6e 100644 (file)
@@ -277,7 +277,6 @@ void EwkContext::setProcessModel(Ewk_Process_Model processModel)
     if (WKContextGetProcessModel(m_context.get()) == newWKProcessModel)
         return;
 
-    WKContextSetUsesNetworkProcess(m_context.get(), newWKProcessModel == kWKProcessModelMultipleSecondaryProcesses);
     WKContextSetProcessModel(m_context.get(), newWKProcessModel);
 }
 
index 8013460..7d4f494 100644 (file)
@@ -114,7 +114,7 @@ static void registerUserDefaultsIfNeeded()
 
 void WebProcessPool::updateProcessSuppressionState()
 {
-    if (usesNetworkProcess() && m_networkProcess)
+    if (m_networkProcess)
         m_networkProcess->setProcessSuppressionEnabled(processSuppressionEnabled());
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
@@ -190,11 +190,6 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
 
     parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]);
 
-    if (!usesNetworkProcess()) {
-        for (const auto& scheme : globalURLSchemesWithCustomProtocolHandlers())
-            parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
-    }
-
     parameters.fontWhitelist = m_fontWhitelist;
 
     if (m_bundleParameters) {
index 27d709a..4acb544 100644 (file)
@@ -71,13 +71,8 @@ void DownloadProxy::cancel()
     if (!m_processPool)
         return;
 
-    if (m_processPool->usesNetworkProcess()) {
-        if (NetworkProcessProxy* networkProcess = m_processPool->networkProcess())
-            networkProcess->connection()->send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
-        return;
-    }
-
-    m_processPool->sendToAllProcesses(Messages::WebProcess::CancelDownload(m_downloadID));
+    if (NetworkProcessProxy* networkProcess = m_processPool->networkProcess())
+        networkProcess->connection()->send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
 }
 
 void DownloadProxy::invalidate()
index 8c6194e..a760933 100644 (file)
@@ -163,8 +163,7 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy pol
     // - When testing, we only have one WebProcess and one NetworkProcess, and WebKitTestRunner never restarts them;
     // - When not testing, Cocoa has the policy persisted, and thus new processes use it (even for ephemeral sessions).
     processPool()->sendToAllProcesses(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
-    if (processPool()->usesNetworkProcess())
-        processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
+    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
 }
 
 void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(std::function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)> callbackFunction)
index 9c25bc1..a781cb5 100644 (file)
@@ -158,9 +158,6 @@ WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration& configuration)
     , m_processTerminationEnabled(true)
     , m_canHandleHTTPSServerTrustEvaluation(true)
     , m_didNetworkProcessCrash(false)
-#if USE(SOUP)
-    , m_ignoreTLSErrors(true)
-#endif
     , m_memoryCacheDisabled(false)
     , m_userObservablePageCounter([this](bool) { updateProcessSuppressionState(); })
     , m_processSuppressionDisabledForPageCounter([this](bool) { updateProcessSuppressionState(); })
@@ -306,17 +303,7 @@ void WebProcessPool::setMaximumNumberOfProcesses(unsigned maximumNumberOfProcess
 
 IPC::Connection* WebProcessPool::networkingProcessConnection()
 {
-    switch (processModel()) {
-    case ProcessModelSharedSecondaryProcess:
-        if (usesNetworkProcess())
-            return m_networkProcess->connection();
-        return m_processes[0]->connection();
-    case ProcessModelMultipleSecondaryProcesses:
-        ASSERT(usesNetworkProcess());
-        return m_networkProcess->connection();
-    }
-    ASSERT_NOT_REACHED();
-    return 0;
+    return m_networkProcess->connection();
 }
 
 void WebProcessPool::languageChanged(void* context)
@@ -328,7 +315,7 @@ void WebProcessPool::languageChanged()
 {
     sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(userPreferredLanguages()));
 #if USE(SOUP)
-    if (usesNetworkProcess() && m_networkProcess)
+    if (m_networkProcess)
         m_networkProcess->send(Messages::NetworkProcess::UserPreferredLanguagesChanged(userPreferredLanguages()), 0);
 #endif
 }
@@ -343,16 +330,6 @@ void WebProcessPool::textCheckerStateChanged()
     sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state()));
 }
 
-void WebProcessPool::setUsesNetworkProcess(bool usesNetworkProcess)
-{
-    m_configuration->setUseNetworkProcess(usesNetworkProcess);
-}
-
-bool WebProcessPool::usesNetworkProcess() const
-{
-    return m_configuration->useNetworkProcess();
-}
-
 NetworkProcessProxy& WebProcessPool::ensureNetworkProcess()
 {
     if (m_networkProcess)
@@ -504,7 +481,7 @@ void WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool private
 {
     m_iconDatabase->setPrivateBrowsingEnabled(privateBrowsingEnabled);
 
-    if (usesNetworkProcess() && networkProcess()) {
+    if (networkProcess()) {
         if (privateBrowsingEnabled)
             networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
         else
@@ -554,8 +531,7 @@ WebProcessProxy& WebProcessPool::ensureSharedWebProcess()
 
 WebProcessProxy& WebProcessPool::createNewWebProcess()
 {
-    if (usesNetworkProcess())
-        ensureNetworkProcess();
+    ensureNetworkProcess();
 
     Ref<WebProcessProxy> process = WebProcessProxy::create(*this);
 
@@ -632,8 +608,6 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
     supplement<WebNotificationManagerProxy>()->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
 #endif
 
-    parameters.usesNetworkProcess = usesNetworkProcess();
-
     parameters.plugInAutoStartOriginHashes = m_plugInAutoStartProvider.autoStartOriginHashesCopy();
     copyToVector(m_plugInAutoStartProvider.autoStartOrigins(), parameters.plugInAutoStartOrigins);
 
@@ -841,16 +815,14 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
 DownloadProxy* WebProcessPool::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
 {
     DownloadProxy* downloadProxy = createDownloadProxy(request);
-    uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
     SessionID sessionID = initiatingPage ? initiatingPage->sessionID() : SessionID::defaultSessionID();
 
-    if (usesNetworkProcess() && networkProcess()) {
+    if (networkProcess()) {
         // FIXME (NetworkProcess): Replicate whatever FrameLoader::setOriginalURLForDownloadRequest does with the request here.
         networkProcess()->send(Messages::NetworkProcess::DownloadRequest(sessionID, downloadProxy->downloadID(), request), 0);
         return downloadProxy;
     }
 
-    m_processes[0]->send(Messages::WebProcess::DownloadRequest(sessionID, downloadProxy->downloadID(), initiatingPageID, request), 0);
     return downloadProxy;
 }
 
@@ -862,12 +834,11 @@ DownloadProxy* WebProcessPool::resumeDownload(const API::Data* resumeData, const
     if (!path.isEmpty())
         SandboxExtension::createHandle(path, SandboxExtension::ReadWrite, sandboxExtensionHandle);
 
-    if (usesNetworkProcess() && networkProcess()) {
+    if (networkProcess()) {
         networkProcess()->send(Messages::NetworkProcess::ResumeDownload(downloadProxy->downloadID(), resumeData->dataReference(), path, sandboxExtensionHandle), 0);
         return downloadProxy;
     }
 
-    m_processes[0]->send(Messages::WebProcess::ResumeDownload(downloadProxy->downloadID(), resumeData->dataReference(), path, sandboxExtensionHandle), 0);
     return downloadProxy;
 }
 
@@ -954,7 +925,7 @@ void WebProcessPool::setDomainRelaxationForbiddenForURLScheme(const String& urlS
 void WebProcessPool::setCanHandleHTTPSServerTrustEvaluation(bool value)
 {
     m_canHandleHTTPSServerTrustEvaluation = value;
-    if (usesNetworkProcess() && m_networkProcess) {
+    if (m_networkProcess) {
         m_networkProcess->send(Messages::NetworkProcess::SetCanHandleHTTPSServerTrustEvaluation(value), 0);
         return;
     }
@@ -1025,7 +996,7 @@ void WebProcessPool::setCacheModel(CacheModel cacheModel)
     m_configuration->setCacheModel(cacheModel);
     sendToAllProcesses(Messages::WebProcess::SetCacheModel(cacheModel));
 
-    if (usesNetworkProcess() && m_networkProcess)
+    if (m_networkProcess)
         m_networkProcess->send(Messages::NetworkProcess::SetCacheModel(cacheModel), 0);
 }
 
@@ -1036,13 +1007,7 @@ void WebProcessPool::setDefaultRequestTimeoutInterval(double timeoutInterval)
 
 DownloadProxy* WebProcessPool::createDownloadProxy(const ResourceRequest& request)
 {
-    if (usesNetworkProcess()) {
-        ensureNetworkProcess();
-        ASSERT(m_networkProcess);
-        return m_networkProcess->createDownloadProxy(request);
-    }
-
-    return ensureSharedWebProcess().createDownloadProxy(request);
+    return ensureNetworkProcess().createDownloadProxy(request);
 }
 
 void WebProcessPool::addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver& messageReceiver)
@@ -1152,22 +1117,8 @@ void WebProcessPool::useTestingNetworkSession()
 
 void WebProcessPool::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host)
 {
-    if (usesNetworkProcess() && m_networkProcess) {
+    if (m_networkProcess)
         m_networkProcess->send(Messages::NetworkProcess::AllowSpecificHTTPSCertificateForHost(certificate->certificateInfo(), host), 0);
-        return;
-    }
-
-#if USE(SOUP)
-    m_processes[0]->send(Messages::WebProcess::AllowSpecificHTTPSCertificateForHost(certificate->certificateInfo(), host), 0);
-    return;
-#else
-    UNUSED_PARAM(certificate);
-    UNUSED_PARAM(host);
-#endif
-
-#if !PLATFORM(IOS)
-    ASSERT_NOT_REACHED();
-#endif
 }
 
 void WebProcessPool::setHTTPPipeliningEnabled(bool enabled)
@@ -1221,7 +1172,7 @@ void WebProcessPool::requestWebContentStatistics(StatisticsRequest* request)
 
 void WebProcessPool::requestNetworkingStatistics(StatisticsRequest* request)
 {
-    if (!usesNetworkProcess() || !m_networkProcess) {
+    if (!m_networkProcess) {
         LOG_ERROR("Attempt to get NetworkProcess statistics but the NetworkProcess is unavailable");
         return;
     }
index 5c14978..3b19775 100644 (file)
@@ -277,10 +277,6 @@ public:
     void setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime(API::Dictionary&, double time);
 
     // Network Process Management
-
-    void setUsesNetworkProcess(bool);
-    bool usesNetworkProcess() const;
-
     NetworkProcessProxy& ensureNetworkProcess();
     NetworkProcessProxy* networkProcess() { return m_networkProcess.get(); }
     void networkProcessCrashed(NetworkProcessProxy*);
@@ -525,43 +521,15 @@ private:
 template<typename T>
 void WebProcessPool::sendToNetworkingProcess(T&& message)
 {
-    switch (processModel()) {
-    case ProcessModelSharedSecondaryProcess:
-        if (usesNetworkProcess()) {
-            if (m_networkProcess && m_networkProcess->canSendMessage())
-                m_networkProcess->send(std::forward<T>(message), 0);
-            return;
-        }
-        if (!m_processes.isEmpty() && m_processes[0]->canSendMessage())
-            m_processes[0]->send(std::forward<T>(message), 0);
-        return;
-    case ProcessModelMultipleSecondaryProcesses:
-        if (m_networkProcess && m_networkProcess->canSendMessage())
-            m_networkProcess->send(std::forward<T>(message), 0);
-        return;
-    }
-    ASSERT_NOT_REACHED();
+    if (m_networkProcess && m_networkProcess->canSendMessage())
+        m_networkProcess->send(std::forward<T>(message), 0);
 }
 
 template<typename T>
 void WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary(T&& message)
 {
-    switch (processModel()) {
-    case ProcessModelSharedSecondaryProcess:
-        if (usesNetworkProcess()) {
-            ensureNetworkProcess();
-            m_networkProcess->send(std::forward<T>(message), 0);
-            return;
-        }
-        ensureSharedWebProcess();
-        m_processes[0]->send(std::forward<T>(message), 0);
-        return;
-    case ProcessModelMultipleSecondaryProcesses:
-        ensureNetworkProcess();
-        m_networkProcess->send(std::forward<T>(message), 0);
-        return;
-    }
-    ASSERT_NOT_REACHED();
+    ensureNetworkProcess();
+    m_networkProcess->send(std::forward<T>(message), 0);
 }
 
 template<typename T>
index cd1de9d..abeb721 100644 (file)
@@ -202,9 +202,6 @@ void WebProcessProxy::shutDown()
         frames[i]->webProcessWillShutDown();
     m_frameMap.clear();
 
-    if (m_downloadProxyMap)
-        m_downloadProxyMap->processDidClose();
-
     for (VisitedLinkStore* visitedLinkStore : m_visitedLinkStores)
         visitedLinkStore->removeProcess(*this);
     m_visitedLinkStores.clear();
@@ -256,7 +253,7 @@ void WebProcessProxy::removeWebPage(uint64_t pageID)
 
     // If this was the last WebPage open in that web process, and we have no other reason to keep it alive, let it go.
     // We only allow this when using a network process, as otherwise the WebProcess needs to preserve its session state.
-    if (!m_processPool->usesNetworkProcess() || state() == State::Terminated || !canTerminateChildProcess())
+    if (state() == State::Terminated || !canTerminateChildProcess())
         return;
 
     shutDown();
@@ -655,9 +652,6 @@ bool WebProcessProxy::canTerminateChildProcess()
     if (!m_pageMap.isEmpty())
         return false;
 
-    if (m_downloadProxyMap && !m_downloadProxyMap->isEmpty())
-        return false;
-
     if (!m_pendingDeleteWebsiteDataCallbacks.isEmpty())
         return false;
 
@@ -700,16 +694,6 @@ void WebProcessProxy::updateTextCheckerState()
         send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0);
 }
 
-DownloadProxy* WebProcessProxy::createDownloadProxy(const ResourceRequest& request)
-{
-    ASSERT(!m_processPool->usesNetworkProcess());
-
-    if (!m_downloadProxyMap)
-        m_downloadProxyMap = std::make_unique<DownloadProxyMap>(this);
-
-    return m_downloadProxyMap->createDownloadProxy(m_processPool, request);
-}
-
 void WebProcessProxy::didSaveToPageCache()
 {
     m_processPool->processDidCachePage(this);
@@ -972,14 +956,12 @@ void WebProcessProxy::didSetAssertionState(AssertionState state)
         break;
 
     case AssertionState::Background:
-        if (processPool().usesNetworkProcess())
-            m_backgroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().backgroundActivityToken();
+        m_backgroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().backgroundActivityToken();
         m_foregroundTokenForNetworkProcess = nullptr;
         break;
     
     case AssertionState::Foreground:
-        if (processPool().usesNetworkProcess())
-            m_foregroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().foregroundActivityToken();
+        m_foregroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().foregroundActivityToken();
         m_backgroundTokenForNetworkProcess = nullptr;
         for (auto& page : m_pageMap.values())
             page->processWillBecomeForeground();
index 9f3d7d3..a65b455 100644 (file)
@@ -58,7 +58,6 @@ struct PluginInfo;
 
 namespace WebKit {
 
-class DownloadProxyMap;
 class NetworkProcessProxy;
 class WebBackForwardListItem;
 class WebPageGroup;
@@ -120,8 +119,6 @@ public:
 
     static bool fullKeyboardAccessEnabled();
 
-    DownloadProxy* createDownloadProxy(const WebCore::ResourceRequest&);
-
     void didSaveToPageCache();
     void releasePageCache();
 
@@ -242,7 +239,6 @@ private:
     HashSet<VisitedLinkStore*> m_visitedLinkStores;
     HashSet<WebUserContentControllerProxy*> m_webUserContentControllerProxies;
 
-    std::unique_ptr<DownloadProxyMap> m_downloadProxyMap;
     CustomProtocolManagerProxy m_customProtocolManagerProxy;
 
     HashMap<uint64_t, std::function<void (WebsiteData)>> m_pendingFetchWebsiteDataCallbacks;
index 1f84142..b0a3dfb 100644 (file)
@@ -89,12 +89,6 @@ String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
 void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
 {
     initializeInspectorServer();
-
-    parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols();
-    supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
-    parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
-    parameters.ignoreTLSErrors = m_ignoreTLSErrors;
-    parameters.diskCacheDirectory = m_configuration->diskCacheDirectory();
 }
 
 void WebProcessPool::platformInvalidateContext()
@@ -146,7 +140,6 @@ String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
 void WebProcessPool::setIgnoreTLSErrors(bool ignoreTLSErrors)
 {
     m_ignoreTLSErrors = ignoreTLSErrors;
-    sendToAllProcesses(Messages::WebProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors));
 }
 
 } // namespace WebKit
index b408de6..7f44bea 100644 (file)
@@ -38,8 +38,6 @@ namespace WebKit {
 
 void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<BlobDataFileReference> file, const String& contentType)
 {
-    ASSERT(WebProcess::singleton().usesNetworkProcess());
-
     SandboxExtension::Handle extensionHandle;
 
     // File path can be empty when submitting a form file input without a file, see bug 111778.
@@ -51,36 +49,26 @@ void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
 {
-    ASSERT(WebProcess::singleton().usesNetworkProcess());
-
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
 {
-    ASSERT(WebProcess::singleton().usesNetworkProcess());
-
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
 }
 
 void BlobRegistryProxy::unregisterBlobURL(const URL& url)
 {
-    ASSERT(WebProcess::singleton().usesNetworkProcess());
-
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
 }
 
 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
 {
-    ASSERT(WebProcess::singleton().usesNetworkProcess());
-
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
 }
 
 unsigned long long BlobRegistryProxy::blobSize(const URL& url)
 {
-    ASSERT(WebProcess::singleton().usesNetworkProcess());
-
     uint64_t resultSize;
     if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
         return 0;
index 3eeb2e8..71cc39a 100644 (file)
@@ -109,101 +109,54 @@ PluginStrategy* WebPlatformStrategies::createPluginStrategy()
 
 String WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (webProcess.usesNetworkProcess()) {
-        String result;
-        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
-            return String();
-        return result;
-    }
-
-    return WebCore::cookiesForDOM(session, firstParty, url);
+    String result;
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
+        return String();
+    return result;
 }
 
 void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const String& cookieString)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (webProcess.usesNetworkProcess()) {
-        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(SessionTracker::sessionID(session), firstParty, url, cookieString), 0);
-        return;
-    }
-
-    WebCore::setCookiesFromDOM(session, firstParty, url, cookieString);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(SessionTracker::sessionID(session), firstParty, url, cookieString), 0);
 }
 
 bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session, const URL& firstParty, const URL& url)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (webProcess.usesNetworkProcess()) {
-        bool result;
-        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
-            return false;
-        return result;
-    }
-
-    return WebCore::cookiesEnabled(session, firstParty, url);
+    bool result;
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
+        return false;
+    return result;
 }
 
 String WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const URL& url)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (webProcess.usesNetworkProcess()) {
-        String result;
-        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
-            return String();
-        return result;
-    }
-
-    return WebCore::cookieRequestHeaderFieldValue(session, firstParty, url);
+    String result;
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
+        return String();
+    return result;
 }
 
 bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const URL& url, Vector<Cookie>& rawCookies)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (webProcess.usesNetworkProcess()) {
-        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
-            return false;
-        return true;
-    }
-
-    return WebCore::getRawCookies(session, firstParty, url, rawCookies);
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
+        return false;
+    return true;
 }
 
 void WebPlatformStrategies::deleteCookie(const NetworkStorageSession& session, const URL& url, const String& cookieName)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (webProcess.usesNetworkProcess()) {
-        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(SessionTracker::sessionID(session), url, cookieName), 0);
-        return;
-    }
-
-    WebCore::deleteCookie(session, url, cookieName);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(SessionTracker::sessionID(session), url, cookieName), 0);
 }
 
 // LoaderStrategy
 
 ResourceLoadScheduler* WebPlatformStrategies::resourceLoadScheduler()
 {
-    static ResourceLoadScheduler* scheduler;
-    if (!scheduler) {
-        auto& webProcess = WebProcess::singleton();
-        if (webProcess.usesNetworkProcess())
-            scheduler = &webProcess.webResourceLoadScheduler();
-        else
-            scheduler = WebCore::resourceLoadScheduler();
-    }
-    
-    return scheduler;
+    return &WebProcess::singleton().webResourceLoadScheduler();
 }
 
 void WebPlatformStrategies::loadResourceSynchronously(NetworkingContext* context, unsigned long resourceLoadIdentifier, const ResourceRequest& request, StoredCredentials storedCredentials, ClientCredentialPolicy clientCredentialPolicy, ResourceError& error, ResourceResponse& response, Vector<char>& data)
 {
-    auto& webProcess = WebProcess::singleton();
-    if (!webProcess.usesNetworkProcess()) {
-        LoaderStrategy::loadResourceSynchronously(context, resourceLoadIdentifier, request, storedCredentials, clientCredentialPolicy, error, response, data);
-        return;
-    }
-
     WebFrameNetworkingContext* webContext = static_cast<WebFrameNetworkingContext*>(context);
     // FIXME: Some entities in WebCore use WebCore's "EmptyFrameLoaderClient" instead of having a proper WebFrameLoaderClient.
     // EmptyFrameLoaderClient shouldn't exist and everything should be using a WebFrameLoaderClient,
@@ -227,7 +180,7 @@ void WebPlatformStrategies::loadResourceSynchronously(NetworkingContext* context
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
+    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
         response = ResourceResponse();
         error = internalError(request.url());
     }
@@ -240,12 +193,6 @@ void WebPlatformStrategies::createPingHandle(NetworkingContext* networkingContex
     if (!networkingContext)
         return;
 
-    auto& webProcess = WebProcess::singleton();
-    if (!webProcess.usesNetworkProcess()) {
-        LoaderStrategy::createPingHandle(networkingContext, request, shouldUseCredentialStorage);
-        return;
-    }
-
     WebFrameNetworkingContext* webContext = static_cast<WebFrameNetworkingContext*>(networkingContext);
     WebFrameLoaderClient* webFrameLoaderClient = webContext->webFrameLoaderClient();
     WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : nullptr;
@@ -257,14 +204,12 @@ void WebPlatformStrategies::createPingHandle(NetworkingContext* networkingContex
     loadParameters.allowStoredCredentials = shouldUseCredentialStorage ? AllowStoredCredentials : DoNotAllowStoredCredentials;
     loadParameters.shouldClearReferrerOnHTTPSToHTTPRedirect = networkingContext->shouldClearReferrerOnHTTPSToHTTPRedirect();
 
-    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::LoadPing(loadParameters), 0);
+    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::LoadPing(loadParameters), 0);
 }
 
 BlobRegistry* WebPlatformStrategies::createBlobRegistry()
 {
-    if (!WebProcess::singleton().usesNetworkProcess())
-        return LoaderStrategy::createBlobRegistry();
-    return new BlobRegistryProxy;    
+    return new BlobRegistryProxy;
 }
 
 // PluginStrategy
index 427c835..d653b58 100644 (file)
@@ -254,21 +254,8 @@ void WebFrame::startDownload(const WebCore::ResourceRequest& request)
     m_policyDownloadID = 0;
 
     auto& webProcess = WebProcess::singleton();
-#if USE(NETWORK_SESSION)
-    ASSERT(webProcess.usesNetworkProcess());
-#endif
     SessionID sessionID = page() ? page()->sessionID() : SessionID::defaultSessionID();
-    if (webProcess.usesNetworkProcess()) {
-        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request), 0);
-        return;
-    }
-
-#if USE(NETWORK_SESSION)
-    // Using NETWORK_SESSION requires the use of a network process.
-    RELEASE_ASSERT_NOT_REACHED();
-#else
-    webProcess.downloadManager().startDownload(sessionID, policyDownloadID, request);
-#endif
+    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request), 0);
 }
 
 void WebFrame::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, SessionID sessionID, const ResourceRequest& request, const ResourceResponse& response)
@@ -281,37 +268,16 @@ void WebFrame::convertMainResourceLoadToDownload(DocumentLoader* documentLoader,
     SubresourceLoader* mainResourceLoader = documentLoader->mainResourceLoader();
 
     auto& webProcess = WebProcess::singleton();
-#if USE(NETWORK_SESSION)
-    ASSERT(webProcess.usesNetworkProcess());
-#endif
-    if (webProcess.usesNetworkProcess()) {
-        // Use 0 to indicate that the resource load can't be converted and a new download must be started.
-        // This can happen if there is no loader because the main resource is in the WebCore memory cache,
-        // or because the conversion was attempted when not calling SubresourceLoader::didReceiveResponse().
-        uint64_t mainResourceLoadIdentifier;
-        if (mainResourceLoader)
-            mainResourceLoadIdentifier = mainResourceLoader->identifier();
-        else
-            mainResourceLoadIdentifier = 0;
-
-        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
-        return;
-    }
-
-    if (!mainResourceLoader) {
-        // The main resource has already been loaded. Start a new download instead.
-#if !USE(NETWORK_SESSION)
-        webProcess.downloadManager().startDownload(sessionID, policyDownloadID, request);
-#endif
-        return;
-    }
-
-#if USE(NETWORK_SESSION)
-    // Using NETWORK_SESSION requires the use of a network process.
-    RELEASE_ASSERT_NOT_REACHED();
-#else
-    webProcess.downloadManager().convertHandleToDownload(policyDownloadID, documentLoader->mainResourceLoader()->handle(), request, response);
-#endif
+    // Use 0 to indicate that the resource load can't be converted and a new download must be started.
+    // This can happen if there is no loader because the main resource is in the WebCore memory cache,
+    // or because the conversion was attempted when not calling SubresourceLoader::didReceiveResponse().
+    uint64_t mainResourceLoadIdentifier;
+    if (mainResourceLoader)
+        mainResourceLoadIdentifier = mainResourceLoader->identifier();
+    else
+        mainResourceLoadIdentifier = 0;
+
+    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
 }
 
 String WebFrame::source() const
index dae9283..1bdcf8d 100644 (file)
@@ -31,7 +31,6 @@
 #include "APIPageHandle.h"
 #include "AuthenticationManager.h"
 #include "ChildProcessMessages.h"
-#include "CustomProtocolManager.h"
 #include "DrawingArea.h"
 #include "EventDispatcher.h"
 #include "InjectedBundle.h"
@@ -156,7 +155,6 @@ WebProcess::WebProcess()
     , m_fullKeyboardAccessEnabled(false)
     , m_textCheckerState()
     , m_iconDatabaseProxy(new WebIconDatabaseProxy(this))
-    , m_usesNetworkProcess(false)
     , m_webResourceLoadScheduler(new WebResourceLoadScheduler)
     , m_dnsPrefetchHystereris([this](HysteresisState state) { if (state == HysteresisState::Stopped) m_dnsPrefetchedHosts.clear(); })
 #if ENABLE(NETSCAPE_PLUGIN_API)
@@ -187,7 +185,6 @@ WebProcess::WebProcess()
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     addSupplement<WebNotificationManager>();
 #endif
-    addSupplement<CustomProtocolManager>();
 #if ENABLE(BATTERY_STATUS)
     addSupplement<WebBatteryManager>();
 #endif
@@ -245,32 +242,10 @@ void WebProcess::initializeConnection(IPC::Connection* connection)
     connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true);
 }
 
-void WebProcess::didCreateDownload()
-{
-    disableTermination();
-}
-
-void WebProcess::didDestroyDownload()
-{
-    enableTermination();
-}
-
-IPC::Connection* WebProcess::downloadProxyConnection()
-{
-    return parentProcessConnection();
-}
-
-AuthenticationManager& WebProcess::downloadsAuthenticationManager()
-{
-    return *supplement<AuthenticationManager>();
-}
-
 void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
 {
     ASSERT(m_pageMap.isEmpty());
 
-    m_usesNetworkProcess = parameters.usesNetworkProcess;
-
 #if OS(LINUX)
     WebCore::MemoryPressureHandler::ReliefLogger::setLoggingEnabled(parameters.shouldEnableMemoryPressureReliefLogging);
 #endif
@@ -352,8 +327,7 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
     ensureNetworkProcessConnection();
 
 #if PLATFORM(COCOA)
-    if (usesNetworkProcess())
-        CookieStorageShim::singleton().initialize();
+    CookieStorageShim::singleton().initialize();
 #endif
     setTerminationTimeout(parameters.terminationTimeout);
 
@@ -387,9 +361,6 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
 
 void WebProcess::ensureNetworkProcessConnection()
 {
-    if (!m_usesNetworkProcess)
-        return;
-
     if (m_networkProcessConnection)
         return;
 
@@ -498,14 +469,6 @@ void WebProcess::destroyPrivateBrowsingSession(SessionID sessionID)
 #endif
 }
 
-DownloadManager& WebProcess::downloadManager()
-{
-    ASSERT(!usesNetworkProcess());
-
-    static NeverDestroyed<DownloadManager> downloadManager(this);
-    return downloadManager;
-}
-
 #if ENABLE(NETSCAPE_PLUGIN_API)
 PluginProcessConnectionManager& WebProcess::pluginProcessConnectionManager()
 {
@@ -568,7 +531,6 @@ void WebProcess::removeWebPage(uint64_t pageID)
 bool WebProcess::shouldTerminate()
 {
     ASSERT(m_pageMap.isEmpty());
-    ASSERT(usesNetworkProcess() || !downloadManager().isDownloading());
 
     // FIXME: the ShouldTerminate message should also send termination parameters, such as any session cookies that need to be preserved.
     bool shouldTerminate = false;
@@ -1017,15 +979,8 @@ void WebProcess::setInjectedBundleParameters(const IPC::DataReference& value)
     injectedBundle->setBundleParameters(value);
 }
 
-bool WebProcess::usesNetworkProcess() const
-{
-    return m_usesNetworkProcess;
-}
-
 NetworkProcessConnection* WebProcess::networkConnection()
 {
-    ASSERT(m_usesNetworkProcess);
-
     // If we've lost our connection to the network process (e.g. it crashed) try to re-establish it.
     if (!m_networkProcessConnection)
         ensureNetworkProcessConnection();
@@ -1094,27 +1049,6 @@ void WebProcess::ensureWebToDatabaseProcessConnection()
 
 #endif // ENABLED(DATABASE_PROCESS)
 
-void WebProcess::downloadRequest(SessionID sessionID, uint64_t downloadID, uint64_t initiatingPageID, const ResourceRequest& request)
-{
-    WebPage* initiatingPage = initiatingPageID ? webPage(initiatingPageID) : 0;
-
-    ResourceRequest requestWithOriginalURL = request;
-    if (initiatingPage)
-        initiatingPage->mainFrame()->loader().setOriginalURLForDownloadRequest(requestWithOriginalURL);
-
-    downloadManager().startDownload(sessionID, downloadID, requestWithOriginalURL);
-}
-
-void WebProcess::resumeDownload(uint64_t downloadID, const IPC::DataReference& resumeData, const String& path, const WebKit::SandboxExtension::Handle& sandboxExtensionHandle)
-{
-    downloadManager().resumeDownload(downloadID, resumeData, path, sandboxExtensionHandle);
-}
-
-void WebProcess::cancelDownload(uint64_t downloadID)
-{
-    downloadManager().cancelDownload(downloadID);
-}
-
 void WebProcess::setEnhancedAccessibility(bool flag)
 {
     WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility(flag);
@@ -1456,16 +1390,12 @@ void WebProcess::prefetchDNS(const String& hostname)
     if (hostname.isEmpty())
         return;
 
-    if (usesNetworkProcess()) {
-        if (m_dnsPrefetchedHosts.add(hostname).isNewEntry)
-            networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
-        // The DNS prefetched hosts cache is only to avoid asking for the same hosts too many times
-        // in a very short period of time, producing a lot of IPC traffic. So we clear this cache after
-        // some time of no DNS requests.
-        m_dnsPrefetchHystereris.impulse();
-        return;
-    }
-    WebCore::prefetchDNS(hostname);
+    if (m_dnsPrefetchedHosts.add(hostname).isNewEntry)
+        networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
+    // The DNS prefetched hosts cache is only to avoid asking for the same hosts too many times
+    // in a very short period of time, producing a lot of IPC traffic. So we clear this cache after
+    // some time of no DNS requests.
+    m_dnsPrefetchHystereris.impulse();
 }
 
 } // namespace WebKit
index 614340b..77bb30e 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CacheModel.h"
 #include "ChildProcess.h"
-#include "DownloadManager.h"
 #include "DrawingArea.h"
 #include "PluginProcessConnectionManager.h"
 #include "ResourceCachesToClear.h"
@@ -71,7 +70,6 @@ struct SecurityOriginData;
 
 namespace WebKit {
 
-class DownloadManager;
 class EventDispatcher;
 class InjectedBundle;
 class NetworkProcessConnection;
@@ -93,8 +91,7 @@ struct WebProcessCreationParameters;
 class WebToDatabaseProcessConnection;
 #endif
 
-class WebProcess : public ChildProcess, private DownloadManager::Client {
-    friend class NeverDestroyed<DownloadManager>;
+class WebProcess : public ChildProcess {
 public:
     static WebProcess& singleton();
 
@@ -144,7 +141,6 @@ public:
 #endif
     
     const TextCheckerState& textCheckerState() const { return m_textCheckerState; }
-    DownloadManager& downloadManager();
 
     void clearResourceCaches(ResourceCachesToClear = AllResourceCaches);
     
@@ -154,8 +150,6 @@ public:
 
     EventDispatcher& eventDispatcher() { return *m_eventDispatcher; }
 
-    bool usesNetworkProcess() const;
-
     NetworkProcessConnection* networkConnection();
     void networkProcessConnectionClosed(NetworkProcessConnection*);
     WebResourceLoadScheduler& webResourceLoadScheduler();
@@ -181,10 +175,6 @@ public:
 
     void updateActivePages();
 
-#if USE(SOUP)
-    void allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo&, const String& host);
-#endif
-
     void processWillSuspendImminently(bool& handled);
     void prepareToSuspend();
     void cancelPrepareToSuspend();
@@ -217,12 +207,6 @@ private:
     WebProcess();
     ~WebProcess();
 
-    // DownloadManager::Client.
-    virtual void didCreateDownload() override;
-    virtual void didDestroyDownload() override;
-    virtual IPC::Connection* downloadProxyConnection() override;
-    virtual AuthenticationManager& downloadsAuthenticationManager() override;
-
     void initializeWebProcess(WebProcessCreationParameters&&);
     void platformInitializeWebProcess(WebProcessCreationParameters&&);
 
@@ -258,10 +242,6 @@ private:
     void startMemorySampler(const SandboxExtension::Handle&, const String&, const double);
     void stopMemorySampler();
 
-    void downloadRequest(WebCore::SessionID, uint64_t downloadID, uint64_t initiatingPageID, const WebCore::ResourceRequest&);
-    void resumeDownload(uint64_t downloadID, const IPC::DataReference& resumeData, const String& path, const SandboxExtension::Handle&);
-    void cancelDownload(uint64_t downloadID);
-
     void setTextCheckerState(const TextCheckerState&);
     
     void getWebCoreStatistics(uint64_t callbackID);
@@ -276,10 +256,6 @@ private:
     void deleteWebsiteData(WebCore::SessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID);
     void deleteWebsiteDataForOrigins(WebCore::SessionID, uint64_t websiteDataTypes, const Vector<WebCore::SecurityOriginData>& origins, uint64_t callbackID);
 
-#if USE(SOUP)
-    void setIgnoreTLSErrors(bool);
-#endif
-
     void setMemoryCacheDisabled(bool);
 
 #if ENABLE(SERVICE_CONTROLS)
@@ -358,7 +334,6 @@ private:
 
     void ensureNetworkProcessConnection();
     RefPtr<NetworkProcessConnection> m_networkProcessConnection;
-    bool m_usesNetworkProcess;
     WebResourceLoadScheduler* m_webResourceLoadScheduler;
     HashSet<String> m_dnsPrefetchedHosts;
     WebCore::HysteresisActivity m_dnsPrefetchHystereris;
index 0878317..dbd1693 100644 (file)
@@ -44,9 +44,6 @@ messages -> WebProcess LegacyReceiver {
     SetShouldUseFontSmoothing(bool useFontSmoothing)
     UserPreferredLanguagesChanged(Vector<String> languages)
     FullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
-#if USE(SOUP)
-    SetIgnoreTLSErrors(bool ignoreTLSErrors)
-#endif
 
     // Legacy private browsing session is per process. Individual pages or page groups may use the private session or the default one as appropriate.
     EnsurePrivateBrowsingSession(WebCore::SessionID sessionID)
@@ -62,12 +59,6 @@ messages -> WebProcess LegacyReceiver {
     void StartMemorySampler(WebKit::SandboxExtension::Handle sampleLogFileHandle, String sampleLogFilePath, double interval);
     void StopMemorySampler();
 
-    # Downloads. This should really be in a Download.messages.in, but it seemed unnecessary to create a new file just for
-    # three messages.
-    DownloadRequest(WebCore::SessionID sessionID, uint64_t downloadID, uint64_t initiatingPageID, WebCore::ResourceRequest request)
-    ResumeDownload(uint64_t downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
-    CancelDownload(uint64_t downloadID)
-
     SetTextCheckerState(struct WebKit::TextCheckerState textCheckerState)
 
     SetEnhancedAccessibility(bool flag)
@@ -91,10 +82,6 @@ messages -> WebProcess LegacyReceiver {
     SetQOS(int latencyQOS, int throughputQOS)
 #endif
 
-#if USE(SOUP)
-    AllowSpecificHTTPSCertificateForHost(WebCore::CertificateInfo certificate, String host)
-#endif
-
     SetMemoryCacheDisabled(bool disabled);
 
 #if ENABLE(SERVICE_CONTROLS)
index 325be46..b1b93cc 100644 (file)
 
 namespace WebKit {
 
-static uint64_t getCacheDiskFreeSize(SoupCache* cache)
-{
-    ASSERT(cache);
-
-    GUniqueOutPtr<char> cacheDir;
-    g_object_get(G_OBJECT(cache), "cache-dir", &cacheDir.outPtr(), NULL);
-    if (!cacheDir)
-        return 0;
-
-    return WebCore::getVolumeFreeSizeForPath(cacheDir.get());
-}
-
 void WebProcess::platformSetCacheModel(CacheModel cacheModel)
 {
     unsigned cacheTotalCapacity = 0;
@@ -73,12 +61,6 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
     unsigned long urlCacheDiskCapacity = 0;
 
     uint64_t diskFreeSize = 0;
-    SoupCache* cache = nullptr;
-
-    if (!usesNetworkProcess()) {
-        cache = WebCore::SoupNetworkSession::defaultSession().cache();
-        diskFreeSize = getCacheDiskFreeSize(cache) / WTF::MB;
-    }
 
     uint64_t memSize = WTF::ramSize() / WTF::MB;
     calculateCacheSizes(cacheModel, memSize, diskFreeSize,
@@ -94,33 +76,10 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
 #if PLATFORM(GTK)
     WebCore::PageCache::singleton().setShouldClearBackingStores(true);
 #endif
-
-    if (!usesNetworkProcess()) {
-        if (urlCacheDiskCapacity > soup_cache_get_max_size(cache))
-            soup_cache_set_max_size(cache, urlCacheDiskCapacity);
-    }
 }
 
 void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear)
 {
-    if (cachesToClear == InMemoryResourceCachesOnly)
-        return;
-
-    // If we're using the network process then it is the only one that needs to clear the disk cache.
-    if (usesNetworkProcess())
-        return;
-
-    soup_cache_clear(WebCore::SoupNetworkSession::defaultSession().cache());
-}
-
-static void setSoupSessionAcceptLanguage(const Vector<String>& languages)
-{
-    WebCore::SoupNetworkSession::defaultSession().setAcceptLanguages(languages);
-}
-
-static void languageChanged(void*)
-{
-    setSoupSessionAcceptLanguage(WebCore::userPreferredLanguages());
 }
 
 void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters)
@@ -135,62 +94,10 @@ void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& par
         seccompFilters.initialize();
     }
 #endif
-
-    if (usesNetworkProcess())
-        return;
-
-    ASSERT(!parameters.diskCacheDirectory.isEmpty());
-
-    // We used to use the given cache directory for the soup cache, but now we use a subdirectory to avoid
-    // conflicts with other cache files in the same directory. Remove the old cache files if they still exist.
-    WebCore::SoupNetworkSession::defaultSession().clearCache(WebCore::directoryName(parameters.diskCacheDirectory));
-
-#if ENABLE(NETWORK_CACHE)
-    // When network cache is enabled, the disk cache directory is the network process one.
-    CString diskCachePath = WebCore::pathByAppendingComponent(WebCore::directoryName(parameters.diskCacheDirectory), "webkit").utf8();
-#else
-    CString diskCachePath = parameters.diskCacheDirectory.utf8();
-#endif
-
-    GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(diskCachePath.data(), SOUP_CACHE_SINGLE_USER));
-    WebCore::SoupNetworkSession::defaultSession().setCache(soupCache.get());
-    // Set an initial huge max_size for the SoupCache so the call to soup_cache_load() won't evict any cached
-    // resource. The final size of the cache will be set by NetworkProcess::platformSetCacheModel().
-    unsigned initialMaxSize = soup_cache_get_max_size(soupCache.get());
-    soup_cache_set_max_size(soupCache.get(), G_MAXUINT);
-    soup_cache_load(soupCache.get());
-    soup_cache_set_max_size(soupCache.get(), initialMaxSize);
-
-    if (!parameters.cookiePersistentStoragePath.isEmpty()) {
-        supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath,
-            parameters.cookiePersistentStorageType);
-    }
-    supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy);
-
-    if (!parameters.languages.isEmpty())
-        setSoupSessionAcceptLanguage(parameters.languages);
-
-    setIgnoreTLSErrors(parameters.ignoreTLSErrors);
-
-    WebCore::addLanguageChangeObserver(this, languageChanged);
 }
 
 void WebProcess::platformTerminate()
 {
-    if (!usesNetworkProcess())
-        WebCore::removeLanguageChangeObserver(this);
-}
-
-void WebProcess::setIgnoreTLSErrors(bool ignoreTLSErrors)
-{
-    ASSERT(!usesNetworkProcess());
-    WebCore::ResourceHandle::setIgnoreSSLErrors(ignoreTLSErrors);
-}
-
-void WebProcess::allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo& certificateInfo, const String& host)
-{
-    ASSERT(!usesNetworkProcess());
-    WebCore::ResourceHandle::setClientCertificate(host, certificateInfo.certificate());
 }
 
 } // namespace WebKit
index 56719e1..c897cd9 100644 (file)
@@ -1,3 +1,17 @@
+2015-11-30  Alex Christensen  <achristensen@webkit.org>
+
+        Make usesNetworkProcess always true
+        https://bugs.webkit.org/show_bug.cgi?id=151580
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp:
+        (TestWebKitAPI::TEST):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::generatePageConfiguration):
+
 2015-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Skip GTK+ test /webkit2/WebKitWebView/editable/editable in Debug.
index fea4126..f0551ed 100644 (file)
@@ -250,7 +250,6 @@ struct GeolocationTransitionToHighAccuracyStateTracker : GeolocationStateTracker
 TEST(WebKit2, GeolocationTransitionToHighAccuracy)
 {
     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
-    WKContextSetUsesNetworkProcess(context.get(), true);
 
     GeolocationTransitionToHighAccuracyStateTracker stateTracker;
     setupGeolocationProvider(context.get(), &stateTracker);
index c5c3eff..7cd4f7c 100644 (file)
@@ -42,7 +42,6 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
 TEST(WebKit2, GetPIDAfterAbortedProcessLaunch)
 {
     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
-    WKContextSetUsesNetworkProcess(context.get(), true);
 
     PlatformWebView webView(context.get());
 
index 0b592d0..2f3327a 100644 (file)
@@ -401,7 +401,6 @@ WKRetainPtr<WKPageConfigurationRef> TestController::generatePageConfiguration(WK
     m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
 
 #if PLATFORM(EFL)
-    WKContextSetUsesNetworkProcess(m_context.get(), false);
     WKContextSetProcessModel(m_context.get(), kWKProcessModelSharedSecondaryProcess);
 #endif