forked from WebKit/WebKit-http
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WK2] Add a user default to limit the number of web processes
https://bugs.webkit.org/show_bug.cgi?id=104606 Reviewed by Sam Weinig. When the limit is reached, we'll reuse an existing process with fewest pages. * UIProcess/WebContext.cpp: (WebKit::WebContext::WebContext): Initialize m_webProcessCountLimit. (WebKit::WebContext::platformInitialize): Added a hook for reading the preference, empty implementation on most platforms. (WebKit::WebContext::createNewWebProcess): Changed to return a raw pointer. The new process is put into a vector anyway, so there is no ownership transfer. (WebKit::WebContext::warmInitialProcess): Don't create a new process if that would exceed the limit. (WebKit::WebContext::createNewWebProcessRespectingProcessCountLimit): Added a new function that wither creates a new process, or picks an existing one. (WebKit::WebContext::createWebPage): Call the above new function instead of unconditionally creating a process. * UIProcess/WebContext.h: createNewWebProcess is no private. All clients should respect the process count limit. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): Respect the process count limit. * UIProcess/mac/WebContextMac.mm: (WebKit::registerUserDefaultsIfNeeded): Register the new default. (WebKit::WebContext::platformInitialize): Read the default into a WebContext member variable. (WebKit::WebContext::platformInitializeWebProcess): Moved registerUserDefaultsIfNeeded() from here to platformInitialize(), as that's a better place for it. Also added a FIXME for an unrelated issue. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
3475f1c
commit eca3f81
Showing
5 changed files
with
105 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters