Add a setting for keeping around all processes and always reusing them per-origin.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2018 16:39:21 +0000 (16:39 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Apr 2018 16:39:21 +0000 (16:39 +0000)
commitca7f650355a7d6b7a7f959671ebc6f93aa63bb36
treec2d4a791c095f7b88769aa86bb32b3aa37d67018
parent937f875115521fb9bc0762dbfd1ca494cf56bd65
Add a setting for keeping around all processes and always reusing them per-origin.
<rdar://problem/39695798> and https://bugs.webkit.org/show_bug.cgi?id=185020

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:

* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses):
(WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses):
* UIProcess/API/C/WKContextConfigurationRef.h:

* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]):
(-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]):

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::webProcessDidClose):
(WebKit::SuspendedPageProxy::destroyWebPageInWebProcess):
* UIProcess/SuspendedPageProxy.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendedPageClosed):
(WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::suspendedPage const):

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::shouldTerminate):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::addProcessToOriginCacheSet):
(WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
(WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process.
(WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process.
* UIProcess/WebProcessPool.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.cpp
Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
Source/WebKit/UIProcess/SuspendedPageProxy.cpp
Source/WebKit/UIProcess/SuspendedPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm