From 163753fa042f009e1e16d38d80c5e03ddd703916 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Fri, 1 Oct 2010 20:59:03 +0000 Subject: 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 --- chrome/browser/renderer_host/web_cache_manager.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'chrome/browser/renderer_host/web_cache_manager.cc') 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 renderers) { + std::set::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()); -- cgit v1.1