Rename WebContext to WebProcessPool
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Dec 2014 20:29:26 +0000 (20:29 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Dec 2014 20:29:26 +0000 (20:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139909

Rubber-stamped by Anders Carlsson.

Source/WebCore:

Merge SessionID and SessionIDHash into one file to make auto-generation of
HashMaps with SessionIDs easier.

* WebCore.xcodeproj/project.pbxproj:
* loader/cache/MemoryCache.h:
* page/SessionID.h:
(WTF::SessionIDHash::hash):
(WTF::SessionIDHash::equal):
(WTF::HashTraits<WebCore::SessionID>::emptyValue):
(WTF::HashTraits<WebCore::SessionID>::constructDeletedValue):
(WTF::HashTraits<WebCore::SessionID>::isDeletedValue):
* page/SessionIDHash.h: Removed.

Source/WebKit2:

- Major renames:
    WebContext -> WebProcessPool
    WebContextConfiguration -> WebProcessPoolConfiguration
    API::ContextConfiguration -> API::ProcessPoolConfiguration

* File list elided *

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

114 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/page/SessionID.h
Source/WebCore/page/SessionIDHash.h [deleted file]
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/Shared/API/APIObject.h
Source/WebKit2/Shared/API/APIURLRequest.cpp
Source/WebKit2/Shared/Cocoa/APIObject.mm
Source/WebKit2/Shared/SessionTracker.h
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/Shared/mac/ObjCObjectGraphCoders.mm
Source/WebKit2/UIProcess/API/APIDownloadClient.h
Source/WebKit2/UIProcess/API/APILegacyContextHistoryClient.h
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.cpp
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm
Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessGroup.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolInternal.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/APIProcessPoolConfiguration.cpp [moved from Source/WebKit2/UIProcess/APIContextConfiguration.cpp with 81% similarity]
Source/WebKit2/UIProcess/APIProcessPoolConfiguration.h [moved from Source/WebKit2/UIProcess/APIContextConfiguration.h with 87% similarity]
Source/WebKit2/UIProcess/Cocoa/DownloadClient.h
Source/WebKit2/UIProcess/Cocoa/DownloadClient.mm
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm [moved from Source/WebKit2/UIProcess/mac/WebContextMac.mm with 84% similarity]
Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp
Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h
Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
Source/WebKit2/UIProcess/Downloads/DownloadProxy.h
Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp
Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h
Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h
Source/WebKit2/UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp
Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.h
Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
Source/WebKit2/UIProcess/VisitedLinkProvider.cpp
Source/WebKit2/UIProcess/VisitedLinkProvider.h
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
Source/WebKit2/UIProcess/WebContextClient.cpp
Source/WebKit2/UIProcess/WebContextClient.h
Source/WebKit2/UIProcess/WebContextConnectionClient.cpp
Source/WebKit2/UIProcess/WebContextConnectionClient.h
Source/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h
Source/WebKit2/UIProcess/WebContextSupplement.h
Source/WebKit2/UIProcess/WebContextUserMessageCoders.h
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
Source/WebKit2/UIProcess/WebFrameProxy.cpp
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
Source/WebKit2/UIProcess/WebIconDatabase.cpp
Source/WebKit2/UIProcess/WebIconDatabase.h
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebInspectorProxy.h
Source/WebKit2/UIProcess/WebKeyValueStorageManager.cpp
Source/WebKit2/UIProcess/WebKeyValueStorageManager.h
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp
Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPreferences.cpp
Source/WebKit2/UIProcess/WebProcessPool.cpp [moved from Source/WebKit2/UIProcess/WebContext.cpp with 81% similarity]
Source/WebKit2/UIProcess/WebProcessPool.h [moved from Source/WebKit2/UIProcess/WebContext.h with 94% similarity]
Source/WebKit2/UIProcess/WebProcessPool.messages.in [moved from Source/WebKit2/UIProcess/WebContext.messages.in with 98% similarity]
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/WKContentView.h
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WKGeolocationProviderIOS.h
Source/WebKit2/UIProcess/ios/WKGeolocationProviderIOS.mm
Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm
Source/WebKit2/UIProcess/mac/ServicesController.h
Source/WebKit2/UIProcess/mac/ServicesController.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
Source/WebKit2/UIProcess/mac/WKFullKeyboardAccessWatcher.mm
Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
Source/WebKit2/UIProcess/mac/WindowServerConnection.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h

index b4d34fd..00e8ddb 100644 (file)
@@ -1,3 +1,23 @@
+2014-12-23  Sam Weinig  <sam@webkit.org>
+
+        Rename WebContext to WebProcessPool
+        https://bugs.webkit.org/show_bug.cgi?id=139909
+
+        Rubber-stamped by Anders Carlsson.
+
+        Merge SessionID and SessionIDHash into one file to make auto-generation of
+        HashMaps with SessionIDs easier.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/cache/MemoryCache.h:
+        * page/SessionID.h:
+        (WTF::SessionIDHash::hash):
+        (WTF::SessionIDHash::equal):
+        (WTF::HashTraits<WebCore::SessionID>::emptyValue):
+        (WTF::HashTraits<WebCore::SessionID>::constructDeletedValue):
+        (WTF::HashTraits<WebCore::SessionID>::isDeletedValue):
+        * page/SessionIDHash.h: Removed.
+
 2014-12-23  Myles C. Maxfield  <mmaxfield@apple.com>
 
         platform/mac/editing/input/devanagari-ligature.html is flaky on Yosemite, ligature fails to form
index 3a0b526..71ad6dd 100644 (file)
                75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
                75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
                759CB837192DA9190012BC64 /* ControlStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 311C08BC18E35D6800B65615 /* ControlStates.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               75DCC7B818B81C8800A57128 /* SessionIDHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 75DCC7B718B81C8800A57128 /* SessionIDHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
                760847CE19A6A27800428CCC /* AutocompleteErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 760847CD19A6A27700428CCC /* AutocompleteErrorEvent.h */; };
                7633A72613D8B33A008501B6 /* LocaleToScriptMapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 7633A72413D8B33A008501B6 /* LocaleToScriptMapping.h */; };
                7633A72713D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7633A72513D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp */; };
                75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = "<group>"; };
                75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; };
                75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
-               75DCC7B718B81C8800A57128 /* SessionIDHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionIDHash.h; sourceTree = "<group>"; };
                760847CD19A6A27700428CCC /* AutocompleteErrorEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutocompleteErrorEvent.h; sourceTree = "<group>"; };
                760847CF19A6A28600428CCC /* AutocompleteErrorEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AutocompleteErrorEvent.idl; sourceTree = "<group>"; };
                7633A72413D8B33A008501B6 /* LocaleToScriptMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocaleToScriptMapping.h; sourceTree = "<group>"; };
                                974D2DA2146A535D00D51F8B /* SecurityPolicy.cpp */,
                                974D2DA3146A535D00D51F8B /* SecurityPolicy.h */,
                                756B2CE018B7101600FECFAA /* SessionID.h */,
-                               75DCC7B718B81C8800A57128 /* SessionIDHash.h */,
                                14C9A5E90B3D105F005A0232 /* Settings.cpp */,
                                F587863A02DE3A1401EA4122 /* Settings.h */,
                                BC59DEF8169DEDC30016AC34 /* Settings.in */,
                                A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */,
                                2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
                                756B2CE118B7101600FECFAA /* SessionID.h in Headers */,
-                               75DCC7B818B81C8800A57128 /* SessionIDHash.h in Headers */,
                                93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */,
                                B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
                                93F1994F08245E59001E9ABC /* Settings.h in Headers */,
index a20cc3c..68e8ded 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "NativeImagePtr.h"
 #include "SecurityOriginHash.h"
-#include "SessionIDHash.h"
+#include "SessionID.h"
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
index 5efd74a..976f4de 100644 (file)
@@ -26,6 +26,9 @@
 #ifndef SessionID_h
 #define SessionID_h
 
+#include <wtf/HashFunctions.h>
+#include <wtf/HashTraits.h>
+
 namespace WebCore {
 
 class SessionID {
@@ -47,6 +50,28 @@ private:
     uint64_t m_sessionID;
 };
 
-} // namespace WebCore
+}
+
+namespace WTF {
+
+// The empty value is emptySessionID(), the deleted value is (-1)
+struct SessionIDHash {
+    static unsigned hash(const WebCore::SessionID& p) { return (unsigned)p.sessionID(); }
+    static bool equal(const WebCore::SessionID& a, const WebCore::SessionID& b) { return a == b; }
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+template<> struct HashTraits<WebCore::SessionID> : GenericHashTraits<WebCore::SessionID> {
+    static const uint64_t deletedValueIdentifier = 0xffffffffffffffff;
+    static const bool needsDestruction = false;
+    static WebCore::SessionID emptyValue() { return WebCore::SessionID::emptySessionID(); }
+
+    static void constructDeletedValue(WebCore::SessionID& slot) { slot = WebCore::SessionID(deletedValueIdentifier); }
+    static bool isDeletedValue(const WebCore::SessionID& slot) { return slot == WebCore::SessionID(deletedValueIdentifier); }
+};
+template<> struct DefaultHash<WebCore::SessionID> {
+    typedef SessionIDHash Hash;
+};
+
+}
 
 #endif // SessionID_h
diff --git a/Source/WebCore/page/SessionIDHash.h b/Source/WebCore/page/SessionIDHash.h
deleted file mode 100644 (file)
index 9233474..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. 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 SessionIDHash_h
-#define SessionIDHash_h
-
-#include "SessionID.h"
-#include <wtf/HashFunctions.h>
-#include <wtf/HashTraits.h>
-
-namespace WTF {
-
-// The empty value is emptySessionID(), the deleted value is (-1)
-struct SessionIDHash {
-    static unsigned hash(const WebCore::SessionID& p) { return (unsigned)p.sessionID(); }
-    static bool equal(const WebCore::SessionID& a, const WebCore::SessionID& b) { return a == b; }
-    static const bool safeToCompareToEmptyOrDeleted = true;
-};
-template<> struct HashTraits<WebCore::SessionID> : GenericHashTraits<WebCore::SessionID> {
-    static const uint64_t deletedValueIdentifier = 0xffffffffffffffff;
-    static const bool needsDestruction = false;
-    static WebCore::SessionID emptyValue() { return WebCore::SessionID::emptySessionID(); }
-
-    static void constructDeletedValue(WebCore::SessionID& slot) { slot = WebCore::SessionID(deletedValueIdentifier); }
-    static bool isDeletedValue(const WebCore::SessionID& slot) { return slot == WebCore::SessionID(deletedValueIdentifier); }
-};
-template<> struct DefaultHash<WebCore::SessionID> {
-    typedef SessionIDHash Hash;
-};
-
-}
-
-#endif // SessionIDHash_h
index ff1bac3..7e363fb 100644 (file)
@@ -1,3 +1,17 @@
+2014-12-23  Sam Weinig  <sam@webkit.org>
+
+        Rename WebContext to WebProcessPool
+        https://bugs.webkit.org/show_bug.cgi?id=139909
+
+        Rubber-stamped by Anders Carlsson.
+
+        - Major renames:
+            WebContext -> WebProcessPool
+            WebContextConfiguration -> WebProcessPoolConfiguration
+            API::ContextConfiguration -> API::ProcessPoolConfiguration
+
+        * File list elided *
+
 2014-12-23  Anders Carlsson  <andersca@apple.com>
 
         Only call shouldTransformGraph once per graph
index ca06a06..77b56c8 100644 (file)
@@ -107,7 +107,6 @@ MESSAGE_RECEIVERS = \
     WebApplicationCacheManager \
     WebApplicationCacheManagerProxy \
     WebConnection \
-    WebContext \
     WebCookieManager \
     WebCookieManagerProxy \
     WebDatabaseManager \
@@ -132,6 +131,7 @@ MESSAGE_RECEIVERS = \
     WebPageProxy \
     WebProcess \
     WebProcessConnection \
+    WebProcessPool \
     WebProcessProxy \
     WebResourceCacheManager \
     WebResourceCacheManagerProxy \
index f701f68..d31aad2 100644 (file)
@@ -41,8 +41,8 @@
 #include "RemoteNetworkingContext.h"
 #include "SessionTracker.h"
 #include "StatisticsData.h"
-#include "WebContextMessages.h"
 #include "WebCookieManager.h"
+#include "WebProcessPoolMessages.h"
 #include "WebsiteDataTypes.h"
 #include <WebCore/Logging.h>
 #include <WebCore/MemoryPressureHandler.h>
@@ -297,7 +297,7 @@ void NetworkProcess::getNetworkProcessStatistics(uint64_t callbackID)
     data.statisticsNumbers.set("DownloadsActiveCount", shared().downloadManager().activeDownloadCount());
     data.statisticsNumbers.set("OutstandingAuthenticationChallengesCount", shared().authenticationManager().outstandingAuthenticationChallengeCount());
 
-    parentProcessConnection()->send(Messages::WebContext::DidGetStatistics(data, callbackID), 0);
+    parentProcessConnection()->send(Messages::WebProcessPool::DidGetStatistics(data, callbackID), 0);
 }
 
 void NetworkProcess::terminate()
index 209468b..f96f658 100644 (file)
@@ -102,8 +102,6 @@ public:
         BatteryStatus,
         CacheManager,
         ColorPickerResultListener,
-        Context,
-        ContextConfiguration,
         CookieManager,
         DatabaseManager,
         Download,
@@ -129,6 +127,8 @@ public:
         OriginDataManager,
         Page,
         PageGroup,
+        ProcessPool,
+        ProcessPoolConfiguration,
         PluginSiteDataManager,
         Preferences,
         Session,
index b9165ea..23d535a 100644 (file)
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "APIURLRequest.h"
 
-#include "WebContext.h"
 #include "WebCoreArgumentCoders.h"
+#include "WebProcessPool.h"
 
 using namespace WebCore;
 using namespace WebKit;
@@ -44,14 +44,13 @@ double URLRequest::defaultTimeoutInterval()
     return ResourceRequest::defaultTimeoutInterval();
 }
 
-// FIXME: This function should really be on WebContext.
+// FIXME: This function should really be on WebProcessPool or WebPageProxy.
 void URLRequest::setDefaultTimeoutInterval(double timeoutInterval)
 {
     ResourceRequest::setDefaultTimeoutInterval(timeoutInterval);
 
-    const Vector<WebContext*>& contexts = WebContext::allContexts();
-    for (size_t i = 0; i < contexts.size(); ++i)
-        contexts[i]->setDefaultRequestTimeoutInterval(timeoutInterval);
+    for (auto* processPool : WebProcessPool::allProcessPools())
+        processPool->setDefaultRequestTimeoutInterval(timeoutInterval);
 }
 
 void URLRequest::encode(IPC::ArgumentEncoder& encoder) const
index 065cafd..1f8b6a4 100644 (file)
@@ -104,7 +104,7 @@ void* Object::newObject(size_t size, Type type)
         wrapper = NSAllocateObject([WKConnection self], size, nullptr);
         break;
 
-    case Type::Context:
+    case Type::ProcessPool:
         wrapper = [WKProcessPool alloc];
         break;
 
index 0b03029..9e80b2f 100644 (file)
@@ -27,7 +27,7 @@
 #define SessionTracker_h
 
 #include <WebCore/NetworkStorageSession.h>
-#include <WebCore/SessionIDHash.h>
+#include <WebCore/SessionID.h>
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/CString.h>
index ee1acb6..f4a94bb 100644 (file)
@@ -29,7 +29,7 @@
 #include "CacheModel.h"
 #include "SandboxExtension.h"
 #include "TextCheckerState.h"
-#include <WebCore/SessionIDHash.h>
+#include <WebCore/SessionID.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/StringHash.h>
index ec319c2..a856e69 100644 (file)
@@ -261,7 +261,7 @@ protected:
 };
 
 
-// WebContext Additions
+// ProcessPool Additions
 
 class WebContextObjCObjectGraphEncoderImpl : public ObjCObjectGraphEncoder<WebContextObjCObjectGraphEncoderImpl> {
 public:
index 7ba3825..2175fee 100644 (file)
@@ -36,7 +36,7 @@ class ResourceResponse;
 namespace WebKit {
 class AuthenticationChallengeProxy;
 class DownloadProxy;
-class WebContext;
+class WebProcessPool;
 }
 
 namespace API {
@@ -45,17 +45,17 @@ class DownloadClient {
 public:
     virtual ~DownloadClient() { }
 
-    virtual void didStart(WebKit::WebContext*, WebKit::DownloadProxy*) { }
-    virtual void didReceiveAuthenticationChallenge(WebKit::WebContext*, WebKit::DownloadProxy*, WebKit::AuthenticationChallengeProxy*) { }
-    virtual void didReceiveResponse(WebKit::WebContext*, WebKit::DownloadProxy*, const WebCore::ResourceResponse&) { }
-    virtual void didReceiveData(WebKit::WebContext*, WebKit::DownloadProxy*, uint64_t) { }
-    virtual bool shouldDecodeSourceDataOfMIMEType(WebKit::WebContext*, WebKit::DownloadProxy*, const WTF::String&) { return true; }
-    virtual WTF::String decideDestinationWithSuggestedFilename(WebKit::WebContext*, WebKit::DownloadProxy*, const WTF::String&, bool&) { return { }; }
-    virtual void didCreateDestination(WebKit::WebContext*, WebKit::DownloadProxy*, const WTF::String&) { }
-    virtual void didFinish(WebKit::WebContext*, WebKit::DownloadProxy*) { }
-    virtual void didFail(WebKit::WebContext*, WebKit::DownloadProxy*, const WebCore::ResourceError&) { }
-    virtual void didCancel(WebKit::WebContext*, WebKit::DownloadProxy*) { }
-    virtual void processDidCrash(WebKit::WebContext*, WebKit::DownloadProxy*) { }
+    virtual void didStart(WebKit::WebProcessPool*, WebKit::DownloadProxy*) { }
+    virtual void didReceiveAuthenticationChallenge(WebKit::WebProcessPool*, WebKit::DownloadProxy*, WebKit::AuthenticationChallengeProxy*) { }
+    virtual void didReceiveResponse(WebKit::WebProcessPool*, WebKit::DownloadProxy*, const WebCore::ResourceResponse&) { }
+    virtual void didReceiveData(WebKit::WebProcessPool*, WebKit::DownloadProxy*, uint64_t) { }
+    virtual bool shouldDecodeSourceDataOfMIMEType(WebKit::WebProcessPool*, WebKit::DownloadProxy*, const WTF::String&) { return true; }
+    virtual WTF::String decideDestinationWithSuggestedFilename(WebKit::WebProcessPool*, WebKit::DownloadProxy*, const WTF::String&, bool&) { return { }; }
+    virtual void didCreateDestination(WebKit::WebProcessPool*, WebKit::DownloadProxy*, const WTF::String&) { }
+    virtual void didFinish(WebKit::WebProcessPool*, WebKit::DownloadProxy*) { }
+    virtual void didFail(WebKit::WebProcessPool*, WebKit::DownloadProxy*, const WebCore::ResourceError&) { }
+    virtual void didCancel(WebKit::WebProcessPool*, WebKit::DownloadProxy*) { }
+    virtual void processDidCrash(WebKit::WebProcessPool*, WebKit::DownloadProxy*) { }
 };
 
 } // namespace API
index 7a229a9..cbb9e0a 100644 (file)
@@ -29,9 +29,9 @@
 #include <wtf/Forward.h>
 
 namespace WebKit {
-class WebContext;
 class WebFrameProxy;
 class WebPageProxy;
+class WebProcessPool;
 struct WebNavigationDataStore;
 }
 
@@ -41,11 +41,11 @@ class LegacyContextHistoryClient {
 public:
     virtual ~LegacyContextHistoryClient() { }
 
-    virtual void didNavigateWithNavigationData(WebKit::WebContext&, WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&, WebKit::WebFrameProxy&) { }
-    virtual void didPerformClientRedirect(WebKit::WebContext&, WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
-    virtual void didPerformServerRedirect(WebKit::WebContext&, WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
-    virtual void didUpdateHistoryTitle(WebKit::WebContext&, WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
-    virtual void populateVisitedLinks(WebKit::WebContext&) { }
+    virtual void didNavigateWithNavigationData(WebKit::WebProcessPool&, WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&, WebKit::WebFrameProxy&) { }
+    virtual void didPerformClientRedirect(WebKit::WebProcessPool&, WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
+    virtual void didPerformServerRedirect(WebKit::WebProcessPool&, WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
+    virtual void didUpdateHistoryTitle(WebKit::WebProcessPool&, WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
+    virtual void populateVisitedLinks(WebKit::WebProcessPool&) { }
     virtual bool addsVisitedLinks() const { return false; }
 };
 
index 5f44a69..25b0a62 100644 (file)
@@ -51,8 +51,8 @@
 #include <WebCore/Settings.h>
 
 namespace API {
-class ContextConfiguration;
 class NavigationData;
+class ProcessPoolConfiguration;
 class SessionState;
 }
 
@@ -71,7 +71,6 @@ class WebBatteryManagerProxy;
 class WebBatteryStatus;
 class WebResourceCacheManagerProxy;
 class WebColorPickerResultListenerProxy;
-class WebContext;
 class WebCookieManagerProxy;
 class WebCredential;
 class WebDatabaseManagerProxy;
@@ -96,6 +95,7 @@ class WebPageGroup;
 class WebPageProxy;
 class WebPluginSiteDataManager;
 class WebPreferences;
+class WebProcessPool;
 class WebProtectionSpace;
 class WebRenderLayer;
 class WebRenderObject;
@@ -113,8 +113,8 @@ WK_ADD_API_MAPPING(WKBatteryStatusRef, WebBatteryStatus)
 WK_ADD_API_MAPPING(WKBundleHitTestResultMediaType, BundleHitTestResultMediaType)
 WK_ADD_API_MAPPING(WKResourceCacheManagerRef, WebResourceCacheManagerProxy)
 WK_ADD_API_MAPPING(WKColorPickerResultListenerRef, WebColorPickerResultListenerProxy)
-WK_ADD_API_MAPPING(WKContextRef, WebContext)
-WK_ADD_API_MAPPING(WKContextConfigurationRef, API::ContextConfiguration)
+WK_ADD_API_MAPPING(WKContextRef, WebProcessPool)
+WK_ADD_API_MAPPING(WKContextConfigurationRef, API::ProcessPoolConfiguration)
 WK_ADD_API_MAPPING(WKCookieManagerRef, WebCookieManagerProxy)
 WK_ADD_API_MAPPING(WKCredentialRef, WebCredential)
 WK_ADD_API_MAPPING(WKDatabaseManagerRef, WebDatabaseManagerProxy)
index 943bfd8..9a05e00 100644 (file)
 #include "WKContextPrivate.h"
 
 #include "APIClient.h"
-#include "APIContextConfiguration.h"
 #include "APIDownloadClient.h"
 #include "APILegacyContextHistoryClient.h"
 #include "APINavigationData.h"
+#include "APIProcessPoolConfiguration.h"
 #include "APIURLRequest.h"
 #include "AuthenticationChallengeProxy.h"
 #include "DownloadProxy.h"
@@ -38,9 +38,9 @@
 #include "WKContextConfigurationRef.h"
 #include "WKRetainPtr.h"
 #include "WebCertificateInfo.h"
-#include "WebContext.h"
 #include "WebIconDatabase.h"
 #include "WebPluginSiteDataManager.h"
+#include "WebProcessPool.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
@@ -75,7 +75,7 @@ using namespace WebKit;
 
 WKTypeID WKContextGetTypeID()
 {
-    return toAPI(WebContext::APIType);
+    return toAPI(WebProcessPool::APIType);
 }
 
 WKContextRef WKContextCreate()
@@ -93,7 +93,7 @@ WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef pathRef)
 
 WKContextRef WKContextCreateWithConfiguration(WKContextConfigurationRef configuration)
 {
-    return toAPI(WebContext::create(toImpl(configuration)->webContextConfiguration()).leakRef());
+    return toAPI(WebProcessPool::create(toImpl(configuration)->webProcessPoolConfiguration()).leakRef());
 }
 
 void WKContextSetClient(WKContextRef contextRef, const WKContextClientBase* wkClient)
@@ -116,45 +116,45 @@ void WKContextSetHistoryClient(WKContextRef contextRef, const WKContextHistoryCl
         }
 
     private:
-        virtual void didNavigateWithNavigationData(WebContext& context, WebPageProxy& page, const WebNavigationDataStore& navigationDataStore, WebFrameProxy& frame) override
+        virtual void didNavigateWithNavigationData(WebProcessPool& processPool, WebPageProxy& page, const WebNavigationDataStore& navigationDataStore, WebFrameProxy& frame) override
         {
             if (!m_client.didNavigateWithNavigationData)
                 return;
 
             RefPtr<API::NavigationData> navigationData = API::NavigationData::create(navigationDataStore);
-            m_client.didNavigateWithNavigationData(toAPI(&context), toAPI(&page), toAPI(navigationData.get()), toAPI(&frame), m_client.base.clientInfo);
+            m_client.didNavigateWithNavigationData(toAPI(&processPool), toAPI(&page), toAPI(navigationData.get()), toAPI(&frame), m_client.base.clientInfo);
         }
 
-        virtual void didPerformClientRedirect(WebContext& context, WebPageProxy& page, const String& sourceURL, const String& destinationURL, WebFrameProxy& frame) override
+        virtual void didPerformClientRedirect(WebProcessPool& processPool, WebPageProxy& page, const String& sourceURL, const String& destinationURL, WebFrameProxy& frame) override
         {
             if (!m_client.didPerformClientRedirect)
                 return;
 
-            m_client.didPerformClientRedirect(toAPI(&context), toAPI(&page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(&frame), m_client.base.clientInfo);
+            m_client.didPerformClientRedirect(toAPI(&processPool), toAPI(&page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(&frame), m_client.base.clientInfo);
         }
 
-        virtual void didPerformServerRedirect(WebContext& context, WebPageProxy& page, const String& sourceURL, const String& destinationURL, WebFrameProxy& frame) override
+        virtual void didPerformServerRedirect(WebProcessPool& processPool, WebPageProxy& page, const String& sourceURL, const String& destinationURL, WebFrameProxy& frame) override
         {
             if (!m_client.didPerformServerRedirect)
                 return;
 
-            m_client.didPerformServerRedirect(toAPI(&context), toAPI(&page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(&frame), m_client.base.clientInfo);
+            m_client.didPerformServerRedirect(toAPI(&processPool), toAPI(&page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(&frame), m_client.base.clientInfo);
         }
 
-        virtual void didUpdateHistoryTitle(WebContext& context, WebPageProxy& page, const String& title, const String& url, WebFrameProxy& frame) override
+        virtual void didUpdateHistoryTitle(WebProcessPool& processPool, WebPageProxy& page, const String& title, const String& url, WebFrameProxy& frame) override
         {
             if (!m_client.didUpdateHistoryTitle)
                 return;
 
-            m_client.didUpdateHistoryTitle(toAPI(&context), toAPI(&page), toAPI(title.impl()), toURLRef(url.impl()), toAPI(&frame), m_client.base.clientInfo);
+            m_client.didUpdateHistoryTitle(toAPI(&processPool), toAPI(&page), toAPI(title.impl()), toURLRef(url.impl()), toAPI(&frame), m_client.base.clientInfo);
         }
 
-        virtual void populateVisitedLinks(WebContext& context) override
+        virtual void populateVisitedLinks(WebProcessPool& processPool) override
         {
             if (!m_client.populateVisitedLinks)
                 return;
 
-            m_client.populateVisitedLinks(toAPI(&context), m_client.base.clientInfo);
+            m_client.populateVisitedLinks(toAPI(&processPool), m_client.base.clientInfo);
         }
 
         virtual bool addsVisitedLinks() const override
@@ -163,12 +163,12 @@ void WKContextSetHistoryClient(WKContextRef contextRef, const WKContextHistoryCl
         }
     };
 
-    WebKit::WebContext& context = *toImpl(contextRef);
-    context.setHistoryClient(std::make_unique<HistoryClient>(wkClient));
+    WebProcessPool& processPool = *toImpl(contextRef);
+    processPool.setHistoryClient(std::make_unique<HistoryClient>(wkClient));
 
-    bool addsVisitedLinks = context.historyClient().addsVisitedLinks();
+    bool addsVisitedLinks = processPool.historyClient().addsVisitedLinks();
 
-    for (auto& process : context.processes()) {
+    for (auto& process : processPool.processes()) {
         for (auto& page : process->pages())
             page->setAddsVisitedLinks(addsVisitedLinks);
     }
@@ -183,93 +183,93 @@ void WKContextSetDownloadClient(WKContextRef contextRef, const WKContextDownload
             initialize(client);
         }
     private:
-        virtual void didStart(WebContext* webContext, DownloadProxy* downloadProxy) override
+        virtual void didStart(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
         {
             if (!m_client.didStart)
                 return;
 
-            m_client.didStart(toAPI(webContext), toAPI(downloadProxy), m_client.base.clientInfo);
+            m_client.didStart(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
         }
 
-        virtual void didReceiveAuthenticationChallenge(WebContext* webContext, DownloadProxy* downloadProxy, AuthenticationChallengeProxy* authenticationChallengeProxy) override
+        virtual void didReceiveAuthenticationChallenge(WebProcessPool* processPool, DownloadProxy* downloadProxy, AuthenticationChallengeProxy* authenticationChallengeProxy) override
         {
             if (!m_client.didReceiveAuthenticationChallenge)
                 return;
 
-            m_client.didReceiveAuthenticationChallenge(toAPI(webContext), toAPI(downloadProxy), toAPI(authenticationChallengeProxy), m_client.base.clientInfo);
+            m_client.didReceiveAuthenticationChallenge(toAPI(processPool), toAPI(downloadProxy), toAPI(authenticationChallengeProxy), m_client.base.clientInfo);
         }
 
-        virtual void didReceiveResponse(WebContext* webContext, DownloadProxy* downloadProxy, const ResourceResponse& response) override
+        virtual void didReceiveResponse(WebProcessPool* processPool, DownloadProxy* downloadProxy, const ResourceResponse& response) override
         {
             if (!m_client.didReceiveResponse)
                 return;
 
-            m_client.didReceiveResponse(toAPI(webContext), toAPI(downloadProxy), toAPI(API::URLResponse::create(response).get()), m_client.base.clientInfo);
+            m_client.didReceiveResponse(toAPI(processPool), toAPI(downloadProxy), toAPI(API::URLResponse::create(response).get()), m_client.base.clientInfo);
         }
 
-        virtual void didReceiveData(WebContext* webContext, DownloadProxy* downloadProxy, uint64_t length) override
+        virtual void didReceiveData(WebProcessPool* processPool, DownloadProxy* downloadProxy, uint64_t length) override
         {
             if (!m_client.didReceiveData)
                 return;
 
-            m_client.didReceiveData(toAPI(webContext), toAPI(downloadProxy), length, m_client.base.clientInfo);
+            m_client.didReceiveData(toAPI(processPool), toAPI(downloadProxy), length, m_client.base.clientInfo);
         }
 
-        virtual bool shouldDecodeSourceDataOfMIMEType(WebContext* webContext, DownloadProxy* downloadProxy, const String& mimeType) override
+        virtual bool shouldDecodeSourceDataOfMIMEType(WebProcessPool* processPool, DownloadProxy* downloadProxy, const String& mimeType) override
         {
             if (!m_client.shouldDecodeSourceDataOfMIMEType)
                 return true;
 
-            return m_client.shouldDecodeSourceDataOfMIMEType(toAPI(webContext), toAPI(downloadProxy), toAPI(mimeType.impl()), m_client.base.clientInfo);
+            return m_client.shouldDecodeSourceDataOfMIMEType(toAPI(processPool), toAPI(downloadProxy), toAPI(mimeType.impl()), m_client.base.clientInfo);
         }
 
-        virtual String decideDestinationWithSuggestedFilename(WebContext* webContext, DownloadProxy* downloadProxy, const String& filename, bool& allowOverwrite) override
+        virtual String decideDestinationWithSuggestedFilename(WebProcessPool* processPool, DownloadProxy* downloadProxy, const String& filename, bool& allowOverwrite) override
         {
             if (!m_client.decideDestinationWithSuggestedFilename)
                 return String();
 
-            WKRetainPtr<WKStringRef> destination(AdoptWK, m_client.decideDestinationWithSuggestedFilename(toAPI(webContext), toAPI(downloadProxy), toAPI(filename.impl()), &allowOverwrite, m_client.base.clientInfo));
+            WKRetainPtr<WKStringRef> destination(AdoptWK, m_client.decideDestinationWithSuggestedFilename(toAPI(processPool), toAPI(downloadProxy), toAPI(filename.impl()), &allowOverwrite, m_client.base.clientInfo));
             return toWTFString(destination.get());
         }
 
-        virtual void didCreateDestination(WebContext* webContext, DownloadProxy* downloadProxy, const String& path) override
+        virtual void didCreateDestination(WebProcessPool* processPool, DownloadProxy* downloadProxy, const String& path) override
         {
             if (!m_client.didCreateDestination)
                 return;
 
-            m_client.didCreateDestination(toAPI(webContext), toAPI(downloadProxy), toAPI(path.impl()), m_client.base.clientInfo);
+            m_client.didCreateDestination(toAPI(processPool), toAPI(downloadProxy), toAPI(path.impl()), m_client.base.clientInfo);
         }
 
-        virtual void didFinish(WebContext* webContext, DownloadProxy* downloadProxy) override
+        virtual void didFinish(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
         {
             if (!m_client.didFinish)
                 return;
 
-            m_client.didFinish(toAPI(webContext), toAPI(downloadProxy), m_client.base.clientInfo);
+            m_client.didFinish(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
         }
 
-        virtual void didFail(WebContext* webContext, DownloadProxy* downloadProxy, const ResourceError& error) override
+        virtual void didFail(WebProcessPool* processPool, DownloadProxy* downloadProxy, const ResourceError& error) override
         {
             if (!m_client.didFail)
                 return;
 
-            m_client.didFail(toAPI(webContext), toAPI(downloadProxy), toAPI(error), m_client.base.clientInfo);
+            m_client.didFail(toAPI(processPool), toAPI(downloadProxy), toAPI(error), m_client.base.clientInfo);
         }
         
-        virtual void didCancel(WebContext* webContext, DownloadProxy* downloadProxy) override
+        virtual void didCancel(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
         {
             if (!m_client.didCancel)
                 return;
             
-            m_client.didCancel(toAPI(webContext), toAPI(downloadProxy), m_client.base.clientInfo);
+            m_client.didCancel(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
         }
         
-        virtual void processDidCrash(WebContext* webContext, DownloadProxy* downloadProxy) override
+        virtual void processDidCrash(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
         {
             if (!m_client.processDidCrash)
                 return;
             
-            m_client.processDidCrash(toAPI(webContext), toAPI(downloadProxy), m_client.base.clientInfo);
+            m_client.processDidCrash(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
         }
 
     };
@@ -304,7 +304,7 @@ void WKContextPostMessageToInjectedBundle(WKContextRef contextRef, WKStringRef m
 
 void WKContextGetGlobalStatistics(WKContextStatistics* statistics)
 {
-    const WebContext::Statistics& webContextStatistics = WebContext::statistics();
+    const WebProcessPool::Statistics& webContextStatistics = WebProcessPool::statistics();
 
     statistics->wkViewCount = webContextStatistics.wkViewCount;
     statistics->wkPageCount = webContextStatistics.wkPageCount;
@@ -588,7 +588,7 @@ void WKContextSetPlugInAutoStartOrigins(WKContextRef contextRef, WKArrayRef arra
 
 void WKContextSetInvalidMessageFunction(WKContextInvalidMessageFunction invalidMessageFunction)
 {
-    WebContext::setInvalidMessageCallback(invalidMessageFunction);
+    WebProcessPool::setInvalidMessageCallback(invalidMessageFunction);
 }
 
 void WKContextSetMemoryCacheDisabled(WKContextRef contextRef, bool disabled)
index 28c28f1..71fccdf 100644 (file)
 #include "config.h"
 #include "WKContextConfigurationRef.h"
 
-#include "APIContextConfiguration.h"
+#include "APIProcessPoolConfiguration.h"
 #include "WKAPICast.h"
 
 using namespace WebKit;
 
 WKContextConfigurationRef WKContextConfigurationCreate()
 {
-    return toAPI(API::ContextConfiguration::create().leakRef());
+    return toAPI(API::ProcessPoolConfiguration::create().leakRef());
 }
 
 WKStringRef WKContextConfigurationCopyIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration)
index 38f0ac7..7e4dfbe 100644 (file)
@@ -46,7 +46,6 @@
 #include "WKPagePolicyClientInternal.h"
 #include "WKPluginInformation.h"
 #include "WebBackForwardList.h"
-#include "WebContext.h"
 #include "WebFormClient.h"
 #include "WebInspectorProxy.h"
 #include "WebOpenPanelParameters.h"
@@ -54,6 +53,7 @@
 #include "WebPageGroup.h"
 #include "WebPageMessages.h"
 #include "WebPageProxy.h"
+#include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 #include "WebProtectionSpace.h"
 #include <WebCore/Page.h>
@@ -92,7 +92,7 @@ WKTypeID WKPageGetTypeID()
 
 WKContextRef WKPageGetContext(WKPageRef pageRef)
 {
-    return toAPI(&toImpl(pageRef)->process().context());
+    return toAPI(&toImpl(pageRef)->process().processPool());
 }
 
 WKPageGroupRef WKPageGetPageGroup(WKPageRef pageRef)
@@ -1019,7 +1019,7 @@ void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClientBase*
 
         virtual PassRefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override
         {
-            return page.process().context().client().copyWebCryptoMasterKey(&page.process().context());
+            return page.process().processPool().client().copyWebCryptoMasterKey(&page.process().processPool());
         }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
index afb3f63..bc58778 100644 (file)
@@ -28,7 +28,6 @@
 #include "WKPreferencesRef.h"
 #include "WKPreferencesRefPrivate.h"
 #include "WKAPICast.h"
-#include "WebContext.h"
 #include "WebPreferences.h"
 #include <WebCore/Settings.h>
 #include <wtf/PassRefPtr.h>
index 186797f..48d375c 100644 (file)
@@ -37,7 +37,7 @@
 #import "WKPluginInformation.h"
 #import "WKSharedAPICast.h"
 #import "WKStringCF.h"
-#import "WebContext.h"
+#import "WebProcessPool.h"
 #import <WebKitSystemInterface.h>
 #import <wtf/RetainPtr.h>
 
@@ -97,12 +97,12 @@ void WKContextResetHSTSHosts(WKContextRef context)
 
 void WKContextRegisterSchemeForCustomProtocol(WKContextRef context, WKStringRef scheme)
 {
-    WebContext::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(toWTFString(scheme));
+    WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(toWTFString(scheme));
 }
 
 void WKContextUnregisterSchemeForCustomProtocol(WKContextRef context, WKStringRef scheme)
 {
-    WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(toWTFString(scheme));
+    WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(toWTFString(scheme));
 }
 
 /* DEPRECATED -  Please use constants from WKPluginInformation instead. */
index 6a9dca4..56b24f7 100644 (file)
 #include "WKPagePrivateMac.h"
 
 #include "WKAPICast.h"
-#include "WebContext.h"
 #include "WebPageGroup.h"
 #include "WebPageProxy.h"
 #include "WebPreferences.h"
+#include "WebProcessPool.h"
 
 using namespace WebKit;
 
@@ -44,5 +44,5 @@ bool WKPageIsURLKnownHSTSHost(WKPageRef page, WKURLRef url)
     WebPageProxy* webPageProxy = toImpl(page);
     bool privateBrowsingEnabled = webPageProxy->pageGroup().preferences().privateBrowsingEnabled();
 
-    return webPageProxy->process().context().isURLKnownHSTSHost(toImpl(url)->string(), privateBrowsingEnabled);
+    return webPageProxy->process().processPool().isURLKnownHSTSHost(toImpl(url)->string(), privateBrowsingEnabled);
 }
index 2f16622..9196e06 100644 (file)
@@ -53,8 +53,8 @@
 #import "WKURLResponseNS.h"
 #import "WeakObjCPtr.h"
 #import "WebCertificateInfo.h"
-#import "WebContext.h"
 #import "WebPageProxy.h"
+#import "WebProcessPool.h"
 #import "WebProtectionSpace.h"
 #import "_WKRemoteObjectRegistryInternal.h"
 #import <wtf/NeverDestroyed.h>
@@ -173,12 +173,12 @@ static HashMap<WebPageProxy*, WKBrowsingContextController *>& browsingContextCon
 
 + (void)registerSchemeForCustomProtocol:(NSString *)scheme
 {
-    WebContext::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme);
+    WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme);
 }
 
 + (void)unregisterSchemeForCustomProtocol:(NSString *)scheme
 {
-    WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme);
+    WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(scheme);
 }
 
 - (void)loadRequest:(NSURLRequest *)request
@@ -855,7 +855,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 {
     if (!_remoteObjectRegistry) {
         _remoteObjectRegistry = adoptNS([[_WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page]);
-        _page->process().context().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
+        _page->process().processPool().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
     }
 
     return _remoteObjectRegistry.get();
index ab513e6..34d99a7 100644 (file)
@@ -41,8 +41,8 @@
 #import "WKStringCF.h"
 #import "WeakObjCPtr.h"
 #import "WebCertificateInfo.h"
-#import "WebContext.h"
 #import "WebFrameProxy.h"
+#import "WebProcessPool.h"
 #import <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS)
@@ -54,7 +54,7 @@
 using namespace WebKit;
 
 @implementation WKProcessGroup {
-    RefPtr<WebContext> _context;
+    RefPtr<WebProcessPool> _processPool;
 
     WeakObjCPtr<id <WKProcessGroupDelegate>> _delegate;
 
@@ -189,19 +189,19 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
     InitWebCoreThreadSystemInterface();
 #endif
 
-    WebContextConfiguration webContextConfiguration;
-    webContextConfiguration.injectedBundlePath = bundleURL ? String(bundleURL.path) : String();
+    WebProcessPoolConfiguration configuration;
+    configuration.injectedBundlePath = bundleURL ? String(bundleURL.path) : String();
 
-    WebContext::applyPlatformSpecificConfigurationDefaults(webContextConfiguration);
+    WebProcessPool::applyPlatformSpecificConfigurationDefaults(configuration);
 
-    _context = WebContext::create(WTF::move(webContextConfiguration));
+    _processPool = WebProcessPool::create(WTF::move(configuration));
 
-    setUpConnectionClient(self, toAPI(_context.get()));
-    setUpInectedBundleClient(self, toAPI(_context.get()));
-    setUpHistoryClient(self, toAPI(_context.get()));
+    setUpConnectionClient(self, toAPI(_processPool.get()));
+    setUpInectedBundleClient(self, toAPI(_processPool.get()));
+    setUpHistoryClient(self, toAPI(_processPool.get()));
 #if PLATFORM(IOS)
-    _context->setUsesNetworkProcess(true);
-    _context->setProcessModel(ProcessModelMultipleSecondaryProcesses);
+    _processPool->setUsesNetworkProcess(true);
+    _processPool->setProcessModel(ProcessModelMultipleSecondaryProcesses);
 #endif
 
     return self;
@@ -223,12 +223,12 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
 
 - (WKContextRef)_contextRef
 {
-    return toAPI(_context.get());
+    return toAPI(_processPool.get());
 }
 
 - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host
 {
-    _context->allowSpecificHTTPSCertificateForHost(WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).get(), host);
+    _processPool->allowSpecificHTTPSCertificateForHost(WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).get(), host);
 }
 
 #if PLATFORM(IOS)
index 1ca6932..163f623 100644 (file)
@@ -35,9 +35,9 @@
 #import "WKObject.h"
 #import "WeakObjCPtr.h"
 #import "WebCertificateInfo.h"
-#import "WebContext.h"
 #import "WebCookieManagerProxy.h"
 #import "WebProcessMessages.h"
+#import "WebProcessPool.h"
 #import "_WKDownloadDelegate.h"
 #import "_WKProcessPoolConfiguration.h"
 #import <WebCore/CFNetworkSPI.h>
@@ -64,7 +64,7 @@
 
 - (void)dealloc
 {
-    _context->~WebContext();
+    _processPool->~WebProcessPool();
 
     [super dealloc];
 }
 
 - (API::Object&)_apiObject
 {
-    return *_context;
+    return *_processPool;
 }
 
 #if PLATFORM(IOS)
 - (WKGeolocationProviderIOS *)_geolocationProvider
 {
     if (!_geolocationProvider)
-        _geolocationProvider = adoptNS([[WKGeolocationProviderIOS alloc] initWithContext:_context.get()]);
+        _geolocationProvider = adoptNS([[WKGeolocationProviderIOS alloc] initWithProcessPool:*_processPool]);
     return _geolocationProvider.get();
 }
 #endif // PLATFORM(IOS)
@@ -154,44 +154,44 @@ static NSURL *websiteDataDirectoryURL(NSString *directoryName)
     InitWebCoreThreadSystemInterface();
 #endif
 
-    WebKit::WebContextConfiguration webContextConfiguration;
+    WebKit::WebProcessPoolConfiguration processPoolConfiguration;
 
     if (NSURL *bundleURL = [_configuration injectedBundleURL]) {
         if (!bundleURL.isFileURL)
             [NSException raise:NSInvalidArgumentException format:@"Injected Bundle URL must be a file URL"];
 
-        webContextConfiguration.injectedBundlePath = bundleURL.path;
+        processPoolConfiguration.injectedBundlePath = bundleURL.path;
     }
 
-    webContextConfiguration.localStorageDirectory = websiteDataDirectoryURL(@"LocalStorage").absoluteURL.path.fileSystemRepresentation;
-    webContextConfiguration.webSQLDatabaseDirectory = websiteDataDirectoryURL(@"WebSQL").absoluteURL.path.fileSystemRepresentation;
-    webContextConfiguration.indexedDBDatabaseDirectory = websiteDataDirectoryURL(@"IndexedDB").absoluteURL.path.fileSystemRepresentation;
-    webContextConfiguration.mediaKeysStorageDirectory = websiteDataDirectoryURL(@"MediaKeys").absoluteURL.path.fileSystemRepresentation;
+    processPoolConfiguration.localStorageDirectory = websiteDataDirectoryURL(@"LocalStorage").absoluteURL.path.fileSystemRepresentation;
+    processPoolConfiguration.webSQLDatabaseDirectory = websiteDataDirectoryURL(@"WebSQL").absoluteURL.path.fileSystemRepresentation;
+    processPoolConfiguration.indexedDBDatabaseDirectory = websiteDataDirectoryURL(@"IndexedDB").absoluteURL.path.fileSystemRepresentation;
+    processPoolConfiguration.mediaKeysStorageDirectory = websiteDataDirectoryURL(@"MediaKeys").absoluteURL.path.fileSystemRepresentation;
 
-    API::Object::constructInWrapper<WebKit::WebContext>(self, WTF::move(webContextConfiguration));
-    _context->setUsesNetworkProcess(true);
-    _context->setProcessModel(WebKit::ProcessModelMultipleSecondaryProcesses);
-    _context->setMaximumNumberOfProcesses([_configuration maximumProcessCount]);
+    API::Object::constructInWrapper<WebKit::WebProcessPool>(self, WTF::move(processPoolConfiguration));
+    _processPool->setUsesNetworkProcess(true);
+    _processPool->setProcessModel(WebKit::ProcessModelMultipleSecondaryProcesses);
+    _processPool->setMaximumNumberOfProcesses([_configuration maximumProcessCount]);
 
 #if ENABLE(CACHE_PARTITIONING)
     for (NSString *urlScheme in [_configuration cachePartitionedURLSchemes])
-        _context->registerURLSchemeAsCachePartitioned(urlScheme);
+        _processPool->registerURLSchemeAsCachePartitioned(urlScheme);
 #endif
 
     // FIXME: Add a way to configure the cache model, see <rdar://problem/16206857>.
-    _context->setCacheModel(WebKit::CacheModelPrimaryWebBrowser);
+    _processPool->setCacheModel(WebKit::CacheModelPrimaryWebBrowser);
 
     return self;
 }
 
 - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host
 {
-    _context->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).get(), host);
+    _processPool->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).get(), host);
 }
 
 - (void)_setCanHandleHTTPSServerTrustEvaluation:(BOOL)value
 {
-    _context->setCanHandleHTTPSServerTrustEvaluation(value);
+    _processPool->setCanHandleHTTPSServerTrustEvaluation(value);
 }
 
 static WebKit::HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy policy)
@@ -213,12 +213,12 @@ static WebKit::HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(NSHTTPCookieAccep
 
 - (void)_setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy
 {
-    _context->supplement<WebKit::WebCookieManagerProxy>()->setHTTPCookieAcceptPolicy(toHTTPCookieAcceptPolicy(policy));
+    _processPool->supplement<WebKit::WebCookieManagerProxy>()->setHTTPCookieAcceptPolicy(toHTTPCookieAcceptPolicy(policy));
 }
 
 - (id)_objectForBundleParameter:(NSString *)parameter
 {
-    return [_context->bundleParameters() objectForKey:parameter];
+    return [_processPool->bundleParameters() objectForKey:parameter];
 }
 
 - (void)_setObject:(id <NSCopying, NSSecureCoding>)object forBundleParameter:(NSString *)parameter
@@ -237,11 +237,11 @@ static WebKit::HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(NSHTTPCookieAccep
     }
 
     if (copy)
-        [_context->ensureBundleParameters() setObject:copy.get() forKey:parameter];
+        [_processPool->ensureBundleParameters() setObject:copy.get() forKey:parameter];
     else
-        [_context->ensureBundleParameters() removeObjectForKey:parameter];
+        [_processPool->ensureBundleParameters() removeObjectForKey:parameter];
 
-    _context->sendToAllProcesses(Messages::WebProcess::SetInjectedBundleParameter(parameter, IPC::DataReference(static_cast<const uint8_t*>([data bytes]), [data length])));
+    _processPool->sendToAllProcesses(Messages::WebProcess::SetInjectedBundleParameter(parameter, IPC::DataReference(static_cast<const uint8_t*>([data bytes]), [data length])));
 }
 
 - (id <_WKDownloadDelegate>)_downloadDelegate
@@ -252,7 +252,7 @@ static WebKit::HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(NSHTTPCookieAccep
 - (void)_setDownloadDelegate:(id <_WKDownloadDelegate>)downloadDelegate
 {
     _downloadDelegate = downloadDelegate;
-    _context->setDownloadClient(std::make_unique<WebKit::DownloadClient>(downloadDelegate));
+    _processPool->setDownloadClient(std::make_unique<WebKit::DownloadClient>(downloadDelegate));
 }
 
 @end
index f67eab5..ef33c1a 100644 (file)
@@ -28,7 +28,7 @@
 #if WK_API_ENABLED
 
 #import "WKObject.h"
-#import "WebContext.h"
+#import "WebProcessPool.h"
 
 #if TARGET_OS_IPHONE
 @class WKGeolocationProviderIOS;
 
 namespace WebKit {
 
-inline WKProcessPool *wrapper(WebContext& context)
+inline WKProcessPool *wrapper(WebProcessPool& processPool)
 {
-    ASSERT([context.wrapper() isKindOfClass:[WKProcessPool class]]);
-    return (WKProcessPool *)context.wrapper();
+    ASSERT([processPool.wrapper() isKindOfClass:[WKProcessPool class]]);
+    return (WKProcessPool *)processPool.wrapper();
 }
 
 }
@@ -48,7 +48,7 @@ inline WKProcessPool *wrapper(WebContext& context)
 @package
     RetainPtr<_WKProcessPoolConfiguration> _configuration;
 
-    API::ObjectStorage<WebKit::WebContext> _context;
+    API::ObjectStorage<WebKit::WebProcessPool> _processPool;
 }
 
 #if TARGET_OS_IPHONE
index f729b53..2b18206 100644 (file)
 #import "WKWebViewContentProvider.h"
 #import "WebBackForwardList.h"
 #import "WebCertificateInfo.h"
-#import "WebContext.h"
 #import "WebFormSubmissionListenerProxy.h"
 #import "WebKitSystemInterface.h"
 #import "WebPageGroup.h"
 #import "WebPageProxy.h"
 #import "WebPreferencesKeys.h"
+#import "WebProcessPool.h"
 #import "WebProcessProxy.h"
 #import "_WKFindDelegate.h"
 #import "_WKFormDelegate.h"
@@ -278,7 +278,7 @@ static int32_t deviceOrientation()
 
     CGRect bounds = self.bounds;
 
-    WebKit::WebContext& context = *[_configuration processPool]->_context;
+    WebKit::WebProcessPool& processPool = *[_configuration processPool]->_processPool;
 
     WebKit::WebPageConfiguration webPageConfiguration;
     webPageConfiguration.preferences = [_configuration preferences]->_preferences.get();
@@ -314,7 +314,7 @@ static int32_t deviceOrientation()
 
     [self addSubview:_scrollView.get()];
 
-    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds context:context configuration:WTF::move(webPageConfiguration) webView:self]);
+    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds processPool:processPool configuration:WTF::move(webPageConfiguration) webView:self]);
 
     _page = [_contentView page];
     _page->setDeviceOrientation(deviceOrientation());
@@ -342,7 +342,7 @@ static int32_t deviceOrientation()
 #endif
 
 #if PLATFORM(MAC)
-    _wkView = adoptNS([[WKView alloc] initWithFrame:bounds context:context configuration:WTF::move(webPageConfiguration) webView:self]);
+    _wkView = adoptNS([[WKView alloc] initWithFrame:bounds processPool:processPool configuration:WTF::move(webPageConfiguration) webView:self]);
     [self addSubview:_wkView.get()];
     _page = WebKit::toImpl([_wkView pageRef]);
 
@@ -379,7 +379,7 @@ static int32_t deviceOrientation()
 - (void)dealloc
 {
     if (_remoteObjectRegistry)
-        _page->process().context().removeMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID());
+        _page->process().processPool().removeMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID());
 
     _page->close();
 
@@ -1622,7 +1622,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
 {
     if (!_remoteObjectRegistry) {
         _remoteObjectRegistry = adoptNS([[_WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page]);
-        _page->process().context().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
+        _page->process().processPool().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
     }
 
     return _remoteObjectRegistry.get();
index 2be1839..a50281d 100644 (file)
 #import "WKViewInternal.h"
 #import "WKViewPrivate.h"
 #import "WebBackForwardList.h"
-#import "WebContext.h"
 #import "WebEventFactory.h"
 #import "WebKit2Initialize.h"
 #import "WebPage.h"
 #import "WebPageGroup.h"
 #import "WebPageProxy.h"
 #import "WebPreferences.h"
+#import "WebProcessPool.h"
 #import "WebProcessProxy.h"
 #import "WebSystemInterface.h"
 #import "_WKThumbnailViewInternal.h"
@@ -339,7 +339,7 @@ struct WKViewInterpretKeyEventsParameters {
     if (canLoadLUNotificationPopoverWillClose())
         [[NSNotificationCenter defaultCenter] removeObserver:self name:getLUNotificationPopoverWillClose() object:nil];
 
-    WebContext::statistics().wkViewCount--;
+    WebProcessPool::statistics().wkViewCount--;
 
     [super dealloc];
 }
@@ -2712,7 +2712,7 @@ static void* keyValueObservingContext = &keyValueObservingContext;
 
 - (void)_applicationWillTerminate:(NSNotification *)notification
 {
-    _data->_page->process().context().applicationWillTerminate();
+    _data->_page->process().processPool().applicationWillTerminate();
 }
 
 - (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
@@ -3558,7 +3558,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     [self addTrackingArea:trackingArea];
 }
 
-- (instancetype)initWithFrame:(NSRect)frame context:(WebContext&)context configuration:(WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView
+- (instancetype)initWithFrame:(NSRect)frame processPool:(WebProcessPool&)processPool configuration:(WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView
 {
     self = [super initWithFrame:frame];
     if (!self)
@@ -3580,8 +3580,8 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     [self addTrackingArea:_data->_primaryTrackingArea.get()];
 
     _data->_pageClient = std::make_unique<PageClientImpl>(self, webView);
-    _data->_page = context.createWebPage(*_data->_pageClient, WTF::move(webPageConfiguration));
-    _data->_page->setAddsVisitedLinks(context.historyClient().addsVisitedLinks());
+    _data->_page = processPool.createWebPage(*_data->_pageClient, WTF::move(webPageConfiguration));
+    _data->_page->setAddsVisitedLinks(processPool.historyClient().addsVisitedLinks());
 
     _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
     _data->_page->initializeWebPage();
@@ -3603,7 +3603,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     // Explicitly set the layer contents placement so AppKit will make sure that our layer has masksToBounds set to YES.
     self.layerContentsPlacement = NSViewLayerContentsPlacementTopLeft;
 
-    WebContext::statistics().wkViewCount++;
+    WebProcessPool::statistics().wkViewCount++;
 
     NSNotificationCenter* workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
     [workspaceNotificationCenter addObserver:self selector:@selector(_activeSpaceDidChange:) name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
@@ -3794,7 +3794,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     webPageConfiguration.pageGroup = toImpl(pageGroupRef);
     webPageConfiguration.relatedPage = toImpl(relatedPage);
 
-    return [self initWithFrame:frame context:*toImpl(contextRef) configuration:webPageConfiguration webView:nil];
+    return [self initWithFrame:frame processPool:*toImpl(contextRef) configuration:webPageConfiguration webView:nil];
 }
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
index 6e9cc89..11d17ce 100644 (file)
@@ -54,7 +54,7 @@ namespace WebKit {
 class DrawingAreaProxy;
 class LayerTreeContext;
 class ViewSnapshot;
-class WebContext;
+class WebProcessPool;
 struct ActionMenuHitTestResult;
 struct ColorSpaceData;
 struct EditorState;
@@ -69,7 +69,7 @@ struct WebPageConfiguration;
 
 @interface WKView ()
 #if WK_API_ENABLED
-- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
+- (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
 #endif
 
 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
  */
 
 #include "config.h"
-#include "APIContextConfiguration.h"
+#include "APIProcessPoolConfiguration.h"
 
-#include "WebContext.h"
+#include "WebProcessPool.h"
 
 namespace API {
 
-ContextConfiguration::ContextConfiguration()
+ProcessPoolConfiguration::ProcessPoolConfiguration()
 {
 }
 
-ContextConfiguration::~ContextConfiguration()
+ProcessPoolConfiguration::~ProcessPoolConfiguration()
 {
 }
 
-WebKit::WebContextConfiguration ContextConfiguration::webContextConfiguration() const
+WebKit::WebProcessPoolConfiguration ProcessPoolConfiguration::webProcessPoolConfiguration() const
 {
-    WebKit::WebContextConfiguration configuration;
+    WebKit::WebProcessPoolConfiguration configuration;
 
     configuration.indexedDBDatabaseDirectory = m_indexedDBDatabaseDirectory;
     configuration.injectedBundlePath = m_injectedBundlePath;
@@ -48,7 +48,7 @@ WebKit::WebContextConfiguration ContextConfiguration::webContextConfiguration()
     configuration.webSQLDatabaseDirectory = m_webSQLDatabaseDirectory;
     configuration.mediaKeysStorageDirectory = m_mediaKeysStorageDirectory;
 
-    WebKit::WebContext::applyPlatformSpecificConfigurationDefaults(configuration);
+    WebKit::WebProcessPool::applyPlatformSpecificConfigurationDefaults(configuration);
 
     return configuration;
 }
 #include <wtf/text/WTFString.h>
 
 namespace WebKit {
-struct WebContextConfiguration;
+struct WebProcessPoolConfiguration;
 }
 
 namespace API {
 
-class ContextConfiguration : public ObjectImpl<Object::Type::ContextConfiguration> {
+class ProcessPoolConfiguration : public ObjectImpl<Object::Type::ProcessPoolConfiguration> {
 public:
-    static PassRefPtr<ContextConfiguration> create()
+    static PassRefPtr<ProcessPoolConfiguration> create()
     {
-        return adoptRef(new ContextConfiguration);
+        return adoptRef(new ProcessPoolConfiguration);
     }
-    virtual ~ContextConfiguration();
+    virtual ~ProcessPoolConfiguration();
 
     String indexedDBDatabaseDirectory() const { return m_indexedDBDatabaseDirectory; }
     void setIndexedDBDatabaseDirectory(const String& indexedDBDatabaseDirectory) { m_indexedDBDatabaseDirectory = indexedDBDatabaseDirectory; }
@@ -58,10 +58,10 @@ public:
     String mediaKeysStorageDirectory() const { return m_mediaKeysStorageDirectory; }
     void setMediaKeysStorageDirectory(const String& mediaKeysStorageDirectory) { m_mediaKeysStorageDirectory = mediaKeysStorageDirectory; }
 
-    WebKit::WebContextConfiguration webContextConfiguration() const;
+    WebKit::WebProcessPoolConfiguration webProcessPoolConfiguration() const;
 
 private:
-    ContextConfiguration();
+    ProcessPoolConfiguration();
 
     String m_indexedDBDatabaseDirectory;
     String m_injectedBundlePath;
index 972996d..0cac4f0 100644 (file)
@@ -48,13 +48,13 @@ public:
     
 private:
     // From API::DownloadClient
-    virtual void didStart(WebContext*, DownloadProxy*);
-    virtual void didReceiveResponse(WebContext*, DownloadProxy*, const WebCore::ResourceResponse&);
-    virtual void didReceiveData(WebContext*, DownloadProxy*, uint64_t length);
-    virtual String decideDestinationWithSuggestedFilename(WebContext*, DownloadProxy*, const String& filename, bool& allowOverwriteParam);
-    virtual void didFinish(WebContext*, DownloadProxy*);
-    virtual void didFail(WebContext*, DownloadProxy*, const WebCore::ResourceError&);
-    virtual void didCancel(WebContext*, DownloadProxy*);
+    virtual void didStart(WebProcessPool*, DownloadProxy*);
+    virtual void didReceiveResponse(WebProcessPool*, DownloadProxy*, const WebCore::ResourceResponse&);
+    virtual void didReceiveData(WebProcessPool*, DownloadProxy*, uint64_t length);
+    virtual String decideDestinationWithSuggestedFilename(WebProcessPool*, DownloadProxy*, const String& filename, bool& allowOverwriteParam);
+    virtual void didFinish(WebProcessPool*, DownloadProxy*);
+    virtual void didFail(WebProcessPool*, DownloadProxy*, const WebCore::ResourceError&);
+    virtual void didCancel(WebProcessPool*, DownloadProxy*);
 
     WeakObjCPtr<id <_WKDownloadDelegate>> m_delegate;
 
index e3fa0d2..ea56d10 100644 (file)
@@ -54,25 +54,25 @@ DownloadClient::DownloadClient(id <_WKDownloadDelegate> delegate)
     m_delegateMethods.downloadDidCancel = [delegate respondsToSelector:@selector(_downloadDidCancel:)];
 }
 
-void DownloadClient::didStart(WebContext*, DownloadProxy* downloadProxy)
+void DownloadClient::didStart(WebProcessPool*, DownloadProxy* downloadProxy)
 {
     if (m_delegateMethods.downloadDidStart)
         [m_delegate.get() _downloadDidStart:wrapper(*downloadProxy)];
 }
 
-void DownloadClient::didReceiveResponse(WebContext*, DownloadProxy* downloadProxy, const WebCore::ResourceResponse& response)
+void DownloadClient::didReceiveResponse(WebProcessPool*, DownloadProxy* downloadProxy, const WebCore::ResourceResponse& response)
 {
     if (m_delegateMethods.downloadDidReceiveResponse)
         [m_delegate.get() _download:wrapper(*downloadProxy) didReceiveResponse:response.nsURLResponse()];
 }
 
-void DownloadClient::didReceiveData(WebContext*, DownloadProxy* downloadProxy, uint64_t length)
+void DownloadClient::didReceiveData(WebProcessPool*, DownloadProxy* downloadProxy, uint64_t length)
 {
     if (m_delegateMethods.downloadDidReceiveData)
         [m_delegate.get() _download:wrapper(*downloadProxy) didReceiveData:length];
 }
 
-String DownloadClient::decideDestinationWithSuggestedFilename(WebContext*, DownloadProxy* downloadProxy, const String& filename, bool& allowOverwriteParam)
+String DownloadClient::decideDestinationWithSuggestedFilename(WebProcessPool*, DownloadProxy* downloadProxy, const String& filename, bool& allowOverwriteParam)
 {
     if (!m_delegateMethods.downloadDecideDestinationWithSuggestedFilenameAllowOverwrite)
         return String();
@@ -83,19 +83,19 @@ String DownloadClient::decideDestinationWithSuggestedFilename(WebContext*, Downl
     return destination;
 }
 
-void DownloadClient::didFinish(WebContext*, DownloadProxy* downloadProxy)
+void DownloadClient::didFinish(WebProcessPool*, DownloadProxy* downloadProxy)
 {
     if (m_delegateMethods.downloadDidFinish)
         [m_delegate.get() _downloadDidFinish:wrapper(*downloadProxy)];
 }
 
-void DownloadClient::didFail(WebContext*, DownloadProxy* downloadProxy, const WebCore::ResourceError& error)
+void DownloadClient::didFail(WebProcessPool*, DownloadProxy* downloadProxy, const WebCore::ResourceError& error)
 {
     if (m_delegateMethods.downloadDidFail)
         [m_delegate.get() _download:wrapper(*downloadProxy) didFailWithError:error.nsError()];
 }
 
-void DownloadClient::didCancel(WebContext*, DownloadProxy* downloadProxy)
+void DownloadClient::didCancel(WebProcessPool*, DownloadProxy* downloadProxy)
 {
     if (m_delegateMethods.downloadDidCancel)
         [m_delegate.get() _downloadDidCancel:wrapper(*downloadProxy)];
@@ -24,7 +24,7 @@
  */
 
 #import "config.h"
-#import "WebContext.h"
+#import "WebProcessPool.h"
 
 #import "PluginProcessManager.h"
 #import "SandboxUtilities.h"
@@ -103,7 +103,7 @@ static void registerUserDefaultsIfNeeded()
     [[NSUserDefaults standardUserDefaults] registerDefaults:registrationDictionary];
 }
 
-void WebContext::updateProcessSuppressionState()
+void WebProcessPool::updateProcessSuppressionState()
 {
 #if ENABLE(NETWORK_PROCESS)
     if (m_usesNetworkProcess && m_networkProcess)
@@ -118,7 +118,7 @@ void WebContext::updateProcessSuppressionState()
 #endif
 }
 
-NSMutableDictionary *WebContext::ensureBundleParameters()
+NSMutableDictionary *WebProcessPool::ensureBundleParameters()
 {
     if (!m_bundleParameters)
         m_bundleParameters = adoptNS([[NSMutableDictionary alloc] init]);
@@ -126,7 +126,7 @@ NSMutableDictionary *WebContext::ensureBundleParameters()
     return m_bundleParameters.get();
 }
 
-void WebContext::platformInitialize()
+void WebProcessPool::platformInitialize()
 {
     registerUserDefaultsIfNeeded();
     registerNotificationObservers();
@@ -136,7 +136,7 @@ void WebContext::platformInitialize()
 #endif
 }
 
-String WebContext::platformDefaultApplicationCacheDirectory() const
+String WebProcessPool::platformDefaultApplicationCacheDirectory() const
 {
     NSString *appName = [[NSBundle mainBundle] bundleIdentifier];
     if (!appName)
@@ -164,7 +164,7 @@ String WebContext::platformDefaultApplicationCacheDirectory() const
     return stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
 }
 
-void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
+void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
 {
     parameters.presenterApplicationPid = getpid();
 
@@ -227,7 +227,7 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
 }
 
 #if ENABLE(NETWORK_PROCESS)
-void WebContext::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)
+void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)
 {
     NSURLCache *urlCache = [NSURLCache sharedURLCache];
     parameters.nsURLCacheMemoryCapacity = [urlCache memoryCapacity];
@@ -244,12 +244,12 @@ void WebContext::platformInitializeNetworkProcess(NetworkProcessCreationParamete
 }
 #endif
 
-void WebContext::platformInvalidateContext()
+void WebProcessPool::platformInvalidateContext()
 {
     unregisterNotificationObservers();
 }
 
-String WebContext::platformDefaultDiskCacheDirectory() const
+String WebProcessPool::platformDefaultDiskCacheDirectory() const
 {
     RetainPtr<NSString> cachePath = adoptNS((NSString *)WKCopyFoundationCacheDirectory());
     if (!cachePath)
@@ -257,7 +257,7 @@ String WebContext::platformDefaultDiskCacheDirectory() const
     return stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
 }
 
-String WebContext::platformDefaultCookieStorageDirectory() const
+String WebProcessPool::platformDefaultCookieStorageDirectory() const
 {
 #if PLATFORM(IOS)
     String path = pathForProcessContainer();
@@ -274,7 +274,7 @@ String WebContext::platformDefaultCookieStorageDirectory() const
 }
 
 #if PLATFORM(IOS)
-String WebContext::openGLCacheDirectory() const
+String WebProcessPool::openGLCacheDirectory() const
 {
     String path = pathForProcessContainer();
     if (path.isEmpty())
@@ -284,12 +284,12 @@ String WebContext::openGLCacheDirectory() const
     return stringByResolvingSymlinksInPath(path);
 }
 
-String WebContext::parentBundleDirectory() const
+String WebProcessPool::parentBundleDirectory() const
 {
     return [[[NSBundle mainBundle] bundlePath] stringByStandardizingPath];
 }
 
-String WebContext::networkingHSTSDatabasePath() const
+String WebProcessPool::networkingHSTSDatabasePath() const
 {
     String path = pathForProcessContainer();
     if (path.isEmpty())
@@ -308,7 +308,7 @@ String WebContext::networkingHSTSDatabasePath() const
     return path + "/HSTS.plist";
 }
 
-String WebContext::webContentHSTSDatabasePath() const
+String WebProcessPool::webContentHSTSDatabasePath() const
 {
     String path = pathForProcessContainer();
     if (path.isEmpty())
@@ -327,14 +327,14 @@ String WebContext::webContentHSTSDatabasePath() const
     return path + "/HSTS.plist";
 }
 
-String WebContext::containerTemporaryDirectory() const
+String WebProcessPool::containerTemporaryDirectory() const
 {
     String path = NSTemporaryDirectory();
     return stringByResolvingSymlinksInPath(path);
 }
 #endif
 
-String WebContext::platformDefaultWebSQLDatabaseDirectory()
+String WebProcessPool::platformDefaultWebSQLDatabaseDirectory()
 {
     NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebDatabaseDirectoryDefaultsKey];
     if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
@@ -342,7 +342,7 @@ String WebContext::platformDefaultWebSQLDatabaseDirectory()
     return stringByResolvingSymlinksInPath([databasesDirectory stringByStandardizingPath]);
 }
 
-String WebContext::platformDefaultIndexedDBDatabaseDirectory()
+String WebProcessPool::platformDefaultIndexedDBDatabaseDirectory()
 {
     // Indexed databases exist in a subdirectory of the "database directory path."
     // Currently, the top level of that directory contains entities related to WebSQL databases.
@@ -351,7 +351,7 @@ String WebContext::platformDefaultIndexedDBDatabaseDirectory()
     return pathByAppendingComponent(platformDefaultWebSQLDatabaseDirectory(), "___IndexedDB");
 }
 
-String WebContext::platformDefaultIconDatabasePath() const
+String WebProcessPool::platformDefaultIconDatabasePath() const
 {
     // FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String.
     NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebIconDatabaseDirectoryDefaultsKey];
@@ -360,7 +360,7 @@ String WebContext::platformDefaultIconDatabasePath() const
     return stringByResolvingSymlinksInPath([databasesDirectory stringByStandardizingPath]);
 }
 
-String WebContext::platformDefaultLocalStorageDirectory()
+String WebProcessPool::platformDefaultLocalStorageDirectory()
 {
     NSString *localStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebStorageDirectoryDefaultsKey];
     if (!localStorageDirectory || ![localStorageDirectory isKindOfClass:[NSString class]])
@@ -368,7 +368,7 @@ String WebContext::platformDefaultLocalStorageDirectory()
     return stringByResolvingSymlinksInPath([localStorageDirectory stringByStandardizingPath]);
 }
 
-String WebContext::platformDefaultMediaKeysStorageDirectory()
+String WebProcessPool::platformDefaultMediaKeysStorageDirectory()
 {
     NSString *mediaKeysStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitMediaKeysStorageDirectoryDefaultsKey];
     if (!mediaKeysStorageDirectory || ![mediaKeysStorageDirectory isKindOfClass:[NSString class]])
@@ -376,28 +376,28 @@ String WebContext::platformDefaultMediaKeysStorageDirectory()
     return stringByResolvingSymlinksInPath([mediaKeysStorageDirectory stringByStandardizingPath]);
 }
 
-bool WebContext::omitPDFSupport()
+bool WebProcessPool::omitPDFSupport()
 {
     // Since this is a "secret default" we don't bother registering it.
     return [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitOmitPDFSupport"];
 }
 
-void WebContext::getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes)
+void WebProcessPool::getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes)
 {
     PlatformPasteboard(pasteboardName).getTypes(pasteboardTypes);
 }
 
-void WebContext::getPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames)
+void WebProcessPool::getPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames)
 {
     PlatformPasteboard(pasteboardName).getPathnamesForType(pathnames, pasteboardType);
 }
 
-void WebContext::getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, String& string)
+void WebProcessPool::getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, String& string)
 {
     string = PlatformPasteboard(pasteboardName).stringForType(pasteboardType);
 }
 
-void WebContext::getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, SharedMemory::Handle& handle, uint64_t& size)
+void WebProcessPool::getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, SharedMemory::Handle& handle, uint64_t& size)
 {
     RefPtr<SharedBuffer> buffer = PlatformPasteboard(pasteboardName).bufferForType(pasteboardType);
     if (!buffer)
@@ -410,52 +410,52 @@ void WebContext::getPasteboardBufferForType(const String& pasteboardName, const
     sharedMemoryBuffer->createHandle(handle, SharedMemory::ReadOnly);
 }
 
-void WebContext::pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, uint64_t& newChangeCount)
+void WebProcessPool::pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, uint64_t& newChangeCount)
 {
     newChangeCount = PlatformPasteboard(toPasteboard).copy(fromPasteboard);
 }
 
-void WebContext::getPasteboardChangeCount(const String& pasteboardName, uint64_t& changeCount)
+void WebProcessPool::getPasteboardChangeCount(const String& pasteboardName, uint64_t& changeCount)
 {
     changeCount = PlatformPasteboard(pasteboardName).changeCount();
 }
 
-void WebContext::getPasteboardUniqueName(String& pasteboardName)
+void WebProcessPool::getPasteboardUniqueName(String& pasteboardName)
 {
     pasteboardName = PlatformPasteboard::uniqueName();
 }
 
-void WebContext::getPasteboardColor(const String& pasteboardName, WebCore::Color& color)
+void WebProcessPool::getPasteboardColor(const String& pasteboardName, WebCore::Color& color)
 {
     color = PlatformPasteboard(pasteboardName).color();    
 }
 
-void WebContext::getPasteboardURL(const String& pasteboardName, WTF::String& urlString)
+void WebProcessPool::getPasteboardURL(const String& pasteboardName, WTF::String& urlString)
 {
     urlString = PlatformPasteboard(pasteboardName).url().string();
 }
 
-void WebContext::addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount)
+void WebProcessPool::addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount)
 {
     newChangeCount = PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes);
 }
 
-void WebContext::setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount)
+void WebProcessPool::setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount)
 {
     newChangeCount = PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes);
 }
 
-void WebContext::setPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, const Vector<String>& pathnames, uint64_t& newChangeCount)
+void WebProcessPool::setPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, const Vector<String>& pathnames, uint64_t& newChangeCount)
 {
     newChangeCount = PlatformPasteboard(pasteboardName).setPathnamesForType(pathnames, pasteboardType);
 }
 
-void WebContext::setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string, uint64_t& newChangeCount)
+void WebProcessPool::setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string, uint64_t& newChangeCount)
 {
     newChangeCount = PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType);
 }
 
-void WebContext::setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle& handle, uint64_t size, uint64_t& newChangeCount)
+void WebProcessPool::setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle& handle, uint64_t size, uint64_t& newChangeCount)
 {
     if (handle.isNull()) {
         newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(0, pasteboardType);
@@ -467,32 +467,32 @@ void WebContext::setPasteboardBufferForType(const String& pasteboardName, const
 }
 
 #if PLATFORM(IOS)
-void WebContext::writeWebContentToPasteboard(const WebCore::PasteboardWebContent& content)
+void WebProcessPool::writeWebContentToPasteboard(const WebCore::PasteboardWebContent& content)
 {
     PlatformPasteboard().write(content);
 }
 
-void WebContext::writeImageToPasteboard(const WebCore::PasteboardImage& pasteboardImage)
+void WebProcessPool::writeImageToPasteboard(const WebCore::PasteboardImage& pasteboardImage)
 {
     PlatformPasteboard().write(pasteboardImage);
 }
 
-void WebContext::writeStringToPasteboard(const String& pasteboardType, const String& text)
+void WebProcessPool::writeStringToPasteboard(const String& pasteboardType, const String& text)
 {
     PlatformPasteboard().write(pasteboardType, text);
 }
 
-void WebContext::readStringFromPasteboard(uint64_t index, const String& pasteboardType, WTF::String& value)
+void WebProcessPool::readStringFromPasteboard(uint64_t index, const String& pasteboardType, WTF::String& value)
 {
     value = PlatformPasteboard().readString(index, pasteboardType);
 }
 
-void WebContext::readURLFromPasteboard(uint64_t index, const String& pasteboardType, String& url)
+void WebProcessPool::readURLFromPasteboard(uint64_t index, const String& pasteboardType, String& url)
 {
     url = PlatformPasteboard().readURL(index, pasteboardType);
 }
 
-void WebContext::readBufferFromPasteboard(uint64_t index, const String& pasteboardType, SharedMemory::Handle& handle, uint64_t& size)
+void WebProcessPool::readBufferFromPasteboard(uint64_t index, const String& pasteboardType, SharedMemory::Handle& handle, uint64_t& size)
 {
     RefPtr<SharedBuffer> buffer = PlatformPasteboard().readBuffer(index, pasteboardType);
     if (!buffer)
@@ -505,19 +505,19 @@ void WebContext::readBufferFromPasteboard(uint64_t index, const String& pasteboa
     sharedMemoryBuffer->createHandle(handle, SharedMemory::ReadOnly);
 }
 
-void WebContext::getPasteboardItemsCount(uint64_t& itemsCount)
+void WebProcessPool::getPasteboardItemsCount(uint64_t& itemsCount)
 {
     itemsCount = PlatformPasteboard().count();
 }
 
 #endif
 
-bool WebContext::processSuppressionEnabled() const
+bool WebProcessPool::processSuppressionEnabled() const
 {
     return !m_userObservablePageCounter.value() && !m_processSuppressionDisabledForPageCounter.value();
 }
 
-void WebContext::registerNotificationObservers()
+void WebProcessPool::registerNotificationObservers()
 {
 #if !PLATFORM(IOS)
     // Listen for enhanced accessibility changes and propagate them to the WebProcess.
@@ -549,7 +549,7 @@ void WebContext::registerNotificationObservers()
 #endif // !PLATFORM(IOS)
 }
 
-void WebContext::unregisterNotificationObservers()
+void WebProcessPool::unregisterNotificationObservers()
 {
 #if !PLATFORM(IOS)
     [[NSNotificationCenter defaultCenter] removeObserver:m_enhancedAccessibilityObserver.get()];    
@@ -577,7 +577,7 @@ static CFURLStorageSessionRef privateBrowsingSession()
 }
 #endif
 
-bool WebContext::isURLKnownHSTSHost(const String& urlString, bool privateBrowsingEnabled) const
+bool WebProcessPool::isURLKnownHSTSHost(const String& urlString, bool privateBrowsingEnabled) const
 {
 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     RetainPtr<CFURLRef> url = URL(URL(), urlString).createCFURL();
@@ -588,7 +588,7 @@ bool WebContext::isURLKnownHSTSHost(const String& urlString, bool privateBrowsin
 #endif
 }
 
-void WebContext::resetHSTSHosts()
+void WebProcessPool::resetHSTSHosts()
 {
 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     _CFNetworkResetHSTSHostsWithSession(nullptr);
index 40c89a3..74ed437 100644 (file)
@@ -28,9 +28,9 @@
 
 #include "DatabaseProcessMessages.h"
 #include "DatabaseProcessProxyMessages.h"
-#include "WebContext.h"
 #include "WebOriginDataManagerProxy.h"
 #include "WebOriginDataManagerProxyMessages.h"
+#include "WebProcessPool.h"
 
 #if ENABLE(DATABASE_PROCESS)
 
@@ -38,13 +38,13 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassRefPtr<DatabaseProcessProxy> DatabaseProcessProxy::create(WebContext* context)
+PassRefPtr<DatabaseProcessProxy> DatabaseProcessProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new DatabaseProcessProxy(context));
+    return adoptRef(new DatabaseProcessProxy(processPool));
 }
 
-DatabaseProcessProxy::DatabaseProcessProxy(WebContext* context)
-    : m_webContext(context)
+DatabaseProcessProxy::DatabaseProcessProxy(WebProcessPool* processPool)
+    : m_processPool(processPool)
     , m_numPendingConnectionRequests(0)
 {
     connect();
@@ -77,7 +77,7 @@ void DatabaseProcessProxy::didReceiveMessage(IPC::Connection* connection, IPC::M
     }
 
     if (decoder.messageReceiverName() == Messages::WebOriginDataManagerProxy::messageReceiverName()) {
-        m_webContext->supplement<WebOriginDataManagerProxy>()->didReceiveMessage(connection, decoder);
+        m_processPool->supplement<WebOriginDataManagerProxy>()->didReceiveMessage(connection, decoder);
         return;
     }
 }
@@ -109,9 +109,8 @@ void DatabaseProcessProxy::didClose(IPC::Connection*)
 #endif
     }
 
-    // Tell WebContext to forget about this database process. This may cause us to be deleted.
-    m_webContext->databaseProcessCrashed(this);
-    
+    // Tell ProcessPool to forget about this database process. This may cause us to be deleted.
+    m_processPool->databaseProcessCrashed(this);
 }
 
 void DatabaseProcessProxy::didReceiveInvalidMessage(IPC::Connection*, IPC::StringReference messageReceiverName, IPC::StringReference messageName)
index 54d9400..cb7b6da 100644 (file)
 
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 
 class DatabaseProcessProxy : public ChildProcessProxy {
 public:
-    static PassRefPtr<DatabaseProcessProxy> create(WebContext*);
+    static PassRefPtr<DatabaseProcessProxy> create(WebProcessPool*);
     ~DatabaseProcessProxy();
 
     void getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply>);
 
 private:
-    DatabaseProcessProxy(WebContext*);
+    DatabaseProcessProxy(WebProcessPool*);
 
     // ChildProcessProxy
     virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
@@ -67,7 +67,7 @@ private:
 
     void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
 
-    WebContext* m_webContext;
+    WebProcessPool* m_processPool;
 
     unsigned m_numPendingConnectionRequests;
     Deque<RefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply>> m_pendingConnectionReplies;
index f7ffdc5..d683336 100644 (file)
@@ -31,8 +31,8 @@
 #include "AuthenticationChallengeProxy.h"
 #include "DataReference.h"
 #include "DownloadProxyMap.h"
-#include "WebContext.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
@@ -51,14 +51,14 @@ static uint64_t generateDownloadID()
     return ++uniqueDownloadID;
 }
     
-PassRefPtr<DownloadProxy> DownloadProxy::create(DownloadProxyMap& downloadProxyMap, WebContext& webContext, const ResourceRequest& resourceRequest)
+PassRefPtr<DownloadProxy> DownloadProxy::create(DownloadProxyMap& downloadProxyMap, WebProcessPool& processPool, const ResourceRequest& resourceRequest)
 {
-    return adoptRef(new DownloadProxy(downloadProxyMap, webContext, resourceRequest));
+    return adoptRef(new DownloadProxy(downloadProxyMap, processPool, resourceRequest));
 }
 
-DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebContext& webContext, const ResourceRequest& resourceRequest)
+DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebProcessPool& processPool, const ResourceRequest& resourceRequest)
     : m_downloadProxyMap(downloadProxyMap)
-    , m_webContext(&webContext)
+    , m_processPool(&processPool)
     , m_downloadID(generateDownloadID())
     , m_request(resourceRequest)
 {
@@ -66,93 +66,93 @@ DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebContext& web
 
 DownloadProxy::~DownloadProxy()
 {
-    ASSERT(!m_webContext);
+    ASSERT(!m_processPool);
 }
 
 void DownloadProxy::cancel()
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
 #if ENABLE(NETWORK_PROCESS)
-    if (m_webContext->usesNetworkProcess()) {
-        if (NetworkProcessProxy* networkProcess = m_webContext->networkProcess())
+    if (m_processPool->usesNetworkProcess()) {
+        if (NetworkProcessProxy* networkProcess = m_processPool->networkProcess())
             networkProcess->connection()->send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
         return;
     }
 #endif
 
-    m_webContext->sendToAllProcesses(Messages::WebProcess::CancelDownload(m_downloadID));
+    m_processPool->sendToAllProcesses(Messages::WebProcess::CancelDownload(m_downloadID));
 }
 
 void DownloadProxy::invalidate()
 {
-    ASSERT(m_webContext);
-    m_webContext = 0;
+    ASSERT(m_processPool);
+    m_processPool = nullptr;
 }
 
 void DownloadProxy::processDidClose()
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    m_webContext->downloadClient().processDidCrash(m_webContext.get(), this);
+    m_processPool->downloadClient().processDidCrash(m_processPool.get(), this);
 }
 
 void DownloadProxy::didStart(const ResourceRequest& request)
 {
     m_request = request;
 
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    m_webContext->downloadClient().didStart(m_webContext.get(), this);
+    m_processPool->downloadClient().didStart(m_processPool.get(), this);
 }
 
 void DownloadProxy::didReceiveAuthenticationChallenge(const AuthenticationChallenge& authenticationChallenge, uint64_t challengeID)
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    RefPtr<AuthenticationChallengeProxy> authenticationChallengeProxy = AuthenticationChallengeProxy::create(authenticationChallenge, challengeID, m_webContext->networkingProcessConnection());
+    RefPtr<AuthenticationChallengeProxy> authenticationChallengeProxy = AuthenticationChallengeProxy::create(authenticationChallenge, challengeID, m_processPool->networkingProcessConnection());
 
-    m_webContext->downloadClient().didReceiveAuthenticationChallenge(m_webContext.get(), this, authenticationChallengeProxy.get());
+    m_processPool->downloadClient().didReceiveAuthenticationChallenge(m_processPool.get(), this, authenticationChallengeProxy.get());
 }
 
 void DownloadProxy::didReceiveResponse(const ResourceResponse& response)
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    m_webContext->downloadClient().didReceiveResponse(m_webContext.get(), this, response);
+    m_processPool->downloadClient().didReceiveResponse(m_processPool.get(), this, response);
 }
 
 void DownloadProxy::didReceiveData(uint64_t length)
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    m_webContext->downloadClient().didReceiveData(m_webContext.get(), this, length);
+    m_processPool->downloadClient().didReceiveData(m_processPool.get(), this, length);
 }
 
 void DownloadProxy::shouldDecodeSourceDataOfMIMEType(const String& mimeType, bool& result)
 {
     result = false;
 
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    result = m_webContext->downloadClient().shouldDecodeSourceDataOfMIMEType(m_webContext.get(), this, mimeType);
+    result = m_processPool->downloadClient().shouldDecodeSourceDataOfMIMEType(m_processPool.get(), this, mimeType);
 }
 
 void DownloadProxy::decideDestinationWithSuggestedFilename(const String& filename, String& destination, bool& allowOverwrite, SandboxExtension::Handle& sandboxExtensionHandle)
 {
     allowOverwrite = false;
 
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    destination = m_webContext->downloadClient().decideDestinationWithSuggestedFilename(m_webContext.get(), this, filename, allowOverwrite);
+    destination = m_processPool->downloadClient().decideDestinationWithSuggestedFilename(m_processPool.get(), this, filename, allowOverwrite);
 
     if (!destination.isNull())
         SandboxExtension::createHandle(destination, SandboxExtension::ReadWrite, sandboxExtensionHandle);
@@ -160,18 +160,18 @@ void DownloadProxy::decideDestinationWithSuggestedFilename(const String& filenam
 
 void DownloadProxy::didCreateDestination(const String& path)
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    m_webContext->downloadClient().didCreateDestination(m_webContext.get(), this, path);
+    m_processPool->downloadClient().didCreateDestination(m_processPool.get(), this, path);
 }
 
 void DownloadProxy::didFinish()
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
-    m_webContext->downloadClient().didFinish(m_webContext.get(), this);
+    m_processPool->downloadClient().didFinish(m_processPool.get(), this);
 
     // This can cause the DownloadProxy object to be deleted.
     m_downloadProxyMap.downloadFinished(this);
@@ -187,12 +187,12 @@ static PassRefPtr<API::Data> createData(const IPC::DataReference& data)
 
 void DownloadProxy::didFail(const ResourceError& error, const IPC::DataReference& resumeData)
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
     m_resumeData = createData(resumeData);
 
-    m_webContext->downloadClient().didFail(m_webContext.get(), this, error);
+    m_processPool->downloadClient().didFail(m_processPool.get(), this, error);
 
     // This can cause the DownloadProxy object to be deleted.
     m_downloadProxyMap.downloadFinished(this);
@@ -202,7 +202,7 @@ void DownloadProxy::didCancel(const IPC::DataReference& resumeData)
 {
     m_resumeData = createData(resumeData);
 
-    m_webContext->downloadClient().didCancel(m_webContext.get(), this);
+    m_processPool->downloadClient().didCancel(m_processPool.get(), this);
 
     // This can cause the DownloadProxy object to be deleted.
     m_downloadProxyMap.downloadFinished(this);
index 6d8f9aa..07689ff 100644 (file)
@@ -46,12 +46,12 @@ namespace WebCore {
 namespace WebKit {
 
 class DownloadProxyMap;
-class WebContext;
 class WebPageProxy;
+class WebProcessPool;
 
 class DownloadProxy : public API::ObjectImpl<API::Object::Type::Download>, public IPC::MessageReceiver {
 public:
-    static PassRefPtr<DownloadProxy> create(DownloadProxyMap&, WebContext&, const WebCore::ResourceRequest&);
+    static PassRefPtr<DownloadProxy> create(DownloadProxyMap&, WebProcessPool&, const WebCore::ResourceRequest&);
     ~DownloadProxy();
 
     uint64_t downloadID() const { return m_downloadID; }
@@ -67,7 +67,7 @@ public:
     void didReceiveSyncDownloadProxyMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
 
 private:
-    explicit DownloadProxy(DownloadProxyMap&, WebContext&, const WebCore::ResourceRequest&);
+    explicit DownloadProxy(DownloadProxyMap&, WebProcessPool&, const WebCore::ResourceRequest&);
 
     // IPC::MessageReceiver
     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
@@ -86,7 +86,7 @@ private:
     void didCancel(const IPC::DataReference& resumeData);
 
     DownloadProxyMap& m_downloadProxyMap;
-    RefPtr<WebContext> m_webContext;
+    RefPtr<WebProcessPool> m_processPool;
     uint64_t m_downloadID;
 
     RefPtr<API::Data> m_resumeData;
index 86952d8..4d6f33e 100644 (file)
@@ -44,9 +44,9 @@ DownloadProxyMap::~DownloadProxyMap()
     ASSERT(m_downloads.isEmpty());
 }
 
-DownloadProxy* DownloadProxyMap::createDownloadProxy(WebContext& webContext, const WebCore::ResourceRequest& resourceRequest)
+DownloadProxy* DownloadProxyMap::createDownloadProxy(WebProcessPool& processPool, const WebCore::ResourceRequest& resourceRequest)
 {
-    RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(*this, webContext, resourceRequest);
+    RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(*this, processPool, resourceRequest);
     m_downloads.set(downloadProxy->downloadID(), downloadProxy);
 
     m_process->addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID(), *downloadProxy);
index a50b981..9fd5267 100644 (file)
@@ -38,7 +38,7 @@ namespace WebKit {
 
 class ChildProcessProxy;
 class DownloadProxy;
-class WebContext;
+class WebProcessPool;
 
 class DownloadProxyMap {
     WTF_MAKE_NONCOPYABLE(DownloadProxyMap);
@@ -47,7 +47,7 @@ public:
     explicit DownloadProxyMap(ChildProcessProxy*);
     ~DownloadProxyMap();
 
-    DownloadProxy* createDownloadProxy(WebContext&, const WebCore::ResourceRequest&);
+    DownloadProxy* createDownloadProxy(WebProcessPool&, const WebCore::ResourceRequest&);
     void downloadFinished(DownloadProxy*);
 
     bool isEmpty() const { return m_downloads.isEmpty(); }
index ea4862c..caa7bd7 100644 (file)
@@ -41,11 +41,11 @@ class ResourceRequest;
 namespace WebKit {
 
 class ChildProcessProxy;
-class WebContext;
+class WebProcessPool;
 
 class CustomProtocolManagerProxy : public IPC::MessageReceiver {
 public:
-    explicit CustomProtocolManagerProxy(ChildProcessProxy*, WebContext&);
+    explicit CustomProtocolManagerProxy(ChildProcessProxy*, WebProcessPool&);
 
     void startLoading(uint64_t customProtocolID, const WebCore::ResourceRequest&);
     void stopLoading(uint64_t customProtocolID);
@@ -55,7 +55,7 @@ private:
     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
 
     ChildProcessProxy* m_childProcessProxy;
-    WebContext& m_webContext;
+    WebProcessPool& m_processPool;
 
 #if PLATFORM(COCOA)
     typedef HashMap<uint64_t, RetainPtr<WKCustomProtocolLoader>> LoaderMap;
index 51f1722..d0e5c35 100644 (file)
@@ -120,9 +120,9 @@ using namespace WebKit;
 
 namespace WebKit {
 
-CustomProtocolManagerProxy::CustomProtocolManagerProxy(ChildProcessProxy* childProcessProxy, WebContext& webContext)
+CustomProtocolManagerProxy::CustomProtocolManagerProxy(ChildProcessProxy* childProcessProxy, WebProcessPool& processPool)
     : m_childProcessProxy(childProcessProxy)
-    , m_webContext(webContext)
+    , m_processPool(processPool)
 {
     ASSERT(m_childProcessProxy);
     m_childProcessProxy->addMessageReceiver(Messages::CustomProtocolManagerProxy::messageReceiverName(), *this);
index 9b54ee9..750fc08 100644 (file)
@@ -33,8 +33,8 @@
 #include "DownloadProxyMessages.h"
 #include "NetworkProcessCreationParameters.h"
 #include "NetworkProcessMessages.h"
-#include "WebContext.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
 #include <wtf/RunLoop.h>
 
 #if ENABLE(SEC_ITEM_SHIM)
@@ -58,15 +58,15 @@ static uint64_t generateCallbackID()
     return ++callbackID;
 }
 
-PassRefPtr<NetworkProcessProxy> NetworkProcessProxy::create(WebContext& webContext)
+PassRefPtr<NetworkProcessProxy> NetworkProcessProxy::create(WebProcessPool& processPool)
 {
-    return adoptRef(new NetworkProcessProxy(webContext));
+    return adoptRef(new NetworkProcessProxy(processPool));
 }
 
-NetworkProcessProxy::NetworkProcessProxy(WebContext& webContext)
-    : m_webContext(webContext)
+NetworkProcessProxy::NetworkProcessProxy(WebProcessPool& processPool)
+    : m_processPool(processPool)
     , m_numPendingConnectionRequests(0)
-    , m_customProtocolManagerProxy(this, webContext)
+    , m_customProtocolManagerProxy(this, processPool)
 {
     connect();
 }
@@ -112,7 +112,7 @@ DownloadProxy* NetworkProcessProxy::createDownloadProxy(const ResourceRequest& r
     if (!m_downloadProxyMap)
         m_downloadProxyMap = std::make_unique<DownloadProxyMap>(this);
 
-    return m_downloadProxyMap->createDownloadProxy(m_webContext, resourceRequest);
+    return m_downloadProxyMap->createDownloadProxy(m_processPool, resourceRequest);
 }
 
 void NetworkProcessProxy::deleteWebsiteData(WebCore::SessionID sessionID, WebsiteDataTypes dataTypes, std::chrono::system_clock::time_point modifiedSince,  std::function<void ()> completionHandler)
@@ -143,7 +143,7 @@ void NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch()
     m_pendingDeleteWebsiteDataCallbacks.clear();
 
     // Tell the network process manager to forget about this network process proxy. This may cause us to be deleted.
-    m_webContext.networkProcessCrashed(this);
+    m_processPool.networkProcessCrashed(this);
 }
 
 void NetworkProcessProxy::didReceiveMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder)
@@ -151,7 +151,7 @@ void NetworkProcessProxy::didReceiveMessage(IPC::Connection* connection, IPC::Me
     if (dispatchMessage(connection, decoder))
         return;
 
-    if (m_webContext.dispatchMessage(connection, decoder))
+    if (m_processPool.dispatchMessage(connection, decoder))
         return;
 
     didReceiveNetworkProcessProxyMessage(connection, decoder);
@@ -224,7 +224,7 @@ void NetworkProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Con
     m_numPendingConnectionRequests = 0;
 
 #if PLATFORM(COCOA)
-    if (m_webContext.processSuppressionEnabled())
+    if (m_processPool.processSuppressionEnabled())
         setProcessSuppressionEnabled(true);
 #endif
     
index 3e25818..ce7d88f 100644 (file)
@@ -50,12 +50,12 @@ namespace WebKit {
 
 class DownloadProxy;
 class DownloadProxyMap;
-class WebContext;
+class WebProcessPool;
 struct NetworkProcessCreationParameters;
 
 class NetworkProcessProxy : public ChildProcessProxy {
 public:
-    static PassRefPtr<NetworkProcessProxy> create(WebContext&);
+    static PassRefPtr<NetworkProcessProxy> create(WebProcessPool&);
     ~NetworkProcessProxy();
 
     void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>);
@@ -69,7 +69,7 @@ public:
 #endif
 
 private:
-    NetworkProcessProxy(WebContext&);
+    NetworkProcessProxy(WebProcessPool&);
 
     // ChildProcessProxy
     virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
@@ -94,7 +94,7 @@ private:
     // ProcessLauncher::Client
     virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
 
-    WebContext& m_webContext;
+    WebProcessPool& m_processPool;
     
     unsigned m_numPendingConnectionRequests;
     Deque<RefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>> m_pendingConnectionReplies;
index d8071a9..fee4f55 100644 (file)
 #include "APIArray.h"
 #include "APISecurityOrigin.h"
 #include "ImmutableDictionary.h"
-#include "WebContext.h"
 #include "WebNotification.h"
 #include "WebNotificationManagerMessages.h"
 #include "WebPageProxy.h"
+#include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 
 using namespace WebCore;
@@ -50,13 +50,13 @@ const char* WebNotificationManagerProxy::supplementName()
     return "WebNotificationManagerProxy";
 }
 
-PassRefPtr<WebNotificationManagerProxy> WebNotificationManagerProxy::create(WebContext* context)
+PassRefPtr<WebNotificationManagerProxy> WebNotificationManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebNotificationManagerProxy(context));
+    return adoptRef(new WebNotificationManagerProxy(processPool));
 }
 
-WebNotificationManagerProxy::WebNotificationManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
+WebNotificationManagerProxy::WebNotificationManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
 }
 
@@ -68,7 +68,7 @@ void WebNotificationManagerProxy::initializeProvider(const WKNotificationProvide
 
 // WebContextSupplement
 
-void WebNotificationManagerProxy::contextDestroyed()
+void WebNotificationManagerProxy::processPoolDestroyed()
 {
     m_provider.removeNotificationManager(this);
 }
@@ -232,15 +232,15 @@ void WebNotificationManagerProxy::providerDidCloseNotifications(API::Array* glob
 
 void WebNotificationManagerProxy::providerDidUpdateNotificationPolicy(const API::SecurityOrigin* origin, bool allowed)
 {
-    if (!context())
+    if (!processPool())
         return;
 
-    context()->sendToAllProcesses(Messages::WebNotificationManager::DidUpdateNotificationDecision(origin->securityOrigin().toString(), allowed));
+    processPool()->sendToAllProcesses(Messages::WebNotificationManager::DidUpdateNotificationDecision(origin->securityOrigin().toString(), allowed));
 }
 
 void WebNotificationManagerProxy::providerDidRemoveNotificationPolicies(API::Array* origins)
 {
-    if (!context())
+    if (!processPool())
         return;
 
     size_t size = origins->size();
@@ -253,7 +253,7 @@ void WebNotificationManagerProxy::providerDidRemoveNotificationPolicies(API::Arr
     for (size_t i = 0; i < size; ++i)
         originStrings.append(origins->at<API::SecurityOrigin>(i)->securityOrigin().toString());
     
-    context()->sendToAllProcesses(Messages::WebNotificationManager::DidRemoveNotificationDecisions(originStrings));
+    processPool()->sendToAllProcesses(Messages::WebNotificationManager::DidRemoveNotificationDecisions(originStrings));
 }
 
 } // namespace WebKit
index d793388..62a7ec0 100644 (file)
@@ -42,15 +42,15 @@ class SecurityOrigin;
 
 namespace WebKit {
 
-class WebContext;
 class WebPageProxy;
+class WebProcessPool;
 
 class WebNotificationManagerProxy : public API::ObjectImpl<API::Object::Type::NotificationManager>, public WebContextSupplement {
 public:
 
     static const char* supplementName();
 
-    static PassRefPtr<WebNotificationManagerProxy> create(WebContext*);
+    static PassRefPtr<WebNotificationManagerProxy> create(WebProcessPool*);
 
     void initializeProvider(const WKNotificationProviderBase*);
     void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
@@ -71,13 +71,13 @@ public:
     using API::Object::deref;
 
 private:
-    explicit WebNotificationManagerProxy(WebContext*);
+    explicit WebNotificationManagerProxy(WebProcessPool*);
 
     typedef bool (*NotificationFilterFunction)(uint64_t pageID, uint64_t pageNotificationID, uint64_t desiredPageID, const Vector<uint64_t>& desiredPageNotificationIDs);
     void clearNotifications(WebPageProxy*, const Vector<uint64_t>& pageNotificationIDs, NotificationFilterFunction);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void refWebContextSupplement() override;
     virtual void derefWebContextSupplement() override;
 
index 28910fc..9b408f9 100644 (file)
@@ -28,9 +28,9 @@
 
 #include "APIArray.h"
 #include "ImmutableDictionary.h"
-#include "WebContext.h"
 #include "WebContextClient.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
 #include <wtf/CurrentTime.h>
 
 using namespace WebCore;
@@ -39,8 +39,8 @@ static const double plugInAutoStartExpirationTimeThreshold = 30 * 24 * 60 * 60;
 
 namespace WebKit {
 
-PlugInAutoStartProvider::PlugInAutoStartProvider(WebContext* context)
-    : m_context(context)
+PlugInAutoStartProvider::PlugInAutoStartProvider(WebProcessPool* processPool)
+    : m_processPool(processPool)
 {
     m_hashToOriginMap.add(SessionID::defaultSessionID(), HashMap<unsigned, String>());
     m_autoStartTable.add(SessionID::defaultSessionID(), AutoStartTable());
@@ -67,10 +67,10 @@ void PlugInAutoStartProvider::addAutoStartOriginHash(const String& pageOrigin, u
     it->value.set(plugInOriginHash, expirationTime);
     sessionIterator->value.set(plugInOriginHash, pageOrigin);
 
-    m_context->sendToAllProcesses(Messages::WebProcess::DidAddPlugInAutoStartOriginHash(plugInOriginHash, expirationTime, sessionID));
+    m_processPool->sendToAllProcesses(Messages::WebProcess::DidAddPlugInAutoStartOriginHash(plugInOriginHash, expirationTime, sessionID));
 
     if (!sessionID.isEphemeral())
-        m_context->client().plugInAutoStartOriginHashesChanged(m_context);
+        m_processPool->client().plugInAutoStartOriginHashesChanged(m_processPool);
 }
 
 SessionPlugInAutoStartOriginMap PlugInAutoStartProvider::autoStartOriginHashesCopy() const
@@ -154,7 +154,7 @@ void PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest(Immut
             ast.set(strDict.key, hashes);
     }
 
-    m_context->sendToAllProcesses(Messages::WebProcess::ResetPlugInAutoStartOriginDefaultHashes(hashMap));
+    m_processPool->sendToAllProcesses(Messages::WebProcess::ResetPlugInAutoStartOriginDefaultHashes(hashMap));
 }
 
 void PlugInAutoStartProvider::setAutoStartOriginsArray(API::Array& originList)
@@ -184,8 +184,8 @@ void PlugInAutoStartProvider::didReceiveUserInteraction(unsigned plugInOriginHas
 
     double newExpirationTime = expirationTimeFromNow();
     m_autoStartTable.add(sessionID, AutoStartTable()).iterator->value.add(it->value, PlugInAutoStartOriginMap()).iterator->value.set(plugInOriginHash, newExpirationTime);
-    m_context->sendToAllProcesses(Messages::WebProcess::DidAddPlugInAutoStartOriginHash(plugInOriginHash, newExpirationTime, sessionID));
-    m_context->client().plugInAutoStartOriginHashesChanged(m_context);
+    m_processPool->sendToAllProcesses(Messages::WebProcess::DidAddPlugInAutoStartOriginHash(plugInOriginHash, newExpirationTime, sessionID));
+    m_processPool->client().plugInAutoStartOriginHashesChanged(m_processPool);
 }
 
 } // namespace WebKit
index dd34227..2f24460 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef PlugInAutoStartProvider_h
 #define PlugInAutoStartProvider_h
 
-#include <WebCore/SessionIDHash.h>
+#include <WebCore/SessionID.h>
 #include <functional>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
@@ -42,7 +42,7 @@ class Array;
 namespace WebKit {
 
 class ImmutableDictionary;
-class WebContext;
+class WebProcessPool;
 
 typedef HashMap<unsigned, double> PlugInAutoStartOriginMap;
 typedef HashMap<WebCore::SessionID, PlugInAutoStartOriginMap> SessionPlugInAutoStartOriginMap;
@@ -51,7 +51,7 @@ typedef Vector<String> PlugInAutoStartOrigins;
 class PlugInAutoStartProvider {
     WTF_MAKE_NONCOPYABLE(PlugInAutoStartProvider);
 public:
-    explicit PlugInAutoStartProvider(WebContext*);
+    explicit PlugInAutoStartProvider(WebProcessPool*);
 
     void addAutoStartOriginHash(const String& pageOrigin, unsigned plugInOriginHash, WebCore::SessionID);
     void didReceiveUserInteraction(unsigned plugInOriginHash, WebCore::SessionID);
@@ -65,7 +65,7 @@ public:
     const PlugInAutoStartOrigins& autoStartOrigins() const { return m_autoStartOrigins; }
 
 private:
-    WebContext* m_context;
+    WebProcessPool* m_processPool;
 
     void setAutoStartOriginsTableWithItemsPassingTest(ImmutableDictionary&, std::function<bool(double expirationTimestamp)>);
 
index 3fbcc5f..ab9b92d 100644 (file)
@@ -29,7 +29,6 @@
 #if ENABLE(NETSCAPE_PLUGIN_API)
 
 #include "PluginProcessProxy.h"
-#include "WebContext.h"
 #include <wtf/CryptographicallyRandomNumber.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/WTFString.h>
index 2357ee3..e63b4c1 100644 (file)
@@ -32,9 +32,9 @@
 #include "PluginProcessCreationParameters.h"
 #include "PluginProcessManager.h"
 #include "PluginProcessMessages.h"
-#include "WebContext.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebPluginSiteDataManager.h"
+#include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 #include <WebCore/NotImplemented.h>
 #include <wtf/RunLoop.h>
@@ -166,9 +166,9 @@ void PluginProcessProxy::didClose(IPC::Connection*)
         exitFullscreen();
 #endif
 
-    const Vector<WebContext*>& contexts = WebContext::allContexts();
-    for (size_t i = 0; i < contexts.size(); ++i)
-        contexts[i]->sendToAllProcesses(Messages::PluginProcessConnectionManager::PluginProcessCrashed(m_pluginProcessToken));
+    const Vector<WebProcessPool*>& processPools = WebProcessPool::allProcessPools();
+    for (size_t i = 0; i < processPools.size(); ++i)
+        processPools[i]->sendToAllProcesses(Messages::PluginProcessConnectionManager::PluginProcessCrashed(m_pluginProcessToken));
 
     // This will cause us to be deleted.
     pluginProcessCrashedOrFailedToLaunch();
index e8c534c..3498ed5 100644 (file)
@@ -30,8 +30,8 @@
 
 #include "APIArray.h"
 #include "PluginProcessManager.h"
-#include "WebContext.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
 
 using namespace WebCore;
 
@@ -42,7 +42,7 @@ public:
     explicit GetSitesWithDataState(WebPluginSiteDataManager* webPluginSiteDataManager, uint64_t callbackID)
         : m_webPluginSiteDataManager(webPluginSiteDataManager)
         , m_callbackID(callbackID)
-        , m_plugins(webPluginSiteDataManager->m_webContext->pluginInfoStore().plugins())
+        , m_plugins(webPluginSiteDataManager->m_processPool->pluginInfoStore().plugins())
     {
     }
 
@@ -83,7 +83,7 @@ public:
         , m_flags(flags)
         , m_maxAgeInSeconds(maxAgeInSeconds)
         , m_callbackID(callbackID)
-        , m_plugins(webPluginSiteDataManager->m_webContext->pluginInfoStore().plugins())
+        , m_plugins(webPluginSiteDataManager->m_processPool->pluginInfoStore().plugins())
     {
     }
 
@@ -112,13 +112,13 @@ private:
     Vector<PluginModuleInfo> m_plugins;
 };
 
-PassRefPtr<WebPluginSiteDataManager> WebPluginSiteDataManager::create(WebContext* webContext)
+PassRefPtr<WebPluginSiteDataManager> WebPluginSiteDataManager::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebPluginSiteDataManager(webContext));
+    return adoptRef(new WebPluginSiteDataManager(processPool));
 }
 
-WebPluginSiteDataManager::WebPluginSiteDataManager(WebContext* webContext)
-    : m_webContext(webContext)
+WebPluginSiteDataManager::WebPluginSiteDataManager(WebProcessPool* processPool)
+    : m_processPool(processPool)
 {
 }
 
@@ -142,7 +142,7 @@ void WebPluginSiteDataManager::getSitesWithData(std::function<void (API::Array*,
 {
     RefPtr<ArrayCallback> callback = ArrayCallback::create(WTF::move(callbackFunction));
 
-    if (!m_webContext) {
+    if (!m_processPool) {
         callback->invalidate();
         return;
     }
@@ -171,7 +171,7 @@ void WebPluginSiteDataManager::didGetSitesWithData(const Vector<String>& sites,
 void WebPluginSiteDataManager::clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, std::function<void (CallbackBase::Error)> callbackFunction)
 {
     RefPtr<VoidCallback> callback = VoidCallback::create(WTF::move(callbackFunction));
-    if (!m_webContext) {
+    if (!m_processPool) {
         // FIXME: If the context is invalid we should not call the callback. It'd be better to just return false from clearSiteData.
         callback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
         return;
index 3428041..f00be96 100644 (file)
 
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 class WebProcessProxy;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
 
 class WebPluginSiteDataManager : public API::ObjectImpl<API::Object::Type::PluginSiteDataManager> {
 public:
-    static PassRefPtr<WebPluginSiteDataManager> create(WebContext*);
+    static PassRefPtr<WebPluginSiteDataManager> create(WebProcessPool*);
     virtual ~WebPluginSiteDataManager();
 
     void invalidate();
-    void clearContext() { m_webContext = 0; }
+    void clearProcessPool() { m_processPool = nullptr; }
 
     void getSitesWithData(std::function<void (API::Array*, CallbackBase::Error)>);
     void didGetSitesWithData(const Vector<String>& sites, uint64_t callbackID);
@@ -60,9 +60,9 @@ public:
     void didClearSiteDataForSinglePlugin(uint64_t callbackID);    
 
 private:
-    explicit WebPluginSiteDataManager(WebContext*);
+    explicit WebPluginSiteDataManager(WebProcessPool*);
 
-    WebContext* m_webContext;
+    WebProcessPool* m_processPool;
     HashMap<uint64_t, RefPtr<ArrayCallback>> m_arrayCallbacks;
     HashMap<uint64_t, RefPtr<VoidCallback>> m_voidCallbacks;
 
index 495be8d..f724e22 100644 (file)
@@ -30,8 +30,9 @@
 #include "VisitedLinkProviderMessages.h"
 #include "VisitedLinkTable.h"
 #include "VisitedLinkTableControllerMessages.h"
-#include "WebContext.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
+#include "WebProcessProxy.h"
 
 using namespace WebCore;
 
@@ -99,7 +100,7 @@ void VisitedLinkProvider::removeAll()
     m_table.clear();
 
     for (WebProcessProxy* process : m_processes) {
-        ASSERT(process->context().processes().contains(process));
+        ASSERT(process->processPool().processes().contains(process));
         process->connection()->send(Messages::VisitedLinkTableController::RemoveAllVisitedLinks(), m_identifier);
     }
 }
@@ -178,7 +179,7 @@ void VisitedLinkProvider::pendingVisitedLinksTimerFired()
         return;
 
     for (WebProcessProxy* process : m_processes) {
-        ASSERT(process->context().processes().contains(process));
+        ASSERT(process->processPool().processes().contains(process));
 
         if (addedVisitedLinks.size() > 20)
             process->connection()->send(Messages::VisitedLinkTableController::AllVisitedLinkStateChanged(), m_identifier);
@@ -234,7 +235,7 @@ void VisitedLinkProvider::resizeTable(unsigned newTableSize)
 
 void VisitedLinkProvider::sendTable(WebProcessProxy& process)
 {
-    ASSERT(process.context().processes().contains(&process));
+    ASSERT(process.processPool().processes().contains(&process));
 
     SharedMemory::Handle handle;
     if (!m_table.sharedMemory()->createHandle(handle, SharedMemory::ReadOnly))
index 5bbb25c..136b200 100644 (file)
@@ -36,7 +36,6 @@
 
 namespace WebKit {
 
-class WebContext;
 class WebPageProxy;
 class WebProcessProxy;
     
index 6229d63..133613e 100644 (file)
@@ -30,7 +30,7 @@
 #include "SecurityOriginData.h"
 #include "WebApplicationCacheManagerMessages.h"
 #include "WebApplicationCacheManagerProxyMessages.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 
 namespace WebKit {
 
@@ -39,15 +39,15 @@ const char* WebApplicationCacheManagerProxy::supplementName()
     return "WebApplicationCacheManagerProxy";
 }
 
-PassRefPtr<WebApplicationCacheManagerProxy> WebApplicationCacheManagerProxy::create(WebContext* context)
+PassRefPtr<WebApplicationCacheManagerProxy> WebApplicationCacheManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebApplicationCacheManagerProxy(context));
+    return adoptRef(new WebApplicationCacheManagerProxy(processPool));
 }
 
-WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
+WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
-    context->addMessageReceiver(Messages::WebApplicationCacheManagerProxy::messageReceiverName(), *this);
+    processPool->addMessageReceiver(Messages::WebApplicationCacheManagerProxy::messageReceiverName(), *this);
 }
 
 WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy()
@@ -55,7 +55,7 @@ WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy()
 }
 
 
-void WebApplicationCacheManagerProxy::contextDestroyed()
+void WebApplicationCacheManagerProxy::processPoolDestroyed()
 {
     invalidateCallbackMap(m_arrayCallbacks, CallbackBase::Error::OwnerWasInvalidated);
 }
@@ -84,7 +84,7 @@ void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(std::function<v
 {
     RefPtr<ArrayCallback> callback = ArrayCallback::create(WTF::move(callbackFunction));
 
-    if (!context()) {
+    if (!processPool()) {
         callback->invalidate();
         return;
     }
@@ -93,7 +93,7 @@ void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(std::function<v
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::GetApplicationCacheOrigins(callbackID));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::GetApplicationCacheOrigins(callbackID));
 }
     
 void WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins(const Vector<SecurityOriginData>& originDatas, uint64_t callbackID)
@@ -104,7 +104,7 @@ void WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins(const Vector
 
 void WebApplicationCacheManagerProxy::deleteEntriesForOrigin(API::SecurityOrigin* origin)
 {
-    if (!context())
+    if (!processPool())
         return;
 
     SecurityOriginData securityOriginData;
@@ -113,16 +113,16 @@ void WebApplicationCacheManagerProxy::deleteEntriesForOrigin(API::SecurityOrigin
     securityOriginData.port = origin->securityOrigin().port();
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteEntriesForOrigin(securityOriginData));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteEntriesForOrigin(securityOriginData));
 }
 
 void WebApplicationCacheManagerProxy::deleteAllEntries()
 {
-    if (!context())
+    if (!processPool())
         return;
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteAllEntries());
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteAllEntries());
 }
 
 } // namespace WebKit
index e1f6466..5aeedf6 100644 (file)
@@ -40,6 +40,7 @@ class Connection;
 
 namespace WebKit {
 
+class WebProcessPool;
 struct SecurityOriginData;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
@@ -48,7 +49,7 @@ class WebApplicationCacheManagerProxy : public API::ObjectImpl<API::Object::Type
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebApplicationCacheManagerProxy> create(WebContext*);
+    static PassRefPtr<WebApplicationCacheManagerProxy> create(WebProcessPool*);
     virtual ~WebApplicationCacheManagerProxy();
 
     void getApplicationCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
@@ -59,12 +60,12 @@ public:
     using API::Object::deref;
 
 private:
-    explicit WebApplicationCacheManagerProxy(WebContext*);
+    explicit WebApplicationCacheManagerProxy(WebProcessPool*);
 
     void didGetApplicationCacheOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual bool shouldTerminate(WebProcessProxy*) const override;
     virtual void refWebContextSupplement() override;
index 60b49d6..46b36d1 100644 (file)
 #include "WebContextClient.h"
 
 #include "APIArray.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 
 namespace WebKit {
 
-void WebContextClient::plugInAutoStartOriginHashesChanged(WebContext* context)
+void WebContextClient::plugInAutoStartOriginHashesChanged(WebProcessPool* processPool)
 {
     if (!m_client.plugInAutoStartOriginHashesChanged)
         return;
 
-    m_client.plugInAutoStartOriginHashesChanged(toAPI(context), m_client.base.clientInfo);
+    m_client.plugInAutoStartOriginHashesChanged(toAPI(processPool), m_client.base.clientInfo);
 }
 
-void WebContextClient::networkProcessDidCrash(WebContext* context)
+void WebContextClient::networkProcessDidCrash(WebProcessPool* processPool)
 {
     if (!m_client.networkProcessDidCrash)
         return;
 
-    m_client.networkProcessDidCrash(toAPI(context), m_client.base.clientInfo);
+    m_client.networkProcessDidCrash(toAPI(processPool), m_client.base.clientInfo);
 }
 
-void WebContextClient::plugInInformationBecameAvailable(WebContext* context, API::Array* plugInInfo)
+void WebContextClient::plugInInformationBecameAvailable(WebProcessPool* processPool, API::Array* plugInInfo)
 {
     if (!m_client.plugInInformationBecameAvailable)
         return;
@@ -55,15 +55,15 @@ void WebContextClient::plugInInformationBecameAvailable(WebContext* context, API
     // FIXME: The API contract expects us to hand a reference to the array here. This is wrong.
     plugInInfo->ref();
 
-    m_client.plugInInformationBecameAvailable(toAPI(context), toAPI(plugInInfo), m_client.base.clientInfo);
+    m_client.plugInInformationBecameAvailable(toAPI(processPool), toAPI(plugInInfo), m_client.base.clientInfo);
 }
 
-PassRefPtr<API::Data> WebContextClient::copyWebCryptoMasterKey(WebContext* context)
+PassRefPtr<API::Data> WebContextClient::copyWebCryptoMasterKey(WebProcessPool* processPool)
 {
     if (!m_client.copyWebCryptoMasterKey)
         return nullptr;
 
-    return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(context), m_client.base.clientInfo)));
+    return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(processPool), m_client.base.clientInfo)));
 }
 
 } // namespace WebKit
index fe172db..44d43cd 100644 (file)
@@ -38,16 +38,17 @@ template<> struct ClientTraits<WKContextClientBase> {
 };
 }
 
+
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 
 class WebContextClient : public API::Client<WKContextClientBase> {
 public:
-    void plugInAutoStartOriginHashesChanged(WebContext*);
-    void networkProcessDidCrash(WebContext*);
-    void plugInInformationBecameAvailable(WebContext*, API::Array*);
-    PassRefPtr<API::Data> copyWebCryptoMasterKey(WebContext*);
+    void plugInAutoStartOriginHashesChanged(WebProcessPool*);
+    void networkProcessDidCrash(WebProcessPool*);
+    void plugInInformationBecameAvailable(WebProcessPool*, API::Array*);
+    PassRefPtr<API::Data> copyWebCryptoMasterKey(WebProcessPool*);
 };
 
 } // namespace WebKit
index 51cf3ee..3b47d0e 100644 (file)
 #include "WebContextConnectionClient.h"
 
 #include "WKAPICast.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 
 namespace WebKit {
 
-void WebContextConnectionClient::didCreateConnection(WebContext* context, WebConnection* connection)
+void WebContextConnectionClient::didCreateConnection(WebProcessPool* processPool, WebConnection* connection)
 {
     if (!m_client.didCreateConnection)
         return;
 
-    m_client.didCreateConnection(toAPI(context), toAPI(connection), m_client.base.clientInfo);
+    m_client.didCreateConnection(toAPI(processPool), toAPI(connection), m_client.base.clientInfo);
 }
 
 } // namespace WebKit
index 11e1ccf..23bddf0 100644 (file)
@@ -38,11 +38,11 @@ template<> struct ClientTraits<WKContextConnectionClientBase> {
 namespace WebKit {
 
 class WebConnection;
-class WebContext;
+class WebProcessPool;
 
 class WebContextConnectionClient : public API::Client<WKContextConnectionClientBase> {
 public:
-    void didCreateConnection(WebContext*, WebConnection*);
+    void didCreateConnection(WebProcessPool*, WebConnection*);
 };
 
 } // namespace WebKit
index 7e0281c..1d1555a 100644 (file)
 #include "WebContextInjectedBundleClient.h"
 
 #include "WKAPICast.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 #include <wtf/text/WTFString.h>
 
 using namespace WebCore;
 
 namespace WebKit {
 
-void WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle(WebContext* context, const String& messageName, API::Object* messageBody)
+void WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle(WebProcessPool* processPool, const String& messageName, API::Object* messageBody)
 {
     if (!m_client.didReceiveMessageFromInjectedBundle)
         return;
 
-    m_client.didReceiveMessageFromInjectedBundle(toAPI(context), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
+    m_client.didReceiveMessageFromInjectedBundle(toAPI(processPool), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
 }
 
-void WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle(WebContext* context, const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
+void WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle(WebProcessPool* processPool, const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
 {
     if (!m_client.didReceiveSynchronousMessageFromInjectedBundle)
         return;
 
     WKTypeRef returnDataRef = 0;
-    m_client.didReceiveSynchronousMessageFromInjectedBundle(toAPI(context), toAPI(messageName.impl()), toAPI(messageBody), &returnDataRef, m_client.base.clientInfo);
+    m_client.didReceiveSynchronousMessageFromInjectedBundle(toAPI(processPool), toAPI(messageName.impl()), toAPI(messageBody), &returnDataRef, m_client.base.clientInfo);
     returnData = adoptRef(toImpl(returnDataRef));
 }
 
-PassRefPtr<API::Object> WebContextInjectedBundleClient::getInjectedBundleInitializationUserData(WebContext* context)
+PassRefPtr<API::Object> WebContextInjectedBundleClient::getInjectedBundleInitializationUserData(WebProcessPool* processPool)
 {
     if (!m_client.getInjectedBundleInitializationUserData)
         return 0;
 
-    return toImpl(m_client.getInjectedBundleInitializationUserData(toAPI(context), m_client.base.clientInfo));
+    return toImpl(m_client.getInjectedBundleInitializationUserData(toAPI(processPool), m_client.base.clientInfo));
 }
 
 } // namespace WebKit
index f24c66f..c934fe8 100644 (file)
@@ -40,13 +40,13 @@ template<> struct ClientTraits<WKContextInjectedBundleClientBase> {
 
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 
 class WebContextInjectedBundleClient : public API::Client<WKContextInjectedBundleClientBase> {
 public:
-    void didReceiveMessageFromInjectedBundle(WebContext*, const String&, API::Object*);
-    void didReceiveSynchronousMessageFromInjectedBundle(WebContext*, const String&, API::Object*, RefPtr<API::Object>& returnData);
-    PassRefPtr<API::Object> getInjectedBundleInitializationUserData(WebContext*);
+    void didReceiveMessageFromInjectedBundle(WebProcessPool*, const String&, API::Object*);
+    void didReceiveSynchronousMessageFromInjectedBundle(WebProcessPool*, const String&, API::Object*, RefPtr<API::Object>& returnData);
+    PassRefPtr<API::Object> getInjectedBundleInitializationUserData(WebProcessPool*);
 };
 
 } // namespace WebKit
index cf5af0a..b7448d7 100644 (file)
@@ -30,13 +30,13 @@ namespace WebKit {
 
 class DatabaseProcessProxy;
 class NetworkProcessProxy;
-class WebContext;
+class WebProcessPool;
 class WebProcessProxy;
 
 class WebContextSupplement {
 public:
-    WebContextSupplement(WebContext* context)
-        : m_context(context)
+    WebContextSupplement(WebProcessPool* processPool)
+        : m_processPool(processPool)
     {
     }
 
@@ -44,7 +44,7 @@ public:
     {
     }
 
-    virtual void contextDestroyed()
+    virtual void processPoolDestroyed()
     {
     }
 
@@ -65,8 +65,8 @@ public:
         return true;
     }
 
-    WebContext* context() const { return m_context; }
-    void clearContext() { m_context = 0; }
+    WebProcessPool* processPool() const { return m_processPool; }
+    void clearProcessPool() { m_processPool = nullptr; }
 
     void ref() { refWebContextSupplement(); }
     void deref() { derefWebContextSupplement(); }
@@ -75,7 +75,7 @@ private:
     virtual void refWebContextSupplement() = 0;
     virtual void derefWebContextSupplement() = 0;
 
-    WebContext* m_context;
+    WebProcessPool* m_processPool;
 };
 
 } // namespace WebKit
index 0c3bb29..1f145bd 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include "UserMessageCoders.h"
-#include "WebContext.h"
 #include "WebFrameProxy.h"
 #include "WebPageGroup.h"
 #include "WebPageGroupData.h"
index 36318ba..5c96627 100644 (file)
@@ -29,9 +29,9 @@
 #include "APIArray.h"
 #include "APISecurityOrigin.h"
 #include "SecurityOriginData.h"
-#include "WebContext.h"
 #include "WebCookieManagerMessages.h"
 #include "WebCookieManagerProxyMessages.h"
+#include "WebProcessPool.h"
 
 namespace WebKit {
 
@@ -40,18 +40,18 @@ const char* WebCookieManagerProxy::supplementName()
     return "WebCookieManagerProxy";
 }
 
-PassRefPtr<WebCookieManagerProxy> WebCookieManagerProxy::create(WebContext* context)
+PassRefPtr<WebCookieManagerProxy> WebCookieManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebCookieManagerProxy(context));
+    return adoptRef(new WebCookieManagerProxy(processPool));
 }
 
-WebCookieManagerProxy::WebCookieManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
+WebCookieManagerProxy::WebCookieManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 #if USE(SOUP)
     , m_cookiePersistentStorageType(SoupCookiePersistentStorageSQLite)
 #endif
 {
-    WebContextSupplement::context()->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), *this);
+    WebContextSupplement::processPool()->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), *this);
 }
 
 WebCookieManagerProxy::~WebCookieManagerProxy()
@@ -65,7 +65,7 @@ void WebCookieManagerProxy::initializeClient(const WKCookieManagerClientBase* cl
 
 // WebContextSupplement
 
-void WebCookieManagerProxy::contextDestroyed()
+void WebCookieManagerProxy::processPoolDestroyed()
 {
     invalidateCallbackMap(m_arrayCallbacks, CallbackBase::Error::OwnerWasInvalidated);
     invalidateCallbackMap(m_httpCookieAcceptPolicyCallbacks, CallbackBase::Error::OwnerWasInvalidated);
@@ -85,7 +85,7 @@ void WebCookieManagerProxy::processDidClose(NetworkProcessProxy*)
 
 bool WebCookieManagerProxy::shouldTerminate(WebProcessProxy*) const
 {
-    return context()->processModel() != ProcessModelSharedSecondaryProcess
+    return processPool()->processModel() != ProcessModelSharedSecondaryProcess
         || (m_arrayCallbacks.isEmpty() && m_httpCookieAcceptPolicyCallbacks.isEmpty());
 }
 
@@ -105,7 +105,7 @@ void WebCookieManagerProxy::getHostnamesWithCookies(std::function<void (API::Arr
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHostnamesWithCookies(callbackID));
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHostnamesWithCookies(callbackID));
 }
     
 void WebCookieManagerProxy::didGetHostnamesWithCookies(const Vector<String>& hostnames, uint64_t callbackID)
@@ -121,27 +121,27 @@ void WebCookieManagerProxy::didGetHostnamesWithCookies(const Vector<String>& hos
 
 void WebCookieManagerProxy::deleteCookiesForHostname(const String& hostname)
 {
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteCookiesForHostname(hostname));
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteCookiesForHostname(hostname));
 }
 
 void WebCookieManagerProxy::deleteAllCookies()
 {
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookies());
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookies());
 }
 
 void WebCookieManagerProxy::deleteAllCookiesModifiedSince(std::chrono::system_clock::time_point time)
 {
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookiesModifiedSince(time));
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookiesModifiedSince(time));
 }
 
 void WebCookieManagerProxy::startObservingCookieChanges()
 {
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StartObservingCookieChanges());
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StartObservingCookieChanges());
 }
 
 void WebCookieManagerProxy::stopObservingCookieChanges()
 {
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StopObservingCookieChanges());
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StopObservingCookieChanges());
 }
 
 void WebCookieManagerProxy::cookiesDidChange()
@@ -155,10 +155,10 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy pol
     persistHTTPCookieAcceptPolicy(policy);
 #endif
 #if USE(SOUP)
-    context()->setInitialHTTPCookieAcceptPolicy(policy);
+    processPool()->setInitialHTTPCookieAcceptPolicy(policy);
 #endif
 
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
 }
 
 void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(std::function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)> callbackFunction)
@@ -168,7 +168,7 @@ void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(std::function<void (HTTPCo
     uint64_t callbackID = callback->callbackID();
     m_httpCookieAcceptPolicyCallbacks.set(callbackID, callback.release());
 
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID));
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID));
 }
 
 void WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID)
index dd6ce54..b86cbcb 100644 (file)
@@ -43,9 +43,10 @@ namespace API {
 class Array;
 }
 
+
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 class WebProcessProxy;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
@@ -55,7 +56,7 @@ class WebCookieManagerProxy : public API::ObjectImpl<API::Object::Type::CookieMa
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebCookieManagerProxy> create(WebContext*);
+    static PassRefPtr<WebCookieManagerProxy> create(WebProcessPool*);
     virtual ~WebCookieManagerProxy();
 
     void initializeClient(const WKCookieManagerClientBase*);
@@ -80,7 +81,7 @@ public:
     using API::Object::deref;
 
 private:
-    WebCookieManagerProxy(WebContext*);
+    WebCookieManagerProxy(WebProcessPool*);
 
     void didGetHostnamesWithCookies(const Vector<String>&, uint64_t callbackID);
     void didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID);
@@ -88,7 +89,7 @@ private:
     void cookiesDidChange();
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual void processDidClose(NetworkProcessProxy*) override;
     virtual bool shouldTerminate(WebProcessProxy*) const override;
index 19ff33b..2d37e5f 100644 (file)
@@ -31,9 +31,9 @@
 #include "APIArray.h"
 #include "APISecurityOrigin.h"
 #include "ImmutableDictionary.h"
-#include "WebContext.h"
 #include "WebDatabaseManagerMessages.h"
 #include "WebDatabaseManagerProxyMessages.h"
+#include "WebProcessPool.h"
 #include <wtf/NeverDestroyed.h>
 
 using namespace WebCore;
@@ -105,15 +105,15 @@ String WebDatabaseManagerProxy::databaseDetailsModificationTimeKey()
     return key;
 }
 
-PassRefPtr<WebDatabaseManagerProxy> WebDatabaseManagerProxy::create(WebContext* webContext)
+PassRefPtr<WebDatabaseManagerProxy> WebDatabaseManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebDatabaseManagerProxy(webContext));
+    return adoptRef(new WebDatabaseManagerProxy(processPool));
 }
 
-WebDatabaseManagerProxy::WebDatabaseManagerProxy(WebContext* webContext)
-    : WebContextSupplement(webContext)
+WebDatabaseManagerProxy::WebDatabaseManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
-    WebContextSupplement::context()->addMessageReceiver(Messages::WebDatabaseManagerProxy::messageReceiverName(), *this);
+    WebContextSupplement::processPool()->addMessageReceiver(Messages::WebDatabaseManagerProxy::messageReceiverName(), *this);
 }
 
 WebDatabaseManagerProxy::~WebDatabaseManagerProxy()
@@ -127,7 +127,7 @@ void WebDatabaseManagerProxy::initializeClient(const WKDatabaseManagerClientBase
 
 // WebContextSupplement
 
-void WebDatabaseManagerProxy::contextDestroyed()
+void WebDatabaseManagerProxy::processPoolDestroyed()
 {
     invalidateCallbackMap(m_arrayCallbacks, CallbackBase::Error::OwnerWasInvalidated);
 }
@@ -158,7 +158,7 @@ void WebDatabaseManagerProxy::getDatabasesByOrigin(std::function<void (API::Arra
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
-    context()->sendToOneProcess(Messages::WebDatabaseManager::GetDatabasesByOrigin(callbackID));
+    processPool()->sendToOneProcess(Messages::WebDatabaseManager::GetDatabasesByOrigin(callbackID));
 }
 
 void WebDatabaseManagerProxy::didGetDatabasesByOrigin(const Vector<OriginAndDatabases>& originAndDatabasesVector, uint64_t callbackID)
@@ -211,7 +211,7 @@ void WebDatabaseManagerProxy::getDatabaseOrigins(std::function<void (API::Array*
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
-    context()->sendToOneProcess(Messages::WebDatabaseManager::GetDatabaseOrigins(callbackID));
+    processPool()->sendToOneProcess(Messages::WebDatabaseManager::GetDatabaseOrigins(callbackID));
 }
 
 void WebDatabaseManagerProxy::didGetDatabaseOrigins(const Vector<String>& originIdentifiers, uint64_t callbackID)
@@ -233,22 +233,22 @@ void WebDatabaseManagerProxy::didGetDatabaseOrigins(const Vector<String>& origin
 
 void WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, API::SecurityOrigin* origin)
 {
-    context()->sendToOneProcess(Messages::WebDatabaseManager::DeleteDatabaseWithNameForOrigin(databaseIdentifier, origin->securityOrigin().databaseIdentifier()));
+    processPool()->sendToOneProcess(Messages::WebDatabaseManager::DeleteDatabaseWithNameForOrigin(databaseIdentifier, origin->securityOrigin().databaseIdentifier()));
 }
 
 void WebDatabaseManagerProxy::deleteDatabasesForOrigin(API::SecurityOrigin* origin)
 {
-    context()->sendToOneProcess(Messages::WebDatabaseManager::DeleteDatabasesForOrigin(origin->securityOrigin().databaseIdentifier()));
+    processPool()->sendToOneProcess(Messages::WebDatabaseManager::DeleteDatabasesForOrigin(origin->securityOrigin().databaseIdentifier()));
 }
 
 void WebDatabaseManagerProxy::deleteAllDatabases()
 {
-    context()->sendToOneProcess(Messages::WebDatabaseManager::DeleteAllDatabases());
+    processPool()->sendToOneProcess(Messages::WebDatabaseManager::DeleteAllDatabases());
 }
 
 void WebDatabaseManagerProxy::setQuotaForOrigin(API::SecurityOrigin* origin, uint64_t quota)
 {
-    context()->sendToOneProcess(Messages::WebDatabaseManager::SetQuotaForOrigin(origin->securityOrigin().databaseIdentifier(), quota));
+    processPool()->sendToOneProcess(Messages::WebDatabaseManager::SetQuotaForOrigin(origin->securityOrigin().databaseIdentifier(), quota));
 }
 
 void WebDatabaseManagerProxy::didModifyOrigin(const String& originIdentifier)
index fb2b09c..dc0e6f3 100644 (file)
@@ -40,7 +40,7 @@
 
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 class WebProcessProxy;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
@@ -49,7 +49,7 @@ class WebDatabaseManagerProxy : public API::ObjectImpl<API::Object::Type::Databa
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebDatabaseManagerProxy> create(WebContext*);
+    static PassRefPtr<WebDatabaseManagerProxy> create(WebProcessPool*);
     virtual ~WebDatabaseManagerProxy();
 
     void initializeClient(const WKDatabaseManagerClientBase*);
@@ -76,10 +76,10 @@ public:
     using API::Object::deref;
 
 private:
-    explicit WebDatabaseManagerProxy(WebContext*);
+    explicit WebDatabaseManagerProxy(WebProcessPool*);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual bool shouldTerminate(WebProcessProxy*) const override;
     virtual void refWebContextSupplement() override;
index b260a0d..44869f8 100644 (file)
 #include "WebFrameProxy.h"
 
 #include "WebCertificateInfo.h"
-#include "WebContext.h"
 #include "WebFormSubmissionListenerProxy.h"
 #include "WebFramePolicyListenerProxy.h"
 #include "WebPageMessages.h"
 #include "WebPageProxy.h"
+#include "WebProcessPool.h"
 #include <WebCore/DOMImplementation.h>
 #include <WebCore/Image.h>
 #include <WebCore/MIMETypeRegistry.h>
@@ -47,12 +47,12 @@ WebFrameProxy::WebFrameProxy(WebPageProxy* page, uint64_t frameID)
     , m_isFrameSet(false)
     , m_frameID(frameID)
 {
-    WebContext::statistics().wkFrameCount++;
+    WebProcessPool::statistics().wkFrameCount++;
 }
 
 WebFrameProxy::~WebFrameProxy()
 {
-    WebContext::statistics().wkFrameCount--;
+    WebProcessPool::statistics().wkFrameCount--;
 }
 
 void WebFrameProxy::disconnect()
index a420b90..2bd9f27 100644 (file)
@@ -26,9 +26,9 @@
 #include "config.h"
 #include "WebGeolocationManagerProxy.h"
 
-#include "WebContext.h"
 #include "WebGeolocationManagerMessages.h"
 #include "WebGeolocationManagerProxyMessages.h"
+#include "WebProcessPool.h"
 
 namespace WebKit {
 
@@ -37,15 +37,15 @@ const char* WebGeolocationManagerProxy::supplementName()
     return "WebGeolocationManagerProxy";
 }
 
-PassRefPtr<WebGeolocationManagerProxy> WebGeolocationManagerProxy::create(WebContext* context)
+PassRefPtr<WebGeolocationManagerProxy> WebGeolocationManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebGeolocationManagerProxy(context));
+    return adoptRef(new WebGeolocationManagerProxy(processPool));
 }
 
-WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
+WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
-    WebContextSupplement::context()->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), *this);
+    WebContextSupplement::processPool()->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), *this);
 }
 
 void WebGeolocationManagerProxy::initializeProvider(const WKGeolocationProviderBase* provider)
@@ -55,7 +55,7 @@ void WebGeolocationManagerProxy::initializeProvider(const WKGeolocationProviderB
 
 // WebContextSupplement
 
-void WebGeolocationManagerProxy::contextDestroyed()
+void WebGeolocationManagerProxy::processPoolDestroyed()
 {
     m_updateRequesters.clear();
     m_provider.stopUpdating(this);
@@ -78,24 +78,24 @@ void WebGeolocationManagerProxy::derefWebContextSupplement()
 
 void WebGeolocationManagerProxy::providerDidChangePosition(WebGeolocationPosition* position)
 {
-    if (!context())
+    if (!processPool())
         return;
 
-    context()->sendToAllProcesses(Messages::WebGeolocationManager::DidChangePosition(position->data()));
+    processPool()->sendToAllProcesses(Messages::WebGeolocationManager::DidChangePosition(position->data()));
 }
 
 void WebGeolocationManagerProxy::providerDidFailToDeterminePosition(const String& errorMessage)
 {
-    if (!context())
+    if (!processPool())
         return;
 
-    context()->sendToAllProcesses(Messages::WebGeolocationManager::DidFailToDeterminePosition(errorMessage));
+    processPool()->sendToAllProcesses(Messages::WebGeolocationManager::DidFailToDeterminePosition(errorMessage));
 }
 
 #if PLATFORM(IOS)
 void WebGeolocationManagerProxy::resetPermissions()
 {
-    context()->sendToAllProcesses(Messages::WebGeolocationManager::ResetPermissions());
+    processPool()->sendToAllProcesses(Messages::WebGeolocationManager::ResetPermissions());
 }
 #endif
 
index 5668f91..775a17e 100644 (file)
 
 namespace WebKit {
 
-class WebContext;
 class WebGeolocationPosition;
+class WebProcessPool;
 
 class WebGeolocationManagerProxy : public API::ObjectImpl<API::Object::Type::GeolocationManager>, public WebContextSupplement, private IPC::MessageReceiver {
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebGeolocationManagerProxy> create(WebContext*);
+    static PassRefPtr<WebGeolocationManagerProxy> create(WebProcessPool*);
 
     void initializeProvider(const WKGeolocationProviderBase*);
 
@@ -57,10 +57,10 @@ public:
     using API::Object::deref;
 
 private:
-    explicit WebGeolocationManagerProxy(WebContext*);
+    explicit WebGeolocationManagerProxy(WebProcessPool*);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual void refWebContextSupplement() override;
     virtual void derefWebContextSupplement() override;
index b8d1c49..b05ae5c 100644 (file)
@@ -27,9 +27,9 @@
 #include "WebIconDatabase.h"
 
 #include "Logging.h"
-#include "WebContext.h"
 #include "WebIconDatabaseMessages.h"
 #include "WebIconDatabaseProxyMessages.h"
+#include "WebProcessPool.h"
 #include <WebCore/FileSystem.h>
 #include <WebCore/IconDatabase.h>
 #include <WebCore/Image.h>
@@ -39,22 +39,22 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassRefPtr<WebIconDatabase> WebIconDatabase::create(WebContext* context)
+PassRefPtr<WebIconDatabase> WebIconDatabase::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebIconDatabase(*context));
+    return adoptRef(new WebIconDatabase(*processPool));
 }
 
 WebIconDatabase::~WebIconDatabase()
 {
 }
 
-WebIconDatabase::WebIconDatabase(WebContext& context)
-    : m_webContext(&context)
+WebIconDatabase::WebIconDatabase(WebProcessPool& processPool)
+    : m_processPool(&processPool)
     , m_urlImportCompleted(false)
     , m_databaseCleanupDisabled(false)
     , m_shouldDerefWhenAppropriate(false)
 {
-    m_webContext->addMessageReceiver(Messages::WebIconDatabase::messageReceiverName(), *this);
+    m_processPool->addMessageReceiver(Messages::WebIconDatabase::messageReceiverName(), *this);
 }
 
 void WebIconDatabase::invalidate()
@@ -75,7 +75,7 @@ void WebIconDatabase::setDatabasePath(const String& path)
     m_databaseCleanupDisabled = true;
     m_iconDatabaseImpl->setEnabled(true);
 
-    // FIXME: WebIconDatabases are per-WebContext but WebContext's don't have their own notion of the current private browsing setting.
+    // FIXME: WebIconDatabases are per-ProcessPool but ProcessPools's don't have their own notion of the current private browsing setting.
     // As we clean up private browsing throughout the stack we need to clean it up here.
     m_iconDatabaseImpl->setPrivateBrowsingEnabled(WebPreferences::anyPagesAreUsingPrivateBrowsing());
 
@@ -161,12 +161,12 @@ void WebIconDatabase::getLoadDecisionForIconURL(const String& iconURL, uint64_t
 {
     LOG(IconDatabase, "WK2 UIProcess getting load decision for icon URL %s with callback ID %lli", iconURL.ascii().data(), static_cast<long long>(callbackID));
 
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
     if (!m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || iconURL.isEmpty()) {
         // FIXME (Multi-WebProcess): <rdar://problem/12240223> We need to know which connection to send this message to.
-        m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(IconLoadNo), callbackID));
+        m_processPool->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(IconLoadNo), callbackID));
         return;
     }
     
@@ -181,7 +181,7 @@ void WebIconDatabase::getLoadDecisionForIconURL(const String& iconURL, uint64_t
     }
 
     // FIXME (Multi-WebProcess): <rdar://problem/12240223> We need to know which connection to send this message to.
-    m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision((int)decision, callbackID));
+    m_processPool->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision((int)decision, callbackID));
 }
 
 void WebIconDatabase::didReceiveIconForPageURL(const String& pageURL)
@@ -191,7 +191,7 @@ void WebIconDatabase::didReceiveIconForPageURL(const String& pageURL)
 
 Image* WebIconDatabase::imageForPageURL(const String& pageURL, const IntSize& iconSize)
 {
-    if (!m_webContext || !m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty())
+    if (!m_processPool || !m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty())
         return nullptr;
 
     // The WebCore IconDatabase ignores the passed in size parameter.
@@ -201,7 +201,7 @@ Image* WebIconDatabase::imageForPageURL(const String& pageURL, const IntSize& ic
 
 NativeImagePtr WebIconDatabase::nativeImageForPageURL(const String& pageURL, const IntSize& iconSize)
 {
-    if (!m_webContext || !m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty())
+    if (!m_processPool || !m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty())
         return nullptr;
 
     return m_iconDatabaseImpl->synchronousNativeIconForPageURL(pageURL, iconSize);
@@ -262,7 +262,7 @@ void WebIconDatabase::didRemoveAllIcons()
 
 void WebIconDatabase::didFinishURLImport()
 {
-    if (!m_webContext)
+    if (!m_processPool)
         return;
 
     ASSERT(!m_urlImportCompleted);
@@ -277,7 +277,7 @@ void WebIconDatabase::didFinishURLImport()
         ASSERT(decision != IconLoadUnknown);
 
         // FIXME (Multi-WebProcess): <rdar://problem/12240223> We need to know which connection to send this message to.
-        m_webContext->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(decision), slot.key));
+        m_processPool->sendToAllProcesses(Messages::WebIconDatabaseProxy::ReceivedIconLoadDecision(static_cast<int>(decision), slot.key));
     }
 
     m_pendingLoadDecisionURLMap.clear();
index 7246150..e5e982f 100644 (file)
@@ -44,15 +44,15 @@ class Image;
 
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 
 class WebIconDatabase : public API::ObjectImpl<API::Object::Type::IconDatabase>, private WebCore::IconDatabaseClient, private IPC::MessageReceiver {
 public:
-    static PassRefPtr<WebIconDatabase> create(WebContext*);
+    static PassRefPtr<WebIconDatabase> create(WebProcessPool*);
     virtual ~WebIconDatabase();
 
     void invalidate();
-    void clearContext() { m_webContext = nullptr; }
+    void clearProcessPool() { m_processPool = nullptr; }
     void setDatabasePath(const String&);
     void enableDatabaseCleanup();
 
@@ -84,13 +84,13 @@ public:
 
     void setPrivateBrowsingEnabled(bool);
 
-    // Called when the WebContext is through with this WebIconDatabase but the
+    // Called when the WebProcessPool is through with this WebIconDatabase but the
     // WebCore::IconDatabase possibly isn't done shutting down.
     // In that case this WebIconDatabase will deref() itself when the time is right.
     void derefWhenAppropriate();
 
 private:
-    explicit WebIconDatabase(WebContext&);
+    explicit WebIconDatabase(WebProcessPool&);
 
     // WebCore::IconDatabaseClient
     virtual void didImportIconURLForPageURL(const String&) override;
@@ -106,7 +106,7 @@ private:
 
     void notifyIconDataReadyForPageURL(const String&);
 
-    WebContext* m_webContext;
+    WebProcessPool* m_processPool;
 
     std::unique_ptr<WebCore::IconDatabase> m_iconDatabaseImpl;
     bool m_urlImportCompleted;
index 7d9c6f9..1ca04a3 100644 (file)
@@ -30,7 +30,6 @@
 #if ENABLE(INSPECTOR)
 
 #include "APIURLRequest.h"
-#include "WebContext.h"
 #include "WebFramePolicyListenerProxy.h"
 #include "WebFrameProxy.h"
 #include "WebInspectorMessages.h"
@@ -39,6 +38,7 @@
 #include "WebPageGroup.h"
 #include "WebPageProxy.h"
 #include "WebPreferences.h"
+#include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 #include <WebCore/SchemeRegistry.h>
 #include <wtf/NeverDestroyed.h>
@@ -362,20 +362,21 @@ bool WebInspectorProxy::isInspectorPage(WebPageProxy& page)
     return WebInspectorPageGroups::shared().isInspectorPageGroup(page.pageGroup());
 }
 
-WebContext& WebInspectorProxy::inspectorContext()
+WebProcessPool& WebInspectorProxy::inspectorProcessPool()
 {
-    // Having our own context removes us from the main context's process pool and
+    // Having our own process pool removes us from the main process pool and
     // guarantees no process sharing for our user interface.
 
-    static WebContext* context;
-    if (!context) {
-        WebContextConfiguration configuration;
-        WebContext::applyPlatformSpecificConfigurationDefaults(configuration);
-        context = (WebContext::create(configuration)).leakRef();
-        context->setProcessModel(ProcessModelMultipleSecondaryProcesses);
+    static WebProcessPool* processPool;
+    if (!processPool) {
+        WebProcessPoolConfiguration configuration;
+        WebProcessPool::applyPlatformSpecificConfigurationDefaults(configuration);
+        
+        processPool = (WebProcessPool::create(WTF::move(configuration))).leakRef();
+        processPool->setProcessModel(ProcessModelMultipleSecondaryProcesses);
     }
 
-    return *context;
+    return *processPool;
 }
 
 static bool isMainOrTestInspectorPage(const WebInspectorProxy* webInspectorProxy, WKURLRequestRef requestRef)
index f8bd7ab..f50a456 100644 (file)
@@ -61,10 +61,10 @@ OBJC_CLASS WKWebInspectorWKView;
 
 namespace WebKit {
 
-class WebContext;
 class WebFrameProxy;
 class WebPageGroup;
 class WebPageProxy;
+class WebProcessPool;
 
 enum AttachmentSide {
     AttachmentSideBottom,
@@ -133,7 +133,7 @@ public:
     void togglePageProfiling();
 
     static bool isInspectorPage(WebPageProxy&);
-    static WebContext& inspectorContext();
+    static WebProcessPool& inspectorProcessPool();
 
     // Provided by platform WebInspectorProxy implementations.
     String inspectorPageURL() const;
index 42b40e4..8befc87 100644 (file)
@@ -30,7 +30,7 @@
 #include "APISecurityOrigin.h"
 #include "LocalStorageDetails.h"
 #include "SecurityOriginData.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 #include <wtf/NeverDestroyed.h>
 
 using namespace WebCore;
@@ -60,13 +60,13 @@ String WebKeyValueStorageManager::modificationTimeKey()
     return key;
 }
 
-PassRefPtr<WebKeyValueStorageManager> WebKeyValueStorageManager::create(WebContext* context)
+PassRefPtr<WebKeyValueStorageManager> WebKeyValueStorageManager::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebKeyValueStorageManager(context));
+    return adoptRef(new WebKeyValueStorageManager(processPool));
 }
 
-WebKeyValueStorageManager::WebKeyValueStorageManager(WebContext* context)
-    : WebContextSupplement(context)
+WebKeyValueStorageManager::WebKeyValueStorageManager(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
 }
 
@@ -88,7 +88,7 @@ void WebKeyValueStorageManager::derefWebContextSupplement()
 
 void WebKeyValueStorageManager::getKeyValueStorageOrigins(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    context()->storageManager().getOrigins([callbackFunction](Vector<RefPtr<SecurityOrigin>> securityOrigins) {
+    processPool()->storageManager().getOrigins([callbackFunction](Vector<RefPtr<SecurityOrigin>> securityOrigins) {
         Vector<RefPtr<API::Object>> webSecurityOrigins;
         webSecurityOrigins.reserveInitialCapacity(securityOrigins.size());
         for (auto& origin : securityOrigins)
@@ -100,7 +100,7 @@ void WebKeyValueStorageManager::getKeyValueStorageOrigins(std::function<void (AP
 
 void WebKeyValueStorageManager::getStorageDetailsByOrigin(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    context()->storageManager().getStorageDetailsByOrigin([callbackFunction](Vector<LocalStorageDetails> storageDetails) {
+    processPool()->storageManager().getStorageDetailsByOrigin([callbackFunction](Vector<LocalStorageDetails> storageDetails) {
         HashMap<String, RefPtr<API::Object>> detailsMap;
         Vector<RefPtr<API::Object>> result;
         result.reserveInitialCapacity(storageDetails.size());
@@ -125,12 +125,12 @@ void WebKeyValueStorageManager::getStorageDetailsByOrigin(std::function<void (AP
 
 void WebKeyValueStorageManager::deleteEntriesForOrigin(API::SecurityOrigin* origin)
 {
-    context()->storageManager().deleteEntriesForOrigin(origin->securityOrigin());
+    processPool()->storageManager().deleteEntriesForOrigin(origin->securityOrigin());
 }
 
 void WebKeyValueStorageManager::deleteAllEntries()
 {
-    context()->storageManager().deleteAllEntries();
+    processPool()->storageManager().deleteAllEntries();
 }
 
 } // namespace WebKit
index 67a8a74..deeb8d8 100644 (file)
 
 namespace WebKit {
 
+class WebProcessPool;
 typedef GenericCallback<API::Array*> ArrayCallback;
 
 class WebKeyValueStorageManager : public API::ObjectImpl<API::Object::Type::KeyValueStorageManager>, public WebContextSupplement {
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebKeyValueStorageManager> create(WebContext*);
+    static PassRefPtr<WebKeyValueStorageManager> create(WebProcessPool*);
     virtual ~WebKeyValueStorageManager();
 
     void getKeyValueStorageOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
@@ -58,7 +59,7 @@ public:
     static String modificationTimeKey();
 
 private:
-    explicit WebKeyValueStorageManager(WebContext*);
+    explicit WebKeyValueStorageManager(WebProcessPool*);
 
     // WebContextSupplement
     virtual void refWebContextSupplement() override;
index b3416d0..2d49a6b 100644 (file)
 #include "WebMediaCacheManagerProxy.h"
 
 #include "APIArray.h"
-#include "APISecurityOrigin.h"
-#include "WebContext.h"
 #include "WebMediaCacheManagerMessages.h"
 #include "WebMediaCacheManagerProxyMessages.h"
+#include "WebProcessPool.h"
 
 namespace WebKit {
 
@@ -39,15 +38,15 @@ const char* WebMediaCacheManagerProxy::supplementName()
     return "WebMediaCacheManagerProxy";
 }
 
-PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebContext* context)
+PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebMediaCacheManagerProxy(context));
+    return adoptRef(new WebMediaCacheManagerProxy(processPool));
 }
 
-WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
+WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
-    WebContextSupplement::context()->addMessageReceiver(Messages::WebMediaCacheManagerProxy::messageReceiverName(), *this);
+    WebContextSupplement::processPool()->addMessageReceiver(Messages::WebMediaCacheManagerProxy::messageReceiverName(), *this);
 }
 
 WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()
@@ -56,7 +55,7 @@ WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()
 
 // WebContextSupplement
 
-void WebMediaCacheManagerProxy::contextDestroyed()
+void WebMediaCacheManagerProxy::processPoolDestroyed()
 {
     invalidateCallbackMap(m_arrayCallbacks, CallbackBase::Error::OwnerWasInvalidated);
 }
@@ -88,7 +87,7 @@ void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(std::function<void (A
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> When we're sending this to multiple processes, we need to aggregate the callback data when it comes back.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::GetHostnamesWithMediaCache(callbackID));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::GetHostnamesWithMediaCache(callbackID));
 }
     
 void WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache(const Vector<String>& hostnames, uint64_t callbackID)
@@ -104,12 +103,12 @@ void WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache(const Vector<Strin
 
 void WebMediaCacheManagerProxy::clearCacheForHostname(const String& hostname)
 {
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForHostname(hostname));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForHostname(hostname));
 }
 
 void WebMediaCacheManagerProxy::clearCacheForAllHostnames()
 {
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForAllHostnames());
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForAllHostnames());
 }
 
 } // namespace WebKit
index 6d2a043..0cee156 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace WebKit {
 
-class WebContext;
+class WebProcessPool;
 class WebProcessProxy;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
@@ -45,7 +45,7 @@ class WebMediaCacheManagerProxy : public API::ObjectImpl<API::Object::Type::Medi
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*);
+    static PassRefPtr<WebMediaCacheManagerProxy> create(WebProcessPool*);
     virtual ~WebMediaCacheManagerProxy();
     
     void getHostnamesWithMediaCache(std::function<void (API::Array*, CallbackBase::Error)>);
@@ -56,12 +56,12 @@ public:
     using API::Object::deref;
 
 private:
-    explicit WebMediaCacheManagerProxy(WebContext*);
+    explicit WebMediaCacheManagerProxy(WebProcessPool*);
 
     void didGetHostnamesWithMediaCache(const Vector<String>&, uint64_t callbackID);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual bool shouldTerminate(WebProcessProxy*) const override;
     virtual void refWebContextSupplement() override;
index 1d09f1a..3dd5c11 100644 (file)
@@ -28,9 +28,9 @@
 
 #include "APISecurityOrigin.h"
 #include "SecurityOriginData.h"
-#include "WebContext.h"
 #include "WebOriginDataManagerMessages.h"
 #include "WebOriginDataManagerProxyMessages.h"
+#include "WebProcessPool.h"
 #include <wtf/NeverDestroyed.h>
 
 using namespace WebCore;
@@ -42,15 +42,15 @@ const char* WebOriginDataManagerProxy::supplementName()
     return "WebOriginDataManagerProxy";
 }
 
-PassRefPtr<WebOriginDataManagerProxy> WebOriginDataManagerProxy::create(WebContext* context)
+PassRefPtr<WebOriginDataManagerProxy> WebOriginDataManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebOriginDataManagerProxy(context));
+    return adoptRef(new WebOriginDataManagerProxy(processPool));
 }
 
-WebOriginDataManagerProxy::WebOriginDataManagerProxy(WebContext* context)
-    : WebContextSupplement(context)
+WebOriginDataManagerProxy::WebOriginDataManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
-    context->addMessageReceiver(Messages::WebOriginDataManagerProxy::messageReceiverName(), *this);
+    processPool->addMessageReceiver(Messages::WebOriginDataManagerProxy::messageReceiverName(), *this);
 }
 
 WebOriginDataManagerProxy::~WebOriginDataManagerProxy()
@@ -58,7 +58,7 @@ WebOriginDataManagerProxy::~WebOriginDataManagerProxy()
 }
 
 
-void WebOriginDataManagerProxy::contextDestroyed()
+void WebOriginDataManagerProxy::processPoolDestroyed()
 {
     invalidateCallbackMap(m_arrayCallbacks, CallbackBase::Error::OwnerWasInvalidated);
 }
@@ -155,9 +155,9 @@ static std::pair<RefPtr<CallbackSynchronizer>, ArrayCallback::CallbackFunction>
 }
 
 template <typename CallbackType, typename MessageType, typename... Parameters>
-static void sendMessageToAllProcessesInContext(WebContext* context, typename CallbackType::CallbackFunction callback, HashMap<uint64_t, RefPtr<CallbackType>>& callbackStorage, Parameters... parameters)
+static void sendMessageToAllProcessesInProcessPool(WebProcessPool* processPool, typename CallbackType::CallbackFunction callback, HashMap<uint64_t, RefPtr<CallbackType>>& callbackStorage, Parameters... parameters)
 {
-    if (!context) {
+    if (!processPool) {
         CallbackType::create(callback)->invalidate();
         return;
     }
@@ -166,7 +166,7 @@ static void sendMessageToAllProcessesInContext(WebContext* context, typename Cal
     RefPtr<CallbackSynchronizer> synchronizer = synchronizerAndCallback.first;
     auto perProcessCallback = synchronizerAndCallback.second;
 
-    for (auto& process : context->processes()) {
+    for (auto& process : processPool->processes()) {
         if (!process || !process->canSendMessage())
             continue;
 
@@ -182,13 +182,13 @@ static void sendMessageToAllProcessesInContext(WebContext* context, typename Cal
         RefPtr<CallbackType> callback = CallbackType::create(perProcessCallback);
         uint64_t callbackID = callback->callbackID();
         callbackStorage.set(callbackID, callback.release());
-        context->sendToDatabaseProcessRelaunchingIfNecessary(MessageType(parameters..., callbackID));
+        processPool->sendToDatabaseProcessRelaunchingIfNecessary(MessageType(parameters..., callbackID));
     }
 }
 
 void WebOriginDataManagerProxy::getOrigins(WKOriginDataTypes types, std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    sendMessageToAllProcessesInContext<ArrayCallback, Messages::WebOriginDataManager::GetOrigins>(context(), callbackFunction, m_arrayCallbacks, types);
+    sendMessageToAllProcessesInProcessPool<ArrayCallback, Messages::WebOriginDataManager::GetOrigins>(processPool(), callbackFunction, m_arrayCallbacks, types);
 }
 
 void WebOriginDataManagerProxy::didGetOrigins(IPC::Connection* connection, const Vector<SecurityOriginData>& originIdentifiers, uint64_t callbackID)
@@ -212,12 +212,12 @@ void WebOriginDataManagerProxy::deleteEntriesForOrigin(WKOriginDataTypes types,
     securityOriginData.host = origin->securityOrigin().host();
     securityOriginData.port = origin->securityOrigin().port();
 
-    sendMessageToAllProcessesInContext<VoidCallback, Messages::WebOriginDataManager::DeleteEntriesForOrigin>(context(), callbackFunction, m_voidCallbacks, types, securityOriginData);
+    sendMessageToAllProcessesInProcessPool<VoidCallback, Messages::WebOriginDataManager::DeleteEntriesForOrigin>(processPool(), callbackFunction, m_voidCallbacks, types, securityOriginData);
 }
 
 void WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates(WKOriginDataTypes types, double startDate, double endDate, std::function<void (CallbackBase::Error)> callbackFunction)
 {
-    sendMessageToAllProcessesInContext<VoidCallback, Messages::WebOriginDataManager::DeleteEntriesModifiedBetweenDates>(context(), callbackFunction, m_voidCallbacks, types, startDate, endDate);
+    sendMessageToAllProcessesInProcessPool<VoidCallback, Messages::WebOriginDataManager::DeleteEntriesModifiedBetweenDates>(processPool(), callbackFunction, m_voidCallbacks, types, startDate, endDate);
 }
 
 void WebOriginDataManagerProxy::didDeleteEntries(IPC::Connection* connection, uint64_t callbackID)
@@ -229,7 +229,7 @@ void WebOriginDataManagerProxy::didDeleteEntries(IPC::Connection* connection, ui
 
 void WebOriginDataManagerProxy::deleteAllEntries(WKOriginDataTypes types, std::function<void (CallbackBase::Error)> callbackFunction)
 {
-    sendMessageToAllProcessesInContext<VoidCallback, Messages::WebOriginDataManager::DeleteAllEntries>(context(), callbackFunction, m_voidCallbacks, types);
+    sendMessageToAllProcessesInProcessPool<VoidCallback, Messages::WebOriginDataManager::DeleteAllEntries>(processPool(), callbackFunction, m_voidCallbacks, types);
 }
 
 void WebOriginDataManagerProxy::didDeleteAllEntries(IPC::Connection* connection, uint64_t callbackID)
index 3262abe..645d9da 100644 (file)
@@ -41,6 +41,7 @@ class Connection;
 
 namespace WebKit {
 
+class WebProcessPool;
 struct SecurityOriginData;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
@@ -49,7 +50,7 @@ class WebOriginDataManagerProxy : public API::ObjectImpl<API::Object::Type::Orig
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebOriginDataManagerProxy> create(WebContext*);
+    static PassRefPtr<WebOriginDataManagerProxy> create(WebProcessPool*);
     virtual ~WebOriginDataManagerProxy();
 
     void getOrigins(WKOriginDataTypes, std::function<void (API::Array*, CallbackBase::Error)>);
@@ -64,14 +65,14 @@ public:
     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
 
 private:
-    explicit WebOriginDataManagerProxy(WebContext*);
+    explicit WebOriginDataManagerProxy(WebProcessPool*);
 
     void didGetOrigins(IPC::Connection*, const Vector<SecurityOriginData>&, uint64_t callbackID);
     void didDeleteEntries(IPC::Connection*, uint64_t callbackID);
     void didDeleteAllEntries(IPC::Connection*, uint64_t callbackID);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual bool shouldTerminate(WebProcessProxy*) const override;
     virtual void refWebContextSupplement() override;
index 6d8bb10..491f86f 100644 (file)
@@ -61,7 +61,6 @@
 #include "WebBackForwardList.h"
 #include "WebBackForwardListItem.h"
 #include "WebCertificateInfo.h"
-#include "WebContext.h"
 #include "WebContextMenuProxy.h"
 #include "WebContextUserMessageCoders.h"
 #include "WebCoreArgumentCoders.h"
@@ -86,6 +85,7 @@
 #include "WebPopupMenuProxy.h"
 #include "WebPreferences.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 #include "WebProtectionSpace.h"
 #include "WebUserContentControllerProxy.h"
@@ -402,7 +402,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     webPageProxyCounter.increment();
 #endif
 
-    WebContext::statistics().wkPageCount++;
+    WebProcessPool::statistics().wkPageCount++;
 
     m_preferences->addPage(*this);
     m_pageGroup->addPage(this);
@@ -424,7 +424,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
 
     // FIXME: If we ever expose the session storage size as a preference, we need to pass it here.
     IPC::Connection* connection = m_process->state() == WebProcessProxy::State::Running ? m_process->connection() : nullptr;
-    m_process->context().storageManager().createSessionStorageNamespace(m_pageID, connection, std::numeric_limits<unsigned>::max());
+    m_process->processPool().storageManager().createSessionStorageNamespace(m_pageID, connection, std::numeric_limits<unsigned>::max());
     setSessionID(configuration.sessionID);
 
 #if PLATFORM(COCOA)
@@ -446,7 +446,7 @@ WebPageProxy::~WebPageProxy()
     if (!m_isClosed)
         close();
 
-    WebContext::statistics().wkPageCount--;
+    WebProcessPool::statistics().wkPageCount--;
 
     if (m_hasSpellDocumentTag)
         TextChecker::closeSpellDocumentWithTag(m_spellDocumentTag);
@@ -566,10 +566,10 @@ void WebPageProxy::reattachToWebProcess()
     m_process->removeWebPage(m_pageID);
     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
 
-    if (m_process->context().processModel() == ProcessModelSharedSecondaryProcess)
-        m_process = m_process->context().ensureSharedWebProcess();
+    if (m_process->processPool().processModel() == ProcessModelSharedSecondaryProcess)
+        m_process = m_process->processPool().ensureSharedWebProcess();
     else
-        m_process = m_process->context().createNewWebProcessRespectingProcessCountLimit();
+        m_process = m_process->processPool().createNewWebProcessRespectingProcessCountLimit();
 
     ASSERT(m_process->state() != ChildProcessProxy::State::Terminated);
     if (m_process->state() == ChildProcessProxy::State::Running)
@@ -625,7 +625,7 @@ void WebPageProxy::setSessionID(SessionID sessionID)
 
 #if ENABLE(NETWORK_PROCESS)
     if (sessionID.isEphemeral())
-        m_process->context().sendToNetworkingProcess(Messages::NetworkProcess::EnsurePrivateBrowsingSession(sessionID));
+        m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::EnsurePrivateBrowsingSession(sessionID));
 #endif
 }
 
@@ -692,8 +692,8 @@ void WebPageProxy::close()
     m_process->send(Messages::WebPage::Close(), m_pageID);
     m_process->removeWebPage(m_pageID);
     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
-    m_process->context().storageManager().destroySessionStorageNamespace(m_pageID);
-    m_process->context().supplement<WebNotificationManagerProxy>()->clearNotifications(this);
+    m_process->processPool().storageManager().destroySessionStorageNamespace(m_pageID);
+    m_process->processPool().supplement<WebNotificationManagerProxy>()->clearNotifications(this);
 
     m_websiteDataStore->removeWebPage(*this);
 }
@@ -1039,14 +1039,14 @@ bool WebPageProxy::canShowMIMEType(const String& mimeType)
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     String newMimeType = mimeType;
-    PluginModuleInfo plugin = m_process->context().pluginInfoStore().findPlugin(newMimeType, URL());
+    PluginModuleInfo plugin = m_process->processPool().pluginInfoStore().findPlugin(newMimeType, URL());
     if (!plugin.path.isNull() && m_preferences->pluginsEnabled())
         return true;
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
 #if PLATFORM(COCOA)
     // On Mac, we can show PDFs.
-    if (MIMETypeRegistry::isPDFOrPostScriptMIMEType(mimeType) && !WebContext::omitPDFSupport())
+    if (MIMETypeRegistry::isPDFOrPostScriptMIMEType(mimeType) && !WebProcessPool::omitPDFSupport())
         return true;
 #endif // PLATFORM(COCOA)
 
@@ -1271,7 +1271,7 @@ void WebPageProxy::updateActivityToken()
     if (m_viewState & ViewState::IsVisuallyIdle)
         m_pageIsUserObservableCount = nullptr;
     else if (!m_pageIsUserObservableCount)
-        m_pageIsUserObservableCount = m_process->context().userObservablePageCount();
+        m_pageIsUserObservableCount = m_process->processPool().userObservablePageCount();
 
 #if PLATFORM(IOS)
     if (!isViewVisible())
@@ -1286,7 +1286,7 @@ void WebPageProxy::updateProccessSuppressionState()
     if (m_preferences->pageVisibilityBasedProcessSuppressionEnabled())
         m_preventProcessSuppressionCount = nullptr;
     else if (!m_preventProcessSuppressionCount)
-        m_preventProcessSuppressionCount = m_process->context().processSuppressionDisabledForPageCount();
+        m_preventProcessSuppressionCount = m_process->processPool().processSuppressionDisabledForPageCount();
 }
 
 void WebPageProxy::layerHostingModeDidChange()
@@ -1664,7 +1664,7 @@ void WebPageProxy::findPlugin(const String& mimeType, uint32_t processType, cons
     pluginLoadPolicy = PluginModuleLoadNormally;
 
     PluginData::AllowedPluginTypes allowedPluginTypes = allowOnlyApplicationPlugins ? PluginData::OnlyApplicationPlugins : PluginData::AllPlugins;
-    PluginModuleInfo plugin = m_process->context().pluginInfoStore().findPlugin(newMimeType, URL(URL(), urlString), allowedPluginTypes);
+    PluginModuleInfo plugin = m_process->processPool().pluginInfoStore().findPlugin(newMimeType, URL(URL(), urlString), allowedPluginTypes);
     if (!plugin.path) {
         pluginProcessToken = 0;
         return;
@@ -1828,7 +1828,7 @@ void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* fr
         // Create a download proxy.
         // FIXME: We should ensure that the downloadRequest is never empty.
         const ResourceRequest& downloadRequest = m_decidePolicyForResponseRequest ? *m_decidePolicyForResponseRequest : ResourceRequest();
-        DownloadProxy* download = m_process->context().createDownloadProxy(downloadRequest);
+        DownloadProxy* download = m_process->processPool().createDownloadProxy(downloadRequest);
         downloadID = download->downloadID();
         handleDownloadRequest(download);
     }
@@ -3079,7 +3079,7 @@ void WebPageProxy::didNavigateWithNavigationData(const WebNavigationDataStore& s
     MESSAGE_CHECK(frame->page() == this);
 
     m_loaderClient->didNavigateWithNavigationData(*this, store, *frame);
-    process().context().historyClient().didNavigateWithNavigationData(process().context(), *this, store, *frame);
+    process().processPool().historyClient().didNavigateWithNavigationData(process().processPool(), *this, store, *frame);
 }
 
 void WebPageProxy::didPerformClientRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID)
@@ -3095,7 +3095,7 @@ void WebPageProxy::didPerformClientRedirect(const String& sourceURLString, const
     MESSAGE_CHECK_URL(destinationURLString);
 
     m_loaderClient->didPerformClientRedirect(*this, sourceURLString, destinationURLString, *frame);
-    process().context().historyClient().didPerformClientRedirect(process().context(), *this, sourceURLString, destinationURLString, *frame);
+    process().processPool().historyClient().didPerformClientRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
 }
 
 void WebPageProxy::didPerformServerRedirect(const String& sourceURLString, const String& destinationURLString, uint64_t frameID)
@@ -3111,7 +3111,7 @@ void WebPageProxy::didPerformServerRedirect(const String& sourceURLString, const
     MESSAGE_CHECK_URL(destinationURLString);
 
     m_loaderClient->didPerformServerRedirect(*this, sourceURLString, destinationURLString, *frame);
-    process().context().historyClient().didPerformServerRedirect(process().context(), *this, sourceURLString, destinationURLString, *frame);
+    process().processPool().historyClient().didPerformServerRedirect(process().processPool(), *this, sourceURLString, destinationURLString, *frame);
 }
 
 void WebPageProxy::didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID)
@@ -3123,7 +3123,7 @@ void WebPageProxy::didUpdateHistoryTitle(const String& title, const String& url,
     MESSAGE_CHECK_URL(url);
 
     m_loaderClient->didUpdateHistoryTitle(*this, title, url, *frame);
-    process().context().historyClient().didUpdateHistoryTitle(process().context(), *this, title, url, *frame);
+    process().processPool().historyClient().didUpdateHistoryTitle(process().processPool(), *this, title, url, *frame);
 }
 
 // UIClient
@@ -3141,7 +3141,7 @@ void WebPageProxy::createNewPage(uint64_t frameID, const ResourceRequest& reques
 
     newPageID = newPage->pageID();
     newPageParameters = newPage->creationParameters();
-    process().context().storageManager().cloneSessionStorageNamespace(m_pageID, newPage->pageID());
+    process().processPool().storageManager().cloneSessionStorageNamespace(m_pageID, newPage->pageID());
 }
     
 void WebPageProxy::showPage()
@@ -3267,14 +3267,14 @@ void WebPageProxy::connectionWillOpen(IPC::Connection* connection)
 {
     ASSERT(connection == m_process->connection());
 
-    m_process->context().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, connection);
+    m_process->processPool().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, connection);
 }
 
 void WebPageProxy::connectionWillClose(IPC::Connection* connection)
 {
     ASSERT_UNUSED(connection, connection == m_process->connection());
 
-    m_process->context().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, 0);
+    m_process->processPool().storageManager().setAllowedSessionStorageNamespaceConnection(m_pageID, 0);
 }
 
 void WebPageProxy::processDidFinishLaunching()
@@ -3296,7 +3296,7 @@ void WebPageProxy::unavailablePluginButtonClicked(uint32_t opaquePluginUnavailab
 
     RefPtr<ImmutableDictionary> pluginInformation;
     String newMimeType = mimeType;
-    PluginModuleInfo plugin = m_process->context().pluginInfoStore().findPlugin(newMimeType, URL(URL(), pluginURLString));
+    PluginModuleInfo plugin = m_process->processPool().pluginInfoStore().findPlugin(newMimeType, URL(URL(), pluginURLString));
     pluginInformation = createPluginInformationDictionary(plugin, frameURLString, mimeType, pageURLString, pluginspageAttributeURLString, pluginURLString);
 
     WKPluginUnavailabilityReason pluginUnavailabilityReason = kWKPluginUnavailabilityReasonPluginMissing;
@@ -3971,15 +3971,15 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
     }
 #endif
     if (item.action() == ContextMenuItemTagDownloadImageToDisk) {
-        m_process->context().download(this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteImageURL));
+        m_process->processPool().download(this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteImageURL));
         return;    
     }
     if (item.action() == ContextMenuItemTagDownloadLinkToDisk) {
-        m_process->context().download(this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteLinkURL));
+        m_process->processPool().download(this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteLinkURL));
         return;
     }
     if (item.action() == ContextMenuItemTagDownloadMediaToDisk) {
-        m_process->context().download(this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteMediaURL));
+        m_process->processPool().download(this, URL(URL(), m_activeContextMenuContextData.webHitTestResultData().absoluteMediaURL));
         return;
     }
     if (item.action() == ContextMenuItemTagCheckSpellingWhileTyping) {
@@ -4854,22 +4854,22 @@ void WebPageProxy::requestNotificationPermission(uint64_t requestID, const Strin
 
 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
 {
-    m_process->context().supplement<WebNotificationManagerProxy>()->show(this, title, body, iconURL, tag, lang, dir, originString, notificationID);
+    m_process->processPool().supplement<WebNotificationManagerProxy>()->show(this, title, body, iconURL, tag, lang, dir, originString, notificationID);
 }
 
 void WebPageProxy::cancelNotification(uint64_t notificationID)
 {
-    m_process->context().supplement<WebNotificationManagerProxy>()->cancel(this, notificationID);
+    m_process->processPool().supplement<WebNotificationManagerProxy>()->cancel(this, notificationID);
 }
 
 void WebPageProxy::clearNotifications(const Vector<uint64_t>& notificationIDs)
 {
-    m_process->context().supplement<WebNotificationManagerProxy>()->clearNotifications(this, notificationIDs);
+    m_process->processPool().supplement<WebNotificationManagerProxy>()->clearNotifications(this, notificationIDs);
 }
 
 void WebPageProxy::didDestroyNotification(uint64_t notificationID)
 {
-    m_process->context().supplement<WebNotificationManagerProxy>()->didDestroyNotification(this, notificationID);
+    m_process->processPool().supplement<WebNotificationManagerProxy>()->didDestroyNotification(this, notificationID);
 }
 
 float WebPageProxy::headerHeight(WebFrameProxy* frame)
@@ -4966,7 +4966,7 @@ void WebPageProxy::didBlockInsecurePluginVersion(const String& mimeType, const S
 
 #if PLATFORM(COCOA) && ENABLE(NETSCAPE_PLUGIN_API)
     String newMimeType = mimeType;
-    PluginModuleInfo plugin = m_process->context().pluginInfoStore().findPlugin(newMimeType, URL(URL(), pluginURLString));
+    PluginModuleInfo plugin = m_process->processPool().pluginInfoStore().findPlugin(newMimeType, URL(URL(), pluginURLString));
     pluginInformation = createPluginInformationDictionary(plugin, frameURLString, mimeType, pageURLString, String(), String(), replacementObscured);
 #else
     UNUSED_PARAM(mimeType);
index b17c9d9..a16af2d 100644 (file)
@@ -26,9 +26,9 @@
 #include "config.h"
 #include "WebPreferences.h"
 
-#include "WebContext.h"
 #include "WebPageGroup.h"
 #include "WebPreferencesKeys.h"
+#include "WebProcessPool.h"
 #include <wtf/ThreadingPrimitives.h>
 
 namespace WebKit {
@@ -87,7 +87,7 @@ void WebPreferences::addPage(WebPageProxy& webPageProxy)
 
     if (privateBrowsingEnabled()) {
         if (!privateBrowsingPageCount)
-            WebContext::willStartUsingPrivateBrowsing();
+            WebProcessPool::willStartUsingPrivateBrowsing();
 
         ++privateBrowsingPageCount;
     }
@@ -101,7 +101,7 @@ void WebPreferences::removePage(WebPageProxy& webPageProxy)
     if (privateBrowsingEnabled()) {
         --privateBrowsingPageCount;
         if (!privateBrowsingPageCount)
-            WebContext::willStopUsingPrivateBrowsing();
+            WebProcessPool::willStopUsingPrivateBrowsing();
     }
 }
 
@@ -156,7 +156,7 @@ void WebPreferences::updatePrivateBrowsingValue(bool value)
 
     if (value) {
         if (!privateBrowsingPageCount)
-            WebContext::willStartUsingPrivateBrowsing();
+            WebProcessPool::willStartUsingPrivateBrowsing();
         privateBrowsingPageCount += pagesChanged;
     }
 
@@ -166,7 +166,7 @@ void WebPreferences::updatePrivateBrowsingValue(bool value)
         ASSERT(privateBrowsingPageCount >= pagesChanged);
         privateBrowsingPageCount -= pagesChanged;
         if (!privateBrowsingPageCount)
-            WebContext::willStopUsingPrivateBrowsing();
+            WebProcessPool::willStopUsingPrivateBrowsing();
     }
 }
 
similarity index 81%
rename from Source/WebKit2/UIProcess/WebContext.cpp
rename to Source/WebKit2/UIProcess/WebProcessPool.cpp
index 30efd18..d3a30f5 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 
 #include "APIArray.h"
 #include "APIDownloadClient.h"
@@ -40,7 +40,6 @@
 #include "WKContextPrivate.h"
 #include "WebApplicationCacheManagerProxy.h"
 #include "WebContextMessageKinds.h"
-#include "WebContextMessages.h"
 #include "WebContextSupplement.h"
 #include "WebContextUserMessageCoders.h"
 #include "WebCookieManagerProxy.h"
 #include "WebKeyValueStorageManager.h"
 #include "WebKit2Initialize.h"
 #include "WebMediaCacheManagerProxy.h"
+#include "WebMemorySampler.h"
 #include "WebNotificationManagerProxy.h"
-#include "WebPluginSiteDataManager.h"
 #include "WebPageGroup.h"
+#include "WebPluginSiteDataManager.h"
 #include "WebPreferences.h"
-#include "WebMemorySampler.h"
 #include "WebProcessCreationParameters.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPoolMessages.h"
 #include "WebProcessProxy.h"
 #include "WebResourceCacheManagerProxy.h"
 #include "WebsiteDataStore.h"
 #endif
 
 using namespace WebCore;
+using namespace WebKit;
 
 namespace WebKit {
 
 static const double sharedSecondaryProcessShutdownTimeout = 60;
 
-DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webContextCounter, ("WebContext"));
+DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, processPoolCounter, ("WebProcessPool"));
 
-void WebContext::applyPlatformSpecificConfigurationDefaults(WebContextConfiguration& configuration)
+void WebProcessPool::applyPlatformSpecificConfigurationDefaults(WebProcessPoolConfiguration& configuration)
 {
     // FIXME: This function should not be needed; all ports should make sure that the configuration has the right
-    // values, and then we should get rid of the platform specific defaults inside WebContext.
+    // values, and then we should get rid of the platform specific defaults inside WebProcessPool.
 
     if (!configuration.localStorageDirectory)
         configuration.localStorageDirectory = platformDefaultLocalStorageDirectory();
@@ -134,21 +135,21 @@ void WebContext::applyPlatformSpecificConfigurationDefaults(WebContextConfigurat
         configuration.mediaKeysStorageDirectory = platformDefaultMediaKeysStorageDirectory();
 }
 
-PassRefPtr<WebContext> WebContext::create(WebContextConfiguration configuration)
+PassRefPtr<WebProcessPool> WebProcessPool::create(WebProcessPoolConfiguration configuration)
 {
     InitializeWebKit2();
-    return adoptRef(new WebContext(WTF::move(configuration)));
+    return adoptRef(new WebProcessPool(WTF::move(configuration)));
 }
 
-static Vector<WebContext*>& contexts()
+static Vector<WebProcessPool*>& processPools()
 {
-    static NeverDestroyed<Vector<WebContext*>> contexts;
-    return contexts;
+    static NeverDestroyed<Vector<WebProcessPool*>> processPools;
+    return processPools;
 }
 
-const Vector<WebContext*>& WebContext::allContexts()
+const Vector<WebProcessPool*>& WebProcessPool::allProcessPools()
 {
-    return contexts();
+    return processPools();
 }
 
 static WebsiteDataStore::Configuration websiteDataStoreConfiguration()
@@ -159,7 +160,7 @@ static WebsiteDataStore::Configuration websiteDataStoreConfiguration()
     return configuration;
 }
 
-WebContext::WebContext(WebContextConfiguration configuration)
+WebProcessPool::WebProcessPool(WebProcessPoolConfiguration configuration)
     : m_processModel(ProcessModelSharedSecondaryProcess)
     , m_webProcessCountLimit(UINT_MAX)
     , m_haveInitialEmptyProcess(false)
@@ -199,7 +200,7 @@ WebContext::WebContext(WebContextConfiguration configuration)
 {
     platformInitialize();
 
-    addMessageReceiver(Messages::WebContext::messageReceiverName(), *this);
+    addMessageReceiver(Messages::WebProcessPool::messageReceiverName(), *this);
     addMessageReceiver(WebContextLegacyMessages::messageReceiverName(), *this);
 
     // NOTE: These sub-objects must be initialized after m_messageReceiverMap..
@@ -228,7 +229,7 @@ WebContext::WebContext(WebContextConfiguration configuration)
     addSupplement<WebOriginDataManagerProxy>();
 #endif
 
-    contexts().append(this);
+    processPools().append(this);
 
     addLanguageChangeObserver(this, languageChanged);
 
@@ -242,20 +243,20 @@ WebContext::WebContext(WebContextConfiguration configuration)
 #endif
 
 #ifndef NDEBUG
-    webContextCounter.increment();
+    processPoolCounter.increment();
 #endif
 }
 
 #if !PLATFORM(COCOA)
-void WebContext::platformInitialize()
+void WebProcessPool::platformInitialize()
 {
 }
 #endif
 
-WebContext::~WebContext()
+WebProcessPool::~WebProcessPool()
 {
-    ASSERT(contexts().find(this) != notFound);
-    contexts().remove(contexts().find(this));
+    ASSERT(processPools().find(this) != notFound);
+    processPools().remove(processPools().find(this));
 
     removeLanguageChangeObserver(this);
 
@@ -264,18 +265,18 @@ WebContext::~WebContext()
     WebContextSupplementMap::const_iterator it = m_supplements.begin();
     WebContextSupplementMap::const_iterator end = m_supplements.end();
     for (; it != end; ++it) {
-        it->value->contextDestroyed();
-        it->value->clearContext();
+        it->value->processPoolDestroyed();
+        it->value->clearProcessPool();
     }
 
     m_iconDatabase->invalidate();
-    m_iconDatabase->clearContext();
+    m_iconDatabase->clearProcessPool();
     WebIconDatabase* rawIconDatabase = m_iconDatabase.release().leakRef();
     rawIconDatabase->derefWhenAppropriate();
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_pluginSiteDataManager->invalidate();
-    m_pluginSiteDataManager->clearContext();
+    m_pluginSiteDataManager->clearProcessPool();
 #endif
 
     invalidateCallbackMap(m_dictionaryCallbacks, CallbackBase::Error::OwnerWasInvalidated);
@@ -287,26 +288,26 @@ WebContext::~WebContext()
 #endif
 
 #ifndef NDEBUG
-    webContextCounter.decrement();
+    processPoolCounter.decrement();
 #endif
 }
 
-void WebContext::initializeClient(const WKContextClientBase* client)
+void WebProcessPool::initializeClient(const WKContextClientBase* client)
 {
     m_client.initialize(client);
 }
 
-void WebContext::initializeInjectedBundleClient(const WKContextInjectedBundleClientBase* client)
+void WebProcessPool::initializeInjectedBundleClient(const WKContextInjectedBundleClientBase* client)
 {
     m_injectedBundleClient.initialize(client);
 }
 
-void WebContext::initializeConnectionClient(const WKContextConnectionClientBase* client)
+void WebProcessPool::initializeConnectionClient(const WKContextConnectionClientBase* client)
 {
     m_connectionClient.initialize(client);
 }
 
-void WebContext::setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient> historyClient)
+void WebProcessPool::setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient> historyClient)
 {
     if (!historyClient)
         m_historyClient = std::make_unique<API::LegacyContextHistoryClient>();
@@ -314,7 +315,7 @@ void WebContext::setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClien
         m_historyClient = WTF::move(historyClient);
 }
 
-void WebContext::setDownloadClient(std::unique_ptr<API::DownloadClient> downloadClient)
+void WebProcessPool::setDownloadClient(std::unique_ptr<API::DownloadClient> downloadClient)
 {
     if (!downloadClient)
         m_downloadClient = std::make_unique<API::DownloadClient>();
@@ -322,7 +323,7 @@ void WebContext::setDownloadClient(std::unique_ptr<API::DownloadClient> download
         m_downloadClient = WTF::move(downloadClient);
 }
 
-void WebContext::setProcessModel(ProcessModel processModel)
+void WebProcessPool::setProcessModel(ProcessModel processModel)
 {
     // Guard against API misuse.
     if (!m_processes.isEmpty())
@@ -333,7 +334,7 @@ void WebContext::setProcessModel(ProcessModel processModel)
     m_processModel = processModel;
 }
 
-void WebContext::setMaximumNumberOfProcesses(unsigned maximumNumberOfProcesses)
+void WebProcessPool::setMaximumNumberOfProcesses(unsigned maximumNumberOfProcesses)
 {
     // Guard against API misuse.
     if (!m_processes.isEmpty())
@@ -345,7 +346,7 @@ void WebContext::setMaximumNumberOfProcesses(unsigned maximumNumberOfProcesses)
         m_webProcessCountLimit = maximumNumberOfProcesses;
 }
 
-IPC::Connection* WebContext::networkingProcessConnection()
+IPC::Connection* WebProcessPool::networkingProcessConnection()
 {
     switch (m_processModel) {
     case ProcessModelSharedSecondaryProcess:
@@ -366,12 +367,12 @@ IPC::Connection* WebContext::networkingProcessConnection()
     return 0;
 }
 
-void WebContext::languageChanged(void* context)
+void WebProcessPool::languageChanged(void* context)
 {
-    static_cast<WebContext*>(context)->languageChanged();
+    static_cast<WebProcessPool*>(context)->languageChanged();
 }
 
-void WebContext::languageChanged()
+void WebProcessPool::languageChanged()
 {
     sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(userPreferredLanguages()));
 #if USE(SOUP) && ENABLE(NETWORK_PROCESS)
@@ -380,17 +381,17 @@ void WebContext::languageChanged()
 #endif
 }
 
-void WebContext::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
+void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
 {
     sendToAllProcesses(Messages::WebProcess::FullKeyboardAccessModeChanged(fullKeyboardAccessEnabled));
 }
 
-void WebContext::textCheckerStateChanged()
+void WebProcessPool::textCheckerStateChanged()
 {
     sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state()));
 }
 
-void WebContext::setUsesNetworkProcess(bool usesNetworkProcess)
+void WebProcessPool::setUsesNetworkProcess(bool usesNetworkProcess)
 {
 #if ENABLE(NETWORK_PROCESS)
     m_usesNetworkProcess = usesNetworkProcess;
@@ -399,7 +400,7 @@ void WebContext::setUsesNetworkProcess(bool usesNetworkProcess)
 #endif
 }
 
-bool WebContext::usesNetworkProcess() const
+bool WebProcessPool::usesNetworkProcess() const
 {
 #if ENABLE(NETWORK_PROCESS)
     return m_usesNetworkProcess;
@@ -409,7 +410,7 @@ bool WebContext::usesNetworkProcess() const
 }
 
 #if ENABLE(NETWORK_PROCESS)
-void WebContext::ensureNetworkProcess()
+void WebProcessPool::ensureNetworkProcess()
 {
     if (m_networkProcess)
         return;
@@ -455,7 +456,7 @@ void WebContext::ensureNetworkProcess()
 #endif
 }
 
-void WebContext::networkProcessCrashed(NetworkProcessProxy* networkProcessProxy)
+void WebProcessPool::networkProcessCrashed(NetworkProcessProxy* networkProcessProxy)
 {
     ASSERT(m_networkProcess);
     ASSERT(networkProcessProxy == m_networkProcess.get());
@@ -470,7 +471,7 @@ void WebContext::networkProcessCrashed(NetworkProcessProxy* networkProcessProxy)
     m_client.networkProcessDidCrash(this);
 }
 
-void WebContext::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
+void WebProcessPool::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
 {
     ASSERT(reply);
 
@@ -482,7 +483,7 @@ void WebContext::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProx
 #endif
 
 #if ENABLE(DATABASE_PROCESS)
-void WebContext::ensureDatabaseProcess()
+void WebProcessPool::ensureDatabaseProcess()
 {
     if (m_databaseProcess)
         return;
@@ -502,7 +503,7 @@ void WebContext::ensureDatabaseProcess()
     m_databaseProcess->send(Messages::DatabaseProcess::InitializeDatabaseProcess(parameters), 0);
 }
 
-void WebContext::getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply> reply)
+void WebProcessPool::getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply> reply)
 {
     ASSERT(reply);
 
@@ -511,7 +512,7 @@ void WebContext::getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessPro
     m_databaseProcess->getDatabaseProcessConnection(reply);
 }
 
-void WebContext::databaseProcessCrashed(DatabaseProcessProxy* databaseProcessProxy)
+void WebProcessPool::databaseProcessCrashed(DatabaseProcessProxy* databaseProcessProxy)
 {
     ASSERT(m_databaseProcess);
     ASSERT(databaseProcessProxy == m_databaseProcess.get());
@@ -523,28 +524,26 @@ void WebContext::databaseProcessCrashed(DatabaseProcessProxy* databaseProcessPro
 }
 #endif
 
-void WebContext::willStartUsingPrivateBrowsing()
+void WebProcessPool::willStartUsingPrivateBrowsing()
 {
-    const Vector<WebContext*>& contexts = allContexts();
-    for (size_t i = 0, count = contexts.size(); i < count; ++i)
-        contexts[i]->setAnyPageGroupMightHavePrivateBrowsingEnabled(true);
+    for (auto* processPool : allProcessPools())
+        processPool->setAnyPageGroupMightHavePrivateBrowsingEnabled(true);
 }
 
-void WebContext::willStopUsingPrivateBrowsing()
+void WebProcessPool::willStopUsingPrivateBrowsing()
 {
-    const Vector<WebContext*>& contexts = allContexts();
-    for (size_t i = 0, count = contexts.size(); i < count; ++i)
-        contexts[i]->setAnyPageGroupMightHavePrivateBrowsingEnabled(false);
+    for (auto* processPool : allProcessPools())
+        processPool->setAnyPageGroupMightHavePrivateBrowsingEnabled(false);
 }
 
-void WebContext::windowServerConnectionStateChanged()
+void WebProcessPool::windowServerConnectionStateChanged()
 {
     size_t processCount = m_processes.size();
     for (size_t i = 0; i < processCount; ++i)
         m_processes[i]->windowServerConnectionStateChanged();
 }
 
-void WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool privateBrowsingEnabled)
+void WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool privateBrowsingEnabled)
 {
     m_iconDatabase->setPrivateBrowsingEnabled(privateBrowsingEnabled);
 
@@ -565,12 +564,12 @@ void WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool privateBrow
 
 void (*s_invalidMessageCallback)(WKStringRef messageName);
 
-void WebContext::setInvalidMessageCallback(void (*invalidMessageCallback)(WKStringRef messageName))
+void WebProcessPool::setInvalidMessageCallback(void (*invalidMessageCallback)(WKStringRef messageName))
 {
     s_invalidMessageCallback = invalidMessageCallback;
 }
 
-void WebContext::didReceiveInvalidMessage(const IPC::StringReference& messageReceiverName, const IPC::StringReference& messageName)
+void WebProcessPool::didReceiveInvalidMessage(const IPC::StringReference& messageReceiverName, const IPC::StringReference& messageName)
 {
     if (!s_invalidMessageCallback)
         return;
@@ -583,14 +582,14 @@ void WebContext::didReceiveInvalidMessage(const IPC::StringReference& messageRec
     s_invalidMessageCallback(toAPI(API::String::create(messageNameStringBuilder.toString()).get()));
 }
 
-void WebContext::processDidCachePage(WebProcessProxy* process)
+void WebProcessPool::processDidCachePage(WebProcessProxy* process)
 {
     if (m_processWithPageCache && m_processWithPageCache != process)
         m_processWithPageCache->releasePageCache();
     m_processWithPageCache = process;
 }
 
-WebProcessProxy& WebContext::ensureSharedWebProcess()
+WebProcessProxy& WebProcessPool::ensureSharedWebProcess()
 {
     ASSERT(m_processModel == ProcessModelSharedSecondaryProcess);
     if (m_processes.isEmpty())
@@ -598,7 +597,7 @@ WebProcessProxy& WebContext::ensureSharedWebProcess()
     return *m_processes[0];
 }
 
-WebProcessProxy& WebContext::createNewWebProcess()
+WebProcessProxy& WebProcessPool::createNewWebProcess()
 {
 #if ENABLE(NETWORK_PROCESS)
     if (m_usesNetworkProcess)
@@ -742,7 +741,7 @@ WebProcessProxy& WebContext::createNewWebProcess()
     return process;
 }
 
-void WebContext::warmInitialProcess()  
+void WebProcessPool::warmInitialProcess()  
 {
     if (m_haveInitialEmptyProcess) {
         ASSERT(!m_processes.isEmpty());
@@ -756,7 +755,7 @@ void WebContext::warmInitialProcess()
     m_haveInitialEmptyProcess = true;
 }
 
-void WebContext::enableProcessTermination()
+void WebProcessPool::enableProcessTermination()
 {
     m_processTerminationEnabled = true;
     Vector<RefPtr<WebProcessProxy>> processes = m_processes;
@@ -766,7 +765,7 @@ void WebContext::enableProcessTermination()
     }
 }
 
-bool WebContext::shouldTerminate(WebProcessProxy* process)
+bool WebProcessPool::shouldTerminate(WebProcessProxy* process)
 {
     ASSERT(m_processes.contains(process));
 
@@ -781,22 +780,22 @@ bool WebContext::shouldTerminate(WebProcessProxy* process)
     return true;
 }
 
-void WebContext::processWillOpenConnection(WebProcessProxy* process)
+void WebProcessPool::processWillOpenConnection(WebProcessProxy* process)
 {
     m_storageManager->processWillOpenConnection(process);
 }
 
-void WebContext::processWillCloseConnection(WebProcessProxy* process)
+void WebProcessPool::processWillCloseConnection(WebProcessProxy* process)
 {
     m_storageManager->processWillCloseConnection(process);
 }
 
-void WebContext::applicationWillTerminate()
+void WebProcessPool::applicationWillTerminate()
 {
     m_storageManager->applicationWillTerminate();
 }
 
-void WebContext::processDidFinishLaunching(WebProcessProxy* process)
+void WebProcessPool::processDidFinishLaunching(WebProcessProxy* process)
 {
     ASSERT(m_processes.contains(process));
 
@@ -819,7 +818,7 @@ void WebContext::processDidFinishLaunching(WebProcessProxy* process)
     m_connectionClient.didCreateConnection(this, process->webConnection());
 }
 
-void WebContext::disconnectProcess(WebProcessProxy* process)
+void WebProcessPool::disconnectProcess(WebProcessProxy* process)
 {
     ASSERT(m_processes.contains(process));
 
@@ -853,7 +852,7 @@ void WebContext::disconnectProcess(WebProcessProxy* process)
     m_processes.remove(m_processes.find(process));
 }
 
-WebProcessProxy& WebContext::createNewWebProcessRespectingProcessCountLimit()
+WebProcessProxy& WebProcessPool::createNewWebProcessRespectingProcessCountLimit()
 {
     if (m_processes.size() < m_webProcessCountLimit)
         return createNewWebProcess();
@@ -866,7 +865,7 @@ WebProcessProxy& WebContext::createNewWebProcessRespectingProcessCountLimit()
     return *process;
 }
 
-PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient& pageClient, WebPageConfiguration configuration)
+PassRefPtr<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, WebPageConfiguration configuration)
 {
     if (!configuration.pageGroup)
         configuration.pageGroup = m_defaultPageGroup.ptr();
@@ -897,7 +896,7 @@ PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient& pageClient, WebPa
     return process->createWebPage(pageClient, WTF::move(configuration));
 }
 
-DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
+DownloadProxy* WebProcessPool::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
 {
     DownloadProxy* downloadProxy = createDownloadProxy(request);
     uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
@@ -914,7 +913,7 @@ DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const Resource
     return downloadProxy;
 }
 
-DownloadProxy* WebContext::resumeDownload(const API::Data* resumeData, const String& path)
+DownloadProxy* WebProcessPool::resumeDownload(const API::Data* resumeData, const String& path)
 {
     DownloadProxy* downloadProxy = createDownloadProxy(ResourceRequest());
 
@@ -933,7 +932,7 @@ DownloadProxy* WebContext::resumeDownload(const API::Data* resumeData, const Str
     return downloadProxy;
 }
 
-void WebContext::postMessageToInjectedBundle(const String& messageName, API::Object* messageBody)
+void WebProcessPool::postMessageToInjectedBundle(const String& messageName, API::Object* messageBody)
 {
     if (m_processes.isEmpty()) {
         if (m_processModel == ProcessModelSharedSecondaryProcess)
@@ -953,22 +952,22 @@ void WebContext::postMessageToInjectedBundle(const String& messageName, API::Obj
 
 // InjectedBundle client
 
-void WebContext::didReceiveMessageFromInjectedBundle(const String& messageName, API::Object* messageBody)
+void WebProcessPool::didReceiveMessageFromInjectedBundle(const String& messageName, API::Object* messageBody)
 {
     m_injectedBundleClient.didReceiveMessageFromInjectedBundle(this, messageName, messageBody);
 }
 
-void WebContext::didReceiveSynchronousMessageFromInjectedBundle(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
+void WebProcessPool::didReceiveSynchronousMessageFromInjectedBundle(const String& messageName, API::Object* messageBody, RefPtr<API::Object>& returnData)
 {
     m_injectedBundleClient.didReceiveSynchronousMessageFromInjectedBundle(this, messageName, messageBody, returnData);
 }
 
-void WebContext::populateVisitedLinks()
+void WebProcessPool::populateVisitedLinks()
 {
     m_historyClient->populateVisitedLinks(*this);
 }
 
-WebContext::Statistics& WebContext::statistics()
+WebProcessPool::Statistics& WebProcessPool::statistics()
 {
     static Statistics statistics = Statistics();
 
@@ -976,7 +975,7 @@ WebContext::Statistics& WebContext::statistics()
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-void WebContext::setAdditionalPluginsDirectory(const String& directory)
+void WebProcessPool::setAdditionalPluginsDirectory(const String& directory)
 {
     Vector<String> directories;
     directories.append(directory);
@@ -985,37 +984,37 @@ void WebContext::setAdditionalPluginsDirectory(const String& directory)
 }
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
-void WebContext::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
+void WebProcessPool::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
 {
     m_alwaysUsesComplexTextCodePath = alwaysUseComplexText;
     sendToAllProcesses(Messages::WebProcess::SetAlwaysUsesComplexTextCodePath(alwaysUseComplexText));
 }
 
-void WebContext::setShouldUseFontSmoothing(bool useFontSmoothing)
+void WebProcessPool::setShouldUseFontSmoothing(bool useFontSmoothing)
 {
     m_shouldUseFontSmoothing = useFontSmoothing;
     sendToAllProcesses(Messages::WebProcess::SetShouldUseFontSmoothing(useFontSmoothing));
 }
 
-void WebContext::registerURLSchemeAsEmptyDocument(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsEmptyDocument(const String& urlScheme)
 {
     m_schemesToRegisterAsEmptyDocument.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsEmptyDocument(urlScheme));
 }
 
-void WebContext::registerURLSchemeAsSecure(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsSecure(const String& urlScheme)
 {
     m_schemesToRegisterAsSecure.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsSecure(urlScheme));
 }
 
-void WebContext::setDomainRelaxationForbiddenForURLScheme(const String& urlScheme)
+void WebProcessPool::setDomainRelaxationForbiddenForURLScheme(const String& urlScheme)
 {
     m_schemesToSetDomainRelaxationForbiddenFor.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::SetDomainRelaxationForbiddenForURLScheme(urlScheme));
 }
 
-void WebContext::setCanHandleHTTPSServerTrustEvaluation(bool value)
+void WebProcessPool::setCanHandleHTTPSServerTrustEvaluation(bool value)
 {
 #if ENABLE(NETWORK_PROCESS)
     m_canHandleHTTPSServerTrustEvaluation = value;
@@ -1028,67 +1027,67 @@ void WebContext::setCanHandleHTTPSServerTrustEvaluation(bool value)
 #endif
 }
 
-void WebContext::registerURLSchemeAsLocal(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsLocal(const String& urlScheme)
 {
     m_schemesToRegisterAsLocal.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsLocal(urlScheme));
 }
 
-void WebContext::registerURLSchemeAsNoAccess(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsNoAccess(const String& urlScheme)
 {
     m_schemesToRegisterAsNoAccess.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsNoAccess(urlScheme));
 }
 
-void WebContext::registerURLSchemeAsDisplayIsolated(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsDisplayIsolated(const String& urlScheme)
 {
     m_schemesToRegisterAsDisplayIsolated.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsDisplayIsolated(urlScheme));
 }
 
-void WebContext::registerURLSchemeAsCORSEnabled(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsCORSEnabled(const String& urlScheme)
 {
     m_schemesToRegisterAsCORSEnabled.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCORSEnabled(urlScheme));
 }
 
-HashSet<String>& WebContext::globalURLSchemesWithCustomProtocolHandlers()
+HashSet<String>& WebProcessPool::globalURLSchemesWithCustomProtocolHandlers()
 {
     static NeverDestroyed<HashSet<String>> set;
     return set;
 }
 
-void WebContext::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(const String& urlScheme)
+void WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(const String& urlScheme)
 {
     if (!urlScheme)
         return;
 
     String schemeLower = urlScheme.lower();
     globalURLSchemesWithCustomProtocolHandlers().add(schemeLower);
-    for (auto* context : allContexts())
-        context->registerSchemeForCustomProtocol(schemeLower);
+    for (auto* processPool : allProcessPools())
+        processPool->registerSchemeForCustomProtocol(schemeLower);
 }
 
-void WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(const String& urlScheme)
+void WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(const String& urlScheme)
 {
     if (!urlScheme)
         return;
 
     String schemeLower = urlScheme.lower();
     globalURLSchemesWithCustomProtocolHandlers().remove(schemeLower);
-    for (auto* context : allContexts())
-        context->unregisterSchemeForCustomProtocol(schemeLower);
+    for (auto* processPool : allProcessPools())
+        processPool->unregisterSchemeForCustomProtocol(schemeLower);
 }
 
 #if ENABLE(CACHE_PARTITIONING)
-void WebContext::registerURLSchemeAsCachePartitioned(const String& urlScheme)
+void WebProcessPool::registerURLSchemeAsCachePartitioned(const String& urlScheme)
 {
     m_schemesToRegisterAsCachePartitioned.add(urlScheme);
     sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCachePartitioned(urlScheme));
 }
 #endif
 
-void WebContext::setCacheModel(CacheModel cacheModel)
+void WebProcessPool::setCacheModel(CacheModel cacheModel)
 {
     m_cacheModel = cacheModel;
     sendToAllProcesses(Messages::WebProcess::SetCacheModel(static_cast<uint32_t>(m_cacheModel)));
@@ -1096,12 +1095,12 @@ void WebContext::setCacheModel(CacheModel cacheModel)
     // FIXME: Inform the Network Process if in use.
 }
 
-void WebContext::setDefaultRequestTimeoutInterval(double timeoutInterval)
+void WebProcessPool::setDefaultRequestTimeoutInterval(double timeoutInterval)
 {
     sendToAllProcesses(Messages::WebProcess::SetDefaultRequestTimeoutInterval(timeoutInterval));
 }
 
-DownloadProxy* WebContext::createDownloadProxy(const ResourceRequest& request)
+DownloadProxy* WebProcessPool::createDownloadProxy(const ResourceRequest& request)
 {
 #if ENABLE(NETWORK_PROCESS)
     if (usesNetworkProcess()) {
@@ -1114,35 +1113,35 @@ DownloadProxy* WebContext::createDownloadProxy(const ResourceRequest& request)
     return ensureSharedWebProcess().createDownloadProxy(request);
 }
 
-void WebContext::addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver& messageReceiver)
+void WebProcessPool::addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver& messageReceiver)
 {
     m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
 }
 
-void WebContext::addMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID, IPC::MessageReceiver& messageReceiver)
+void WebProcessPool::addMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID, IPC::MessageReceiver& messageReceiver)
 {
     m_messageReceiverMap.addMessageReceiver(messageReceiverName, destinationID, messageReceiver);
 }
 
-void WebContext::removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID)
+void WebProcessPool::removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID)
 {
     m_messageReceiverMap.removeMessageReceiver(messageReceiverName, destinationID);
 }
 
-bool WebContext::dispatchMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder)
+bool WebProcessPool::dispatchMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder)
 {
     return m_messageReceiverMap.dispatchMessage(connection, decoder);
 }
 
-bool WebContext::dispatchSyncMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder, std::unique_ptr<IPC::MessageEncoder>& replyEncoder)
+bool WebProcessPool::dispatchSyncMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder, std::unique_ptr<IPC::MessageEncoder>& replyEncoder)
 {
     return m_messageReceiverMap.dispatchSyncMessage(connection, decoder, replyEncoder);
 }
 
