Deprecate API to limit the maximum number of WebProcesses
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 23:34:22 +0000 (23:34 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 23:34:22 +0000 (23:34 +0000)
commitd3b6a6ec2ea418cff73090263c8caf5013155bac
tree633c267b939582cf06647f72177e02542739a118
parent56b3c12f8ca13ecaa937c1c6985e6c9bf0f7a11c
Deprecate API to limit the maximum number of WebProcesses
https://bugs.webkit.org/show_bug.cgi?id=193725
<rdar://problem/47464879>

Reviewed by Geoff Garen.

Source/WebKit:

Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
complexity and is not safe (conflicts with PSON).

Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
Note that enabling the single WebProcess mode will disable PSON and process prewarming.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetMaximumNumberOfProcesses):
(WKContextGetMaximumNumberOfProcesses):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration maximumProcessCount]):
(-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
(-[_WKProcessPoolConfiguration usesSingleWebProcess]):
(-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
(-[_WKProcessPoolConfiguration description]):
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_process_model):
(webkit_web_context_set_web_process_count_limit):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:

Tools:

Update existing API tests to stop using deprecated API.

* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration):
* TestWebKitAPI/Tests/WebKit/UserMedia.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ResponsivenessTimer.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/C/WKContext.cpp
Source/WebKit/UIProcess/API/C/WKContext.h
Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Tools/ChangeLog
Tools/MiniBrowser/mac/AppDelegate.m
Tools/TestWebKitAPI/Tests/WebKit/UserMedia.cpp
Tools/TestWebKitAPI/Tests/WebKitCocoa/ResponsivenessTimer.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm