WebProcessCache should keep track of processes being added
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2019 19:30:42 +0000 (19:30 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2019 19:30:42 +0000 (19:30 +0000)
commit04004cf109f1d7c8deaaaac4b9bde297dee753a7
tree4cbe560faabb287b6da5b5f5061663c85b93704c
parent15fb8b75b0537944f80d7554949706e8bdb574b8
WebProcessCache should keep track of processes being added
https://bugs.webkit.org/show_bug.cgi?id=195538

Reviewed by Geoffrey Garen.

WebProcessCache should keep track of processes being added, while they are being
checked for responsiveness. This is useful so that:
- Requests to clear the cache also clear processes being added
- Requests to remove a given process from the cache (either because it crashed
  or because it is being used for a history navigation) actually remove the
  process if it is still being checked for responsiveness.
- The cached process eviction timer applies to such processes in case something
  goes wrong with the code and the pending request does not get processed.

* UIProcess/WebProcessCache.cpp:
(WebKit::generateAddRequestIdentifier):
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::clear):
(WebKit::WebProcessCache::clearAllProcessesForSession):
(WebKit::WebProcessCache::removeProcess):
(WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
(WebKit::WebProcessCache::evictProcess): Deleted.
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::size const):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit/UIProcess/WebProcessCache.cpp
Source/WebKit/UIProcess/WebProcessCache.h
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessProxy.cpp