Drop cached WebProcesses for a given session when this session is destroyed
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 20:14:54 +0000 (20:14 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 20:14:54 +0000 (20:14 +0000)
commit291c0ffe2ea52766bde68e76f2660a17cd647e3c
tree4d31f6dda8f3426743aaf3d83e41e5244492030c
parent50f7c77dab6fbe60f1ead9d89013b82a3541bf0b
Drop cached WebProcesses for a given session when this session is destroyed
https://bugs.webkit.org/show_bug.cgi?id=195212
<rdar://problem/48301483>

Reviewed by Geoffrey Garen.

Drop cached WebProcesses for a give session when this session is destroyed. This way, when you close
your private browsing window, all the processes it used get cleared and it cannot leave any state
behind.

* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::canCacheProcess const):
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::clearAllProcessesForSession):
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::capacity const):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
(WebKit::WebProcessPool::hasPagesUsingWebsiteDataStore const):
* UIProcess/WebProcessPool.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebProcessCache.cpp
Source/WebKit/UIProcess/WebProcessCache.h
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h