Fix for https://bugs.webkit.org/show_bug.cgi?id=40882
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Jun 2010 00:39:44 +0000 (00:39 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Jun 2010 00:39:44 +0000 (00:39 +0000)
commit182efc2147f73fe93770d8abf2df9bf996fa4622
treee0445a19f67e1e8bdfd4543918f33b616262adff
parent89ac4c2626763608d3ee3af5020ae1fe75cfddf0
Fix for https://bugs.webkit.org/show_bug.cgi?id=40882
Add ability to have a WebProcess per WebContext.

Reviewed by Anders Carlsson.

WebKit2:

- Move to a one-to-one correspondence of WebContexts to WebProcessProxies.
- Add explicit shared contexts for general use.
- Only non-shared contexts can use injected bundles.

* UIProcess/API/C/WKContext.cpp:
(WKContextCreate):
(WKContextCreateWithInjectedBundlePath):
(WKContextGetSharedProcessContext):
(WKContextGetSharedThreadContext):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextPrivate.h:
Change API for WKContext to no longer take a WKProcessModel type and instead
have explicit Create/Get functions for the different kind of contexts. Added
two shared contexts, one threaded, one process, and made the threaded on private
for now.

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:]):
Make WKViews that don't have an explicit context use the shared process
context by default.

* UIProcess/Launcher/WebProcessLauncher.h:
* UIProcess/Launcher/mac/WebProcessLauncher.mm:
(WebKit::launchWebProcess):
* UIProcess/Launcher/win/WebProcessLauncher.cpp:
(WebKit::launchWebProcess):
Use a boolean argument to note whether we are using a thread or a process
instead of using the process model enum.

* UIProcess/ProcessModel.h:
(WebKit::):
Convert to using explicit Shared modifier for shared contexts.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::sharedProcessContext):
(WebKit::WebContext::sharedThreadContext):
(WebKit::WebContext::ensureWebProcess):
(WebKit::WebContext::createWebPage):
(WebKit::WebContext::reviveIfNecessary):
* UIProcess/WebContext.h:
(WebKit::WebContext::create):
(WebKit::WebContext::process):
* UIProcess/WebPageNamespace.cpp:
(WebKit::WebPageNamespace::createWebPage):
(WebKit::WebPageNamespace::preferencesDidChange):
(WebKit::WebPageNamespace::getStatistics):
* UIProcess/WebPageNamespace.h:
(WebKit::WebPageNamespace::process):
(WebKit::WebPageNamespace::reviveIfNecessary):
Move WebProcessProxy creation logic up into WebContext.

* UIProcess/WebProcessManager.cpp:
(WebKit::WebProcessManager::getWebProcess):
(WebKit::WebProcessManager::processDidClose):
* UIProcess/WebProcessManager.h:
Keep a map of WebContexts to WebProcessProxies in addition to the two
shared processes.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::create):
(WebKit::WebProcessProxy::WebProcessProxy):
(WebKit::WebProcessProxy::connect):
(WebKit::WebProcessProxy::didClose):
* UIProcess/WebProcessProxy.h:
Store a WebContext instead of the process model.

* mac/WebKit2.exp:
Add new functions.

WebKitTools:

Move to use new shared contexts API.

* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate init]):
(-[BrowserAppDelegate getCurrentPageNamespace]):
(-[BrowserAppDelegate validateMenuItem:]):
(-[BrowserAppDelegate _setProcessModel:]):
(-[BrowserAppDelegate setSharedProcessProcessModel:]):
(-[BrowserAppDelegate setSharedThreadProcessModel:]):
* MiniBrowser/win/BrowserView.cpp:
(BrowserView::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@61500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
WebKit2/ChangeLog
WebKit2/UIProcess/API/C/WKContext.cpp
WebKit2/UIProcess/API/C/WKContext.h
WebKit2/UIProcess/API/C/WKContextPrivate.h
WebKit2/UIProcess/API/mac/WKView.mm
WebKit2/UIProcess/Launcher/WebProcessLauncher.h
WebKit2/UIProcess/Launcher/mac/WebProcessLauncher.mm
WebKit2/UIProcess/Launcher/win/WebProcessLauncher.cpp
WebKit2/UIProcess/ProcessModel.h
WebKit2/UIProcess/WebContext.cpp
WebKit2/UIProcess/WebContext.h
WebKit2/UIProcess/WebPageNamespace.cpp
WebKit2/UIProcess/WebPageNamespace.h
WebKit2/UIProcess/WebProcessManager.cpp
WebKit2/UIProcess/WebProcessManager.h
WebKit2/UIProcess/WebProcessProxy.cpp
WebKit2/UIProcess/WebProcessProxy.h
WebKit2/mac/WebKit2.exp
WebKit2/win/WebKit2Generated.make
WebKitTools/ChangeLog
WebKitTools/MiniBrowser/mac/AppDelegate.h
WebKitTools/MiniBrowser/mac/AppDelegate.m
WebKitTools/MiniBrowser/win/BrowserView.cpp