-void WebContext::didReceiveMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder)
+void WebProcessPool::didReceiveMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder)
 {
-    if (decoder.messageReceiverName() == Messages::WebContext::messageReceiverName()) {
-        didReceiveWebContextMessage(connection, decoder);
+    if (decoder.messageReceiverName() == Messages::WebProcessPool::messageReceiverName()) {
+        didReceiveWebProcessPoolMessage(connection, decoder);
         return;
     }
 
@@ -1163,10 +1162,10 @@ void WebContext::didReceiveMessage(IPC::Connection* connection, IPC::MessageDeco
     ASSERT_NOT_REACHED();
 }
 
-void WebContext::didReceiveSyncMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder, std::unique_ptr<IPC::MessageEncoder>& replyEncoder)
+void WebProcessPool::didReceiveSyncMessage(IPC::Connection* connection, IPC::MessageDecoder& decoder, std::unique_ptr<IPC::MessageEncoder>& replyEncoder)
 {
-    if (decoder.messageReceiverName() == Messages::WebContext::messageReceiverName()) {
-        didReceiveSyncWebContextMessage(connection, decoder, replyEncoder);
+    if (decoder.messageReceiverName() == Messages::WebProcessPool::messageReceiverName()) {
+        didReceiveSyncWebProcessPoolMessage(connection, decoder, replyEncoder);
         return;
     }
 
@@ -1193,12 +1192,12 @@ void WebContext::didReceiveSyncMessage(IPC::Connection* connection, IPC::Message
     ASSERT_NOT_REACHED();
 }
 
-void WebContext::setEnhancedAccessibility(bool flag)
+void WebProcessPool::setEnhancedAccessibility(bool flag)
 {
     sendToAllProcesses(Messages::WebProcess::SetEnhancedAccessibility(flag));
 }
     
-void WebContext::startMemorySampler(const double interval)
+void WebProcessPool::startMemorySampler(const double interval)
 {    
     // For new WebProcesses we will also want to start the Memory Sampler
     m_memorySamplerEnabled = true;
@@ -1218,7 +1217,7 @@ void WebContext::startMemorySampler(const double interval)
     sendToAllProcesses(Messages::WebProcess::StartMemorySampler(sampleLogSandboxHandle, sampleLogFilePath, interval));
 }
 
-void WebContext::stopMemorySampler()
+void WebProcessPool::stopMemorySampler()
 {    
     // For WebProcess
     m_memorySamplerEnabled = false;
@@ -1231,7 +1230,7 @@ void WebContext::stopMemorySampler()
     sendToAllProcesses(Messages::WebProcess::StopMemorySampler());
 }
 
-String WebContext::applicationCacheDirectory() const
+String WebProcessPool::applicationCacheDirectory() const
 {
     if (!m_overrideApplicationCacheDirectory.isEmpty())
         return m_overrideApplicationCacheDirectory;
@@ -1239,7 +1238,7 @@ String WebContext::applicationCacheDirectory() const
     return platformDefaultApplicationCacheDirectory();
 }
 
-void WebContext::setIconDatabasePath(const String& path)
+void WebProcessPool::setIconDatabasePath(const String& path)
 {
     m_overrideIconDatabasePath = path;
     if (!m_overrideIconDatabasePath.isEmpty()) {
@@ -1248,7 +1247,7 @@ void WebContext::setIconDatabasePath(const String& path)
     }
 }
 
-String WebContext::iconDatabasePath() const
+String WebProcessPool::iconDatabasePath() const
 {
     if (!m_overrideIconDatabasePath.isNull())
         return m_overrideIconDatabasePath;
@@ -1256,7 +1255,7 @@ String WebContext::iconDatabasePath() const
     return platformDefaultIconDatabasePath();
 }
 
-String WebContext::diskCacheDirectory() const
+String WebProcessPool::diskCacheDirectory() const
 {
     if (!m_overrideDiskCacheDirectory.isEmpty())
         return m_overrideDiskCacheDirectory;
@@ -1264,7 +1263,7 @@ String WebContext::diskCacheDirectory() const
     return platformDefaultDiskCacheDirectory();
 }
 
-String WebContext::cookieStorageDirectory() const
+String WebProcessPool::cookieStorageDirectory() const
 {
     if (!m_overrideCookieStorageDirectory.isEmpty())
         return m_overrideCookieStorageDirectory;
@@ -1272,7 +1271,7 @@ String WebContext::cookieStorageDirectory() const
     return platformDefaultCookieStorageDirectory();
 }
 
-void WebContext::useTestingNetworkSession()
+void WebProcessPool::useTestingNetworkSession()
 {
     ASSERT(m_processes.isEmpty());
 #if ENABLE(NETWORK_PROCESS)
@@ -1288,7 +1287,7 @@ void WebContext::useTestingNetworkSession()
     m_shouldUseTestingNetworkSession = true;
 }
 
-void WebContext::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host)
+void WebProcessPool::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host)
 {
 #if ENABLE(NETWORK_PROCESS)
     if (m_usesNetworkProcess && m_networkProcess) {
@@ -1310,7 +1309,7 @@ void WebContext::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo*
 #endif
 }
 
-void WebContext::setHTTPPipeliningEnabled(bool enabled)
+void WebProcessPool::setHTTPPipeliningEnabled(bool enabled)
 {
 #if PLATFORM(COCOA)
     ResourceRequest::setHTTPPipeliningEnabled(enabled);
@@ -1319,7 +1318,7 @@ void WebContext::setHTTPPipeliningEnabled(bool enabled)
 #endif
 }
 
-bool WebContext::httpPipeliningEnabled() const
+bool WebProcessPool::httpPipeliningEnabled() const
 {
 #if PLATFORM(COCOA)
     return ResourceRequest::httpPipeliningEnabled();
@@ -1328,7 +1327,7 @@ bool WebContext::httpPipeliningEnabled() const
 #endif
 }
 
-void WebContext::getStatistics(uint32_t statisticsMask, std::function<void (ImmutableDictionary*, CallbackBase::Error)> callbackFunction)
+void WebProcessPool::getStatistics(uint32_t statisticsMask, std::function<void (ImmutableDictionary*, CallbackBase::Error)> callbackFunction)
 {
     if (!statisticsMask) {
         callbackFunction(nullptr, CallbackBase::Error::Unknown);
@@ -1344,7 +1343,7 @@ void WebContext::getStatistics(uint32_t statisticsMask, std::function<void (Immu
         requestNetworkingStatistics(request.get());
 }
 
-void WebContext::requestWebContentStatistics(StatisticsRequest* request)
+void WebProcessPool::requestWebContentStatistics(StatisticsRequest* request)
 {
     if (m_processModel == ProcessModelSharedSecondaryProcess) {
         if (m_processes.isEmpty())
@@ -1359,7 +1358,7 @@ void WebContext::requestWebContentStatistics(StatisticsRequest* request)
     }
 }
 
-void WebContext::requestNetworkingStatistics(StatisticsRequest* request)
+void WebProcessPool::requestNetworkingStatistics(StatisticsRequest* request)
 {
     bool networkProcessUnavailable;
 #if ENABLE(NETWORK_PROCESS)
@@ -1383,12 +1382,12 @@ void WebContext::requestNetworkingStatistics(StatisticsRequest* request)
 }
 
 #if !PLATFORM(COCOA)
-void WebContext::dummy(bool&)
+void WebProcessPool::dummy(bool&)
 {
 }
 #endif
 
-void WebContext::didGetStatistics(const StatisticsData& statisticsData, uint64_t requestID)
+void WebProcessPool::didGetStatistics(const StatisticsData& statisticsData, uint64_t requestID)
 {
     RefPtr<StatisticsRequest> request = m_statisticsRequests.take(requestID);
     if (!request) {
@@ -1399,58 +1398,58 @@ void WebContext::didGetStatistics(const StatisticsData& statisticsData, uint64_t
     request->completedRequest(requestID, statisticsData);
 }
 
-void WebContext::garbageCollectJavaScriptObjects()
+void WebProcessPool::garbageCollectJavaScriptObjects()
 {
     sendToAllProcesses(Messages::WebProcess::GarbageCollectJavaScriptObjects());
 }
 
-void WebContext::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
+void WebProcessPool::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
 {
     sendToAllProcesses(Messages::WebProcess::SetJavaScriptGarbageCollectorTimerEnabled(flag));
 }
 
-void WebContext::addPlugInAutoStartOriginHash(const String& pageOrigin, unsigned plugInOriginHash, SessionID sessionID)
+void WebProcessPool::addPlugInAutoStartOriginHash(const String& pageOrigin, unsigned plugInOriginHash, SessionID sessionID)
 {
     m_plugInAutoStartProvider.addAutoStartOriginHash(pageOrigin, plugInOriginHash, sessionID);
 }
 
-void WebContext::plugInDidReceiveUserInteraction(unsigned plugInOriginHash, SessionID sessionID)
+void WebProcessPool::plugInDidReceiveUserInteraction(unsigned plugInOriginHash, SessionID sessionID)
 {
     m_plugInAutoStartProvider.didReceiveUserInteraction(plugInOriginHash, sessionID);
 }
 
-PassRefPtr<ImmutableDictionary> WebContext::plugInAutoStartOriginHashes() const
+PassRefPtr<ImmutableDictionary> WebProcessPool::plugInAutoStartOriginHashes() const
 {
     return m_plugInAutoStartProvider.autoStartOriginsTableCopy();
 }
 
-void WebContext::setPlugInAutoStartOriginHashes(ImmutableDictionary& dictionary)
+void WebProcessPool::setPlugInAutoStartOriginHashes(ImmutableDictionary& dictionary)
 {
     m_plugInAutoStartProvider.setAutoStartOriginsTable(dictionary);
 }
 
-void WebContext::setPlugInAutoStartOrigins(API::Array& array)
+void WebProcessPool::setPlugInAutoStartOrigins(API::Array& array)
 {
     m_plugInAutoStartProvider.setAutoStartOriginsArray(array);
 }
 
-void WebContext::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime(ImmutableDictionary& dictionary, double time)
+void WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime(ImmutableDictionary& dictionary, double time)
 {
     m_plugInAutoStartProvider.setAutoStartOriginsFilteringOutEntriesAddedAfterTime(dictionary, time);
 }
 
-void WebContext::registerSchemeForCustomProtocol(const String& scheme)
+void WebProcessPool::registerSchemeForCustomProtocol(const String& scheme)
 {
     sendToNetworkingProcess(Messages::CustomProtocolManager::RegisterScheme(scheme));
 }
 
-void WebContext::unregisterSchemeForCustomProtocol(const String& scheme)
+void WebProcessPool::unregisterSchemeForCustomProtocol(const String& scheme)
 {
     sendToNetworkingProcess(Messages::CustomProtocolManager::UnregisterScheme(scheme));
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-void WebContext::pluginInfoStoreDidLoadPlugins(PluginInfoStore* store)
+void WebProcessPool::pluginInfoStoreDidLoadPlugins(PluginInfoStore* store)
 {
 #ifdef NDEBUG
     UNUSED_PARAM(store);
@@ -1487,7 +1486,7 @@ void WebContext::pluginInfoStoreDidLoadPlugins(PluginInfoStore* store)
 }
 #endif
     
-void WebContext::setMemoryCacheDisabled(bool disabled)
+void WebProcessPool::setMemoryCacheDisabled(bool disabled)
 {
     m_memoryCacheDisabled = disabled;
     sendToAllProcesses(Messages::WebProcess::SetMemoryCacheDisabled(disabled));
similarity index 94%
rename from Source/WebKit2/UIProcess/WebContext.h
rename to Source/WebKit2/UIProcess/WebProcessPool.h
index d78cbdd..76a7e96 100644 (file)
@@ -23,8 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebContext_h
-#define WebContext_h
+#ifndef WebProcessPool_h
+#define WebProcessPool_h
 
 #include "APIObject.h"
 #include "DownloadProxyMap.h"
@@ -97,7 +97,7 @@ int webProcessLatencyQOS();
 int webProcessThroughputQOS();
 #endif
 
-struct WebContextConfiguration {
+struct WebProcessPoolConfiguration {
     String injectedBundlePath;
     String localStorageDirectory;
     String webSQLDatabaseDirectory;
@@ -105,20 +105,20 @@ struct WebContextConfiguration {
     String mediaKeysStorageDirectory;
 };
 
-class WebContext : public API::ObjectImpl<API::Object::Type::Context>, private IPC::MessageReceiver
+class WebProcessPool : public API::ObjectImpl<API::Object::Type::ProcessPool>, private IPC::MessageReceiver
 #if ENABLE(NETSCAPE_PLUGIN_API)
     , private PluginInfoStoreClient
 #endif
     {
 public:
-    static void applyPlatformSpecificConfigurationDefaults(WebContextConfiguration&);
+    static void applyPlatformSpecificConfigurationDefaults(WebProcessPoolConfiguration&);
 
-    WebContext(WebContextConfiguration);
+    WebProcessPool(WebProcessPoolConfiguration);
         
-    static PassRefPtr<WebContext> create(WebContextConfiguration);
-    virtual ~WebContext();
+    static PassRefPtr<WebProcessPool> create(WebProcessPoolConfiguration);
+    virtual ~WebProcessPool();
 
-    static const Vector<WebContext*>& allContexts();
+    static const Vector<WebProcessPool*>& allProcessPools();
 
     template <typename T>
     T* supplement()
@@ -414,9 +414,9 @@ private:
 
     void didGetStatistics(const StatisticsData&, uint64_t callbackID);
 
-    // Implemented in generated WebContextMessageReceiver.cpp
-    void didReceiveWebContextMessage(IPC::Connection*, IPC::MessageDecoder&);
-    void didReceiveSyncWebContextMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
+    // Implemented in generated WebProcessPoolMessageReceiver.cpp
+    void didReceiveWebProcessPoolMessage(IPC::Connection*, IPC::MessageDecoder&);
+    void didReceiveSyncWebProcessPoolMessage(IPC::Connection*, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
 
     static void languageChanged(void* context);
     void languageChanged();
@@ -579,7 +579,7 @@ private:
 };
 
 template<typename T>
-void WebContext::sendToNetworkingProcess(T&& message)
+void WebProcessPool::sendToNetworkingProcess(T&& message)
 {
     switch (m_processModel) {
     case ProcessModelSharedSecondaryProcess:
@@ -606,7 +606,7 @@ void WebContext::sendToNetworkingProcess(T&& message)
 }
 
 template<typename T>
-void WebContext::sendToNetworkingProcessRelaunchingIfNecessary(T&& message)
+void WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary(T&& message)
 {
     switch (m_processModel) {
     case ProcessModelSharedSecondaryProcess:
@@ -633,7 +633,7 @@ void WebContext::sendToNetworkingProcessRelaunchingIfNecessary(T&& message)
 }
 
 template<typename T>
-void WebContext::sendToDatabaseProcessRelaunchingIfNecessary(T&& message)
+void WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary(T&& message)
 {
 #if ENABLE(DATABASE_PROCESS)
     ensureDatabaseProcess();
@@ -644,7 +644,7 @@ void WebContext::sendToDatabaseProcessRelaunchingIfNecessary(T&& message)
 }
 
 template<typename T>
-void WebContext::sendToAllProcesses(const T& message)
+void WebProcessPool::sendToAllProcesses(const T& message)
 {
     size_t processCount = m_processes.size();
     for (size_t i = 0; i < processCount; ++i) {
@@ -655,16 +655,16 @@ void WebContext::sendToAllProcesses(const T& message)
 }
 
 template<typename T>
-void WebContext::sendToAllProcessesRelaunchingThemIfNecessary(const T& message)
+void WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary(const T& message)
 {
-// FIXME (Multi-WebProcess): WebContext doesn't track processes that have exited, so it cannot relaunch these. Perhaps this functionality won't be needed in this mode.
+    // FIXME (Multi-WebProcess): WebProcessPool doesn't track processes that have exited, so it cannot relaunch these. Perhaps this functionality won't be needed in this mode.
     if (m_processModel == ProcessModelSharedSecondaryProcess)
         ensureSharedWebProcess();
     sendToAllProcesses(message);
 }
 
 template<typename T>
-void WebContext::sendToOneProcess(T&& message)
+void WebProcessPool::sendToOneProcess(T&& message)
 {
     if (m_processModel == ProcessModelSharedSecondaryProcess)
         ensureSharedWebProcess();
@@ -690,4 +690,4 @@ void WebContext::sendToOneProcess(T&& message)
 
 } // namespace WebKit
 
-#endif // WebContext_h
+#endif // UIProcessPool_h
@@ -20,7 +20,7 @@
 # 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.
 
-messages -> WebContext LegacyReceiver {
+messages -> WebProcessPool LegacyReceiver {
 
     DidGetStatistics(struct WebKit::StatisticsData statisticsData, uint64_t callbackID)
 
index 1731d23..ebb6754 100644 (file)
@@ -39,7 +39,6 @@
 #include "UserData.h"
 #include "WebUserContentControllerProxy.h"
 #include "WebBackForwardListItem.h"
-#include "WebContext.h"
 #include "WebInspectorProxy.h"
 #include "WebNavigationDataStore.h"
 #include "WebNotificationManagerProxy.h"
@@ -47,6 +46,7 @@
 #include "WebPageProxy.h"
 #include "WebPluginSiteDataManager.h"
 #include "WebProcessMessages.h"
+#include "WebProcessPool.h"
 #include "WebProcessProxyMessages.h"
 #include <WebCore/SuddenTermination.h>
 #include <WebCore/URL.h>
@@ -84,16 +84,16 @@ static WebProcessProxy::WebPageProxyMap& globalPageMap()
     return pageMap;
 }
 
-Ref<WebProcessProxy> WebProcessProxy::create(WebContext& context)
+Ref<WebProcessProxy> WebProcessProxy::create(WebProcessPool& processPool)
 {
-    return adoptRef(*new WebProcessProxy(context));
+    return adoptRef(*new WebProcessProxy(processPool));
 }
 
-WebProcessProxy::WebProcessProxy(WebContext& context)
+WebProcessProxy::WebProcessProxy(WebProcessPool& processPool)
     : m_responsivenessTimer(this)
-    , m_context(context)
+    , m_processPool(processPool)
     , m_mayHaveUniversalFileReadSandboxExtension(false)
-    , m_customProtocolManagerProxy(this, context)
+    , m_customProtocolManagerProxy(this, processPool)
     , m_numberOfTimesSuddenTerminationWasDisabled(0)
     , m_throttler(std::make_unique<ProcessThrottler>(this))
 {
@@ -113,7 +113,7 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt
 {
     launchOptions.processType = ProcessLauncher::WebProcess;
 #if ENABLE(INSPECTOR)
-    if (&m_context.get() == &WebInspectorProxy::inspectorContext())
+    if (&m_processPool.get() == &WebInspectorProxy::inspectorProcessPool())
         launchOptions.extraInitializationData.add(ASCIILiteral("inspector-process"), ASCIILiteral("1"));
 #endif
     platformGetLaunchOptions(launchOptions);
@@ -130,7 +130,7 @@ void WebProcessProxy::connectionWillOpen(IPC::Connection* connection)
     for (WebPageProxyMap::iterator it = m_pageMap.begin(), end = m_pageMap.end(); it != end; ++it)
         it->value->connectionWillOpen(connection);
 
-    m_context->processWillOpenConnection(this);
+    m_processPool->processWillOpenConnection(this);
 }
 
 void WebProcessProxy::connectionWillClose(IPC::Connection* connection)
@@ -140,7 +140,7 @@ void WebProcessProxy::connectionWillClose(IPC::Connection* connection)
     for (WebPageProxyMap::iterator it = m_pageMap.begin(), end = m_pageMap.end(); it != end; ++it)
         it->value->connectionWillClose(connection);
 
-    m_context->processWillCloseConnection(this);
+    m_processPool->processWillCloseConnection(this);
 }
 
 void WebProcessProxy::disconnect()
@@ -173,7 +173,7 @@ void WebProcessProxy::disconnect()
         webUserContentControllerProxy->removeProcess(*this);
     m_webUserContentControllerProxies.clear();
 
-    m_context->disconnectProcess(this);
+    m_processPool->disconnectProcess(this);
 }
 
 WebPageProxy* WebProcessProxy::webPage(uint64_t pageID)
@@ -216,7 +216,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_context->usesNetworkProcess() || state() == State::Terminated || !canTerminateChildProcess())
+    if (!m_processPool->usesNetworkProcess() || state() == State::Terminated || !canTerminateChildProcess())
         return;
 
     abortProcessLaunchIfNeeded();
@@ -365,15 +365,15 @@ void WebProcessProxy::addBackForwardItem(uint64_t itemID, uint64_t pageID, const
 void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins)
 {
     if (refresh)
-        m_context->pluginInfoStore().refresh();
+        m_processPool->pluginInfoStore().refresh();
 
-    Vector<PluginModuleInfo> pluginModules = m_context->pluginInfoStore().plugins();
+    Vector<PluginModuleInfo> pluginModules = m_processPool->pluginInfoStore().plugins();
     for (size_t i = 0; i < pluginModules.size(); ++i)
         plugins.append(pluginModules[i].info);
 
 #if ENABLE(PDFKIT_PLUGIN)
     // Add built-in PDF last, so that it's not used when a real plug-in is installed.
-    if (!m_context->omitPDFSupport()) {
+    if (!m_processPool->omitPDFSupport()) {
         plugins.append(PDFPlugin::pluginInfo());
         applicationPlugins.append(PDFPlugin::pluginInfo());
     }
@@ -393,14 +393,14 @@ void WebProcessProxy::getPluginProcessConnection(uint64_t pluginProcessToken, Pa
 #if ENABLE(NETWORK_PROCESS)
 void WebProcessProxy::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
 {
-    m_context->getNetworkProcessConnection(reply);
+    m_processPool->getNetworkProcessConnection(reply);
 }
 #endif // ENABLE(NETWORK_PROCESS)
 
 #if ENABLE(DATABASE_PROCESS)
 void WebProcessProxy::getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply> reply)
 {
-    m_context->getDatabaseProcessConnection(reply);
+    m_processPool->getDatabaseProcessConnection(reply);
 }
 #endif // ENABLE(DATABASE_PROCESS)
 
@@ -409,7 +409,7 @@ void WebProcessProxy::didReceiveMessage(IPC::Connection* connection, IPC::Messag
     if (dispatchMessage(connection, decoder))
         return;
 
-    if (m_context->dispatchMessage(connection, decoder))
+    if (m_processPool->dispatchMessage(connection, decoder))
         return;
 
     if (decoder.messageReceiverName() == Messages::WebProcessProxy::messageReceiverName()) {
@@ -425,7 +425,7 @@ void WebProcessProxy::didReceiveSyncMessage(IPC::Connection* connection, IPC::Me
     if (dispatchSyncMessage(connection, decoder, replyEncoder))
         return;
 
-    if (m_context->dispatchSyncMessage(connection, decoder, replyEncoder))
+    if (m_processPool->dispatchSyncMessage(connection, decoder, replyEncoder))
         return;
 
     if (decoder.messageReceiverName() == Messages::WebProcessProxy::messageReceiverName()) {
@@ -458,7 +458,7 @@ void WebProcessProxy::didReceiveInvalidMessage(IPC::Connection* connection, IPC:
 {
     WTFLogAlways("Received an invalid message \"%s.%s\" from the web process.\n", messageReceiverName.toString().data(), messageName.toString().data());
 
-    WebContext::didReceiveInvalidMessage(messageReceiverName, messageName);
+    WebProcessPool::didReceiveInvalidMessage(messageReceiverName, messageName);
 
     // Terminate the WebProcess.
     terminate();
@@ -503,7 +503,7 @@ void WebProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Connect
 
     m_webConnection = WebConnectionToWebProcess::create(this);
 
-    m_context->processDidFinishLaunching(this);
+    m_processPool->processDidFinishLaunching(this);
 
 #if PLATFORM(IOS) && USE(XPC_SERVICES)
     xpc_connection_t xpcConnection = connection()->xpcConnection();
@@ -568,7 +568,7 @@ bool WebProcessProxy::canTerminateChildProcess()
     if (m_downloadProxyMap && !m_downloadProxyMap->isEmpty())
         return false;
 
-    if (!m_context->shouldTerminate(this))
+    if (!m_processPool->shouldTerminate(this))
         return false;
 
     return true;
@@ -578,7 +578,7 @@ void WebProcessProxy::shouldTerminate(bool& shouldTerminate)
 {
     shouldTerminate = canTerminateChildProcess();
     if (shouldTerminate) {
-        // We know that the web process is going to terminate so disconnect it from the context.
+        // We know that the web process is going to terminate so disconnect it from the process pool.
         disconnect();
     }
 }
@@ -592,18 +592,18 @@ void WebProcessProxy::updateTextCheckerState()
 DownloadProxy* WebProcessProxy::createDownloadProxy(const ResourceRequest& request)
 {
 #if ENABLE(NETWORK_PROCESS)
-    ASSERT(!m_context->usesNetworkProcess());
+    ASSERT(!m_processPool->usesNetworkProcess());
 #endif
 
     if (!m_downloadProxyMap)
         m_downloadProxyMap = std::make_unique<DownloadProxyMap>(this);
 
-    return m_downloadProxyMap->createDownloadProxy(m_context, request);
+    return m_downloadProxyMap->createDownloadProxy(m_processPool, request);
 }
 
 void WebProcessProxy::didSaveToPageCache()
 {
-    m_context->processDidCachePage(this);
+    m_processPool->processDidCachePage(this);
 }
 
 void WebProcessProxy::releasePageCache()
index 0f50ae5..53b35b3 100644 (file)
@@ -58,8 +58,8 @@ namespace WebKit {
 
 class DownloadProxyMap;
 class WebBackForwardListItem;
-class WebContext;
 class WebPageGroup;
+class WebProcessPool;
 struct WebNavigationDataStore;
     
 class WebProcessProxy : public ChildProcessProxy, ResponsivenessTimer::Client {
@@ -68,7 +68,7 @@ public:
     typedef HashMap<uint64_t, RefPtr<WebFrameProxy>> WebFrameProxyMap;
     typedef HashMap<uint64_t, WebPageProxy*> WebPageProxyMap;
 
-    static Ref<WebProcessProxy> create(WebContext&);
+    static Ref<WebProcessProxy> create(WebProcessPool&);
     ~WebProcessProxy();
 
     static WebProcessProxy* fromConnection(IPC::Connection* connection)
@@ -78,7 +78,7 @@ public:
 
     WebConnection* webConnection() const { return m_webConnection.get(); }
 
-    WebContext& context() { return m_context; }
+    WebProcessPool& processPool() { return m_processPool; }
 
     static WebPageProxy* webPage(uint64_t pageID);
     Ref<WebPageProxy> createWebPage(PageClient&, const WebPageConfiguration&);
@@ -140,7 +140,7 @@ public:
     ProcessThrottler& throttler() { return *m_throttler; }
     
 private:
-    explicit WebProcessProxy(WebContext&);
+    explicit WebProcessProxy(WebProcessPool&);
 
     // From ChildProcessProxy
     virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
@@ -196,7 +196,7 @@ private:
     ResponsivenessTimer m_responsivenessTimer;
     
     RefPtr<WebConnectionToWebProcess> m_webConnection;
-    Ref<WebContext> m_context;
+    Ref<WebProcessPool> m_processPool;
 
     bool m_mayHaveUniversalFileReadSandboxExtension; // True if a read extension for "/" was ever granted - we don't track whether WebProcess still has it.
     HashSet<String> m_localPathsWithAssumedReadAccess;
index 559fd89..8381160 100644 (file)
@@ -29,7 +29,7 @@
 #include "APISecurityOrigin.h"
 #include "ImmutableDictionary.h"
 #include "SecurityOriginData.h"
-#include "WebContext.h"
+#include "WebProcessPool.h"
 #include "WebResourceCacheManagerMessages.h"
 #include "WebResourceCacheManagerProxyMessages.h"
 
@@ -46,15 +46,15 @@ const char* WebResourceCacheManagerProxy::supplementName()
     return "WebResourceCacheManagerProxy";
 }
 
-PassRefPtr<WebResourceCacheManagerProxy> WebResourceCacheManagerProxy::create(WebContext* webContext)
+PassRefPtr<WebResourceCacheManagerProxy> WebResourceCacheManagerProxy::create(WebProcessPool* processPool)
 {
-    return adoptRef(new WebResourceCacheManagerProxy(webContext));
+    return adoptRef(new WebResourceCacheManagerProxy(processPool));
 }
 
-WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebContext* webContext)
-    : WebContextSupplement(webContext)
+WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebProcessPool* processPool)
+    : WebContextSupplement(processPool)
 {
-    WebContextSupplement::context()->addMessageReceiver(Messages::WebResourceCacheManagerProxy::messageReceiverName(), *this);
+    WebContextSupplement::processPool()->addMessageReceiver(Messages::WebResourceCacheManagerProxy::messageReceiverName(), *this);
 }
 
 WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()
@@ -63,7 +63,7 @@ WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()
 
 // WebContextSupplement
 
-void WebResourceCacheManagerProxy::contextDestroyed()
+void WebResourceCacheManagerProxy::processPoolDestroyed()
 {
     invalidateCallbackMap(m_arrayCallbacks, CallbackBase::Error::OwnerWasInvalidated);
 }
@@ -95,7 +95,7 @@ void WebResourceCacheManagerProxy::getCacheOrigins(std::function<void (API::Arra
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> When multi-process is enabled, we need to aggregate the callback data from all processes.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::GetCacheOrigins(callbackID));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::GetCacheOrigins(callbackID));
 }
 
 void WebResourceCacheManagerProxy::didGetCacheOrigins(const Vector<SecurityOriginData>& origins, uint64_t callbackID)
@@ -112,17 +112,17 @@ void WebResourceCacheManagerProxy::clearCacheForOrigin(API::SecurityOrigin* orig
     securityOrigin.port = origin->securityOrigin().port();
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> There is no need to relaunch all processes. One process to take care of persistent cache is enough.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForOrigin(securityOrigin, cachesToClear));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForOrigin(securityOrigin, cachesToClear));
 }
 
 void WebResourceCacheManagerProxy::clearCacheForAllOrigins(ResourceCachesToClear cachesToClear)
 {
 #if ENABLE(NETWORK_PROCESS)
-    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::NetworkProcess::ClearCacheForAllOrigins(cachesToClear));
+    processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::NetworkProcess::ClearCacheForAllOrigins(cachesToClear));
 #endif
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> There is no need to relaunch all processes. One process to take care of persistent cache is enough.
-    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));
+    processPool()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));
 }
 
 } // namespace WebKit
index a9e4549..7672a46 100644 (file)
@@ -38,7 +38,7 @@
 namespace WebKit {
 
 struct SecurityOriginData;
-class WebContext;
+class WebProcessPool;
 class WebProcessProxy;
 
 typedef GenericCallback<API::Array*> ArrayCallback;
@@ -47,7 +47,7 @@ class WebResourceCacheManagerProxy : public API::ObjectImpl<API::Object::Type::C
 public:
     static const char* supplementName();
 
-    static PassRefPtr<WebResourceCacheManagerProxy> create(WebContext*);
+    static PassRefPtr<WebResourceCacheManagerProxy> create(WebProcessPool*);
     virtual ~WebResourceCacheManagerProxy();
 
     void getCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
@@ -58,10 +58,10 @@ public:
     using API::Object::deref;
 
 private:
-    explicit WebResourceCacheManagerProxy(WebContext*);
+    explicit WebResourceCacheManagerProxy(WebProcessPool*);
 
     // WebContextSupplement
-    virtual void contextDestroyed() override;
+    virtual void processPoolDestroyed() override;
     virtual void processDidClose(WebProcessProxy*) override;
     virtual bool shouldTerminate(WebProcessProxy*) const override;
     virtual void refWebContextSupplement() override;
index 26c696e..9bf222a 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "WebsiteDataStore.h"
 
-#include "WebContext.h"
+#include "WebProcessPool.h"
 #include <wtf/RunLoop.h>
 
 namespace WebKit {
@@ -145,19 +145,19 @@ void WebsiteDataStore::removeData(WebsiteDataTypes dataTypes, std::chrono::syste
 
     auto networkProcessAccessType = computeNetworkProcessAccessType(dataTypes, isNonPersistent());
     if (networkProcessAccessType != ProcessAccessType::None) {
-        HashSet<WebContext*> contexts;
+        HashSet<WebProcessPool*> processPools;
         for (auto& webPage : m_webPages)
-            contexts.add(&webPage->process().context());
+            processPools.add(&webPage->process().processPool());
 
-        for (auto& context : contexts) {
+        for (auto& processPool : processPools) {
             switch (networkProcessAccessType) {
             case ProcessAccessType::OnlyIfLaunched:
-                if (!context->networkProcess())
+                if (!processPool->networkProcess())
                     continue;
                 break;
 
             case ProcessAccessType::Launch:
-                context->ensureNetworkProcess();
+                processPool->ensureNetworkProcess();
                 break;
 
             case ProcessAccessType::None:
@@ -165,7 +165,7 @@ void WebsiteDataStore::removeData(WebsiteDataTypes dataTypes, std::chrono::syste
             }
 
             callbackAggregator->addPendingCallback();
-            context->networkProcess()->deleteWebsiteData(m_sessionID, dataTypes, modifiedSince, [callbackAggregator] {
+            processPool->networkProcess()->deleteWebsiteData(m_sessionID, dataTypes, modifiedSince, [callbackAggregator] {
                 callbackAggregator->removePendingCallback();
             });
         }
index 91b3e41..9fe9f9c 100644 (file)
@@ -239,7 +239,7 @@ void PageClientImpl::toolTipChanged(const String&, const String&)
 
 bool PageClientImpl::decidePolicyForGeolocationPermissionRequest(WebFrameProxy& frame, API::SecurityOrigin& origin, GeolocationPermissionRequestProxy& request)
 {
-    [[wrapper(m_webView->_page->process().context()) _geolocationProvider] decidePolicyForGeolocationRequestFromOrigin:origin.securityOrigin() frame:frame request:request view:m_webView];
+    [[wrapper(m_webView->_page->process().processPool()) _geolocationProvider] decidePolicyForGeolocationRequestFromOrigin:origin.securityOrigin() frame:frame request:request view:m_webView];
     return true;
 }
 
index c6ca0e1..4791d87 100644 (file)
@@ -41,9 +41,9 @@ namespace WebKit {
 class DrawingAreaProxy;
 class GeolocationPermissionRequestProxy;
 class RemoteLayerTreeTransaction;
-class WebContext;
 class WebFrameProxy;
 class WebPageProxy;
+class WebProcessPool;
 struct WebPageConfiguration;
 }
 
@@ -61,7 +61,7 @@ struct WebPageConfiguration;
 @property (nonatomic, getter=isShowingInspectorIndication) BOOL showingInspectorIndication;
 @property (nonatomic, readonly) BOOL isBackground;
 
-- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
+- (instancetype)initWithFrame:(CGRect)frame processPool:(WebProcessPool&)processPool configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
 
 - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect
     unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
index 171e1b2..9ce2f3d 100644 (file)
 #import "WKProcessGroupPrivate.h"
 #import "WKWebViewConfiguration.h"
 #import "WKWebViewInternal.h"
-#import "WebContext.h"
 #import "WebFrameProxy.h"
 #import "WebKit2Initialize.h"
 #import "WebKitSystemInterfaceIOS.h"
 #import "WebPageGroup.h"
+#import "WebProcessPool.h"
 #import "WebSystemInterface.h"
 #import <CoreGraphics/CoreGraphics.h>
 #import <UIKit/UIWindow_Private.h>
@@ -182,7 +182,7 @@ private:
     RetainPtr<NSUndoManager> _undoManager;
 }
 
-- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView
+- (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView
 {
     if (!(self = [super initWithFrame:frame]))
         return nil;
@@ -191,7 +191,7 @@ private:
 
     _pageClient = std::make_unique<PageClientImpl>(self, webView);
 
-    _page = context.createWebPage(*_pageClient, WTF::move(webPageConfiguration));
+    _page = processPool.createWebPage(*_pageClient, WTF::move(webPageConfiguration));
     _page->initializeWebPage();
     _page->setIntrinsicDeviceScaleFactor(WKGetScaleFactorForScreen([UIScreen mainScreen]));
     _page->setUseFixedLayout(true);
@@ -201,7 +201,7 @@ private:
     
     _isBackground = [UIApplication sharedApplication].applicationState == UIApplicationStateBackground;
 
-    WebContext::statistics().wkViewCount++;
+    WebProcessPool::statistics().wkViewCount++;
 
     _rootContentView = adoptNS([[UIView alloc] init]);
     [_rootContentView layer].masksToBounds = NO;
@@ -238,7 +238,7 @@ private:
 
     _page->close();
 
-    WebContext::statistics().wkViewCount--;
+    WebProcessPool::statistics().wkViewCount--;
 
     [super dealloc];
 }
index 9177b92..9a9f2e4 100644 (file)
@@ -30,8 +30,8 @@
 
 namespace WebKit {
 class GeolocationPermissionRequestProxy;
-class WebContext;
 class WebFrameProxy;
+class WebProcessPool;
 }
 
 namespace WebCore {
@@ -41,7 +41,7 @@ class SecurityOrigin;
 @class WKWebView;
 
 @interface WKGeolocationProviderIOS : NSObject
--(id)initWithContext:(WebKit::WebContext*)context;
+-(id)initWithProcessPool:(WebKit::WebProcessPool&)processPool;
 -(void)decidePolicyForGeolocationRequestFromOrigin:(WebCore::SecurityOrigin&)origin frame:(WebKit::WebFrameProxy&)frame request:(WebKit::GeolocationPermissionRequestProxy&)permissionRequest view:(WKWebView*)view;
 @end
 
index 5f43742..bb6bb60 100644 (file)
 #import "GeolocationPermissionRequestProxy.h"
 #import "WKUIDelegatePrivate.h"
 #import "WKWebView.h"
-#import "WebContext.h"
 #import "WebGeolocationManagerProxy.h"
-#import <WebGeolocationPosition.h>
+#import "WebProcessPool.h"
 #import <WebCore/GeolocationPosition.h>
 #import <WebCore/URL.h>
+#import <WebGeolocationPosition.h>
 #import <wtf/Assertions.h>
+#import <wtf/HashSet.h>
 #import <wtf/PassRefPtr.h>
 #import <wtf/RefPtr.h>
 #import <wtf/RetainPtr.h>
-#import <wtf/HashSet.h>
 
 // FIXME: Remove use of WebKit1 from WebKit2
 #import <WebKit/WebGeolocationCoreLocationProvider.h>
@@ -135,12 +135,12 @@ static void setEnableHighAccuracy(WKGeolocationManagerRef geolocationManager, bo
     return nil;
 }
 
--(id)initWithContext:(WebContext*)context
+-(id)initWithProcessPool:(WebProcessPool&)processPool
 {
     self = [super init];
     if (!self)
         return nil;
-    _geolocationManager = context->supplement<WebGeolocationManagerProxy>();
+    _geolocationManager = processPool.supplement<WebGeolocationManagerProxy>();
     WKGeolocationProvider providerCallback = {
         kWKGeolocationProviderCurrentVersion,
         self,
index bcff3ae..b2a2c7e 100644 (file)
@@ -30,7 +30,6 @@
 
 #import <WebCore/NotImplemented.h>
 
-#import "WebContext.h"
 #import "WebProcessMessages.h"
 
 namespace WebKit {
index 988ed67..8ec755d 100644 (file)
@@ -34,8 +34,6 @@
 
 namespace WebKit {
 
-class WebContext;
-
 class ServicesController {
     WTF_MAKE_NONCOPYABLE(ServicesController);
     friend class NeverDestroyed<ServicesController>;
index 0ce81ba..e82c72d 100644 (file)
@@ -28,8 +28,8 @@
 
 #if ENABLE(SERVICE_CONTROLS)
 
-#import "WebContext.h"
 #import "WebProcessMessages.h"
+#import "WebProcessPool.h"
 #import <WebCore/NSExtensionSPI.h>
 #import <WebCore/NSSharingServicePickerSPI.h>
 #import <WebCore/NSSharingServiceSPI.h>
@@ -105,8 +105,8 @@ void ServicesController::refreshExistingServices(bool refreshImmediately)
             m_hasRichContentServices = hasRichContentServices;
 
             if (availableServicesChanged) {
-                for (auto& context : WebContext::allContexts())
-                    context->sendToAllProcesses(Messages::WebProcess::SetEnabledServices(m_hasImageServices, m_hasSelectionServices, m_hasRichContentServices));
+                for (auto& processPool : WebProcessPool::allProcessPools())
+                    processPool->sendToAllProcesses(Messages::WebProcess::SetEnabledServices(m_hasImageServices, m_hasSelectionServices, m_hasRichContentServices));
             }
 
             m_hasPendingRefresh = false;
index 494762e..ff6874c 100644 (file)
 
 #import "WKNSURLExtras.h"
 #import "WKViewInternal.h"
-#import "WebContext.h"
 #import "WebKitSystemInterface.h"
 #import "WebPageMessages.h"
 #import "WebPageProxy.h"
 #import "WebPageProxyMessages.h"
+#import "WebProcessPool.h"
 #import "WebProcessProxy.h"
 #import <Foundation/Foundation.h>
 #import <ImageIO/ImageIO.h>
@@ -240,7 +240,7 @@ using namespace WebKit;
 - (void)_saveVideoToDownloads:(id)sender
 {
     RefPtr<WebHitTestResult> hitTestResult = [self _webHitTestResult];
-    _page->process().context().download(_page, hitTestResult->absoluteMediaURL());
+    _page->process().processPool().download(_page, hitTestResult->absoluteMediaURL());
 }
 
 #pragma mark Image actions
@@ -288,7 +288,7 @@ using namespace WebKit;
 - (void)_saveImageToDownloads:(id)sender
 {
     RefPtr<WebHitTestResult> hitTestResult = [self _webHitTestResult];
-    _page->process().context().download(_page, hitTestResult->absoluteImageURL());
+    _page->process().processPool().download(_page, hitTestResult->absoluteImageURL());
 }
 
 // FIXME: We should try to share this with WebPageProxyMac's similar PDF functions.
index 187b1dd..61d67ad 100644 (file)
@@ -28,7 +28,7 @@
 
 #if PLATFORM(MAC)
 
-#import "WebContext.h"
+#import "WebProcessPool.h"
 
 NSString * const KeyboardUIModeDidChangeNotification = @"com.apple.KeyboardUIModeDidChange";
 const CFStringRef AppleKeyboardUIMode = CFSTR("AppleKeyboardUIMode");
@@ -37,11 +37,10 @@ using namespace WebKit;
 
 @implementation WKFullKeyboardAccessWatcher
 
-- (void)notifyAllWebContexts
+- (void)notifyAllProcessPools
 {
-    const Vector<WebContext*>& contexts = WebContext::allContexts();
-    for (size_t i = 0; i < contexts.size(); ++i)
-        contexts[i]->fullKeyboardAccessModeChanged(fullKeyboardAccessEnabled);
+    for (auto* processPool : WebProcessPool::allProcessPools())
+        processPool->fullKeyboardAccessModeChanged(fullKeyboardAccessEnabled);
 }
 
 - (void)retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification
@@ -60,7 +59,7 @@ using namespace WebKit;
     }
 
     if (fullKeyboardAccessEnabled != oldValue)
-        [self notifyAllWebContexts];
+        [self notifyAllProcessPools];
 }
 
 - (id)init
index 93bda8e..260a1f8 100644 (file)
@@ -34,7 +34,6 @@
 #import "ServicesController.h"
 #import "ShareableBitmap.h"
 #import "StringUtilities.h"
-#import "WebContext.h"
 #import "WebContextMenuItemData.h"
 #import "WebProcessProxy.h"
 #import "WKView.h"
index 8f0c33e..67f5334 100644 (file)
 #import "WKRetainPtr.h"
 #import "WKURLCF.h"
 #import "WKViewInternal.h"
-#import "WebContext.h"
 #import "WebInspectorMessages.h"
 #import "WebInspectorUIMessages.h"
 #import "WebPageGroup.h"
 #import "WebPageProxy.h"
 #import "WebPreferences.h"
+#import "WebProcessPool.h"
 #import "WebProcessProxy.h"
 #import <QuartzCore/CoreAnimation.h>
 #import <WebCore/InspectorFrontendClientLocal.h>
@@ -480,7 +480,7 @@ WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
             initialRect = [NSWindow contentRectForFrameRect:windowFrame styleMask:windowStyleMask];
     }
 
-    m_inspectorView = adoptNS([[WKWebInspectorWKView alloc] initWithFrame:initialRect contextRef:toAPI(&inspectorContext()) pageGroupRef:toAPI(inspectorPageGroup()) relatedToPage:nullptr]);
+    m_inspectorView = adoptNS([[WKWebInspectorWKView alloc] initWithFrame:initialRect contextRef:toAPI(&inspectorProcessPool()) pageGroupRef:toAPI(inspectorPageGroup()) relatedToPage:nullptr]);
     ASSERT(m_inspectorView);
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1090
index 043a7cd..285db17 100644 (file)
@@ -43,7 +43,6 @@
 #import "StringUtilities.h"
 #import "TextChecker.h"
 #import "WKBrowsingContextControllerInternal.h"
-#import "WebContext.h"
 #import "WebPageMessages.h"
 #import "WebProcessProxy.h"
 #import <WebCore/DictationAlternative.h>
index 8817c4b..fe3f705 100644 (file)
@@ -28,9 +28,6 @@
 
 #if PLATFORM(MAC)
 
-#import "WebContext.h"
-#import "WebPageGroup.h"
-#import "WebProcessMessages.h"
 #import "WKFullKeyboardAccessWatcher.h"
 
 namespace WebKit {
index b8c80e8..4a7efe6 100644 (file)
@@ -26,8 +26,8 @@
 #import "config.h"
 #import "WindowServerConnection.h"
 
-#import "WebContext.h"
 #import "WebKitSystemInterface.h"
+#import "WebProcessPool.h"
 
 namespace WebKit {
 
@@ -53,8 +53,8 @@ void WindowServerConnection::applicationWindowModificationsStopped(uint32_t, voi
 
 void WindowServerConnection::windowServerConnectionStateChanged()
 {
-    for (auto* context : WebContext::allContexts())
-        context->windowServerConnectionStateChanged();
+    for (auto* processPool : WebProcessPool::allProcessPools())
+        processPool->windowServerConnectionStateChanged();
 }
 
 #endif
index cecdf6a..c0ad494 100644 (file)
                1A1B0EB518A424950038481A /* WKNavigationResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A1B0EB318A424950038481A /* WKNavigationResponse.mm */; };
                1A1B0EB618A424950038481A /* WKNavigationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1B0EB418A424950038481A /* WKNavigationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
                1A1B0EB818A424CD0038481A /* WKNavigationResponseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1B0EB718A424CD0038481A /* WKNavigationResponseInternal.h */; };
-               1A1C649B11F4174200553C19 /* WebContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C648611F415B700553C19 /* WebContextMac.mm */; };
                1A1D8BA11731A36300141DA4 /* LocalStorageDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1D8B9F1731A36300141DA4 /* LocalStorageDatabase.cpp */; };
                1A1D8BA21731A36300141DA4 /* LocalStorageDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1D8BA01731A36300141DA4 /* LocalStorageDatabase.h */; };
                1A1DC340196346D700FF7059 /* LegacySessionStateCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 31607F3819627002009B87DA /* LegacySessionStateCoding.h */; };
                1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4987711FF7FAA0048B464 /* JSNPObject.cpp */; };
                1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE49A4711FFA8CE0048B464 /* JSNPMethod.h */; };
                1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE49A4811FFA8CE0048B464 /* JSNPMethod.cpp */; };
-               1AE52F9119201DA700A1FA37 /* APIContextConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE52F8F19201DA700A1FA37 /* APIContextConfiguration.cpp */; };
-               1AE52F9219201DA700A1FA37 /* APIContextConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE52F9019201DA700A1FA37 /* APIContextConfiguration.h */; };
                1AE52F971920263300A1FA37 /* WKContextConfigurationRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */; };
                1AE52F981920267200A1FA37 /* WKContextConfigurationRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE52F9419201F6B00A1FA37 /* WKContextConfigurationRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1AE5B7FB11E7AED200BA6767 /* NetscapePluginMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AE5B7F911E7AED200BA6767 /* NetscapePluginMac.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
                7CD622771739D863005BD7FF /* PluginSandboxProfile.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CD622751739D863005BD7FF /* PluginSandboxProfile.mm */; };
                7CD622781739D863005BD7FF /* PluginSandboxProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD622761739D863005BD7FF /* PluginSandboxProfile.h */; };
                7CE4D2071A46776100C7F152 /* APILegacyContextHistoryClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE4D2061A46775700C7F152 /* APILegacyContextHistoryClient.h */; };
+               7CE4D2161A49148400C7F152 /* WebProcessPoolCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CE4D2151A49148400C7F152 /* WebProcessPoolCocoa.mm */; };