summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/web_cache_manager.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 20:59:03 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 20:59:03 +0000
commit163753fa042f009e1e16d38d80c5e03ddd703916 (patch)
tree2292cf20e69b5ee515047b9220920e4df9cbbb88 /chrome/browser/renderer_host/web_cache_manager.cc
parent5eaba82aff2b122e6ef86671cf3ec200b3699d28 (diff)
downloadchromium_src-163753fa042f009e1e16d38d80c5e03ddd703916.zip
chromium_src-163753fa042f009e1e16d38d80c5e03ddd703916.tar.gz
chromium_src-163753fa042f009e1e16d38d80c5e03ddd703916.tar.bz2
Connect the browsing data remover with WebKit cache.
This is the first step to delete Webkit's cache when deleting all browsing data. Webkit changes will come next. BUG=54336 TEST=none Review URL: http://codereview.chromium.org/3577002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/web_cache_manager.cc')
-rw-r--r--chrome/browser/renderer_host/web_cache_manager.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/web_cache_manager.cc b/chrome/browser/renderer_host/web_cache_manager.cc
index 30cf651..04da747 100644
--- a/chrome/browser/renderer_host/web_cache_manager.cc
+++ b/chrome/browser/renderer_host/web_cache_manager.cc
@@ -147,6 +147,12 @@ void WebCacheManager::SetGlobalSizeLimit(size_t bytes) {
ReviseAllocationStrategyLater();
}
+void WebCacheManager::ClearCache() {
+ // Tell each renderer process to clear the cache.
+ ClearRendederCache(active_renderers_);
+ ClearRendederCache(inactive_renderers_);
+}
+
// static
size_t WebCacheManager::GetDefaultGlobalSizeLimit() {
PrefService* perf_service = g_browser_process->local_state();
@@ -298,6 +304,15 @@ void WebCacheManager::EnactStrategy(const AllocationStrategy& strategy) {
}
}
+void WebCacheManager::ClearRendederCache(std::set<int> renderers) {
+ std::set<int>::const_iterator iter = renderers.begin();
+ for (; iter != renderers.end(); ++iter) {
+ RenderProcessHost* host = RenderProcessHost::FromID(*iter);
+ if (host)
+ host->Send(new ViewMsg_ClearCache());
+ }
+}
+
void WebCacheManager::ReviseAllocationStrategy() {
DCHECK(stats_.size() <=
active_renderers_.size() + inactive_renderers_.size());