From 0e34852ad6c4d5bc35f7000392467837211c9a87 Mon Sep 17 00:00:00 2001 From: "mbelshe@chromium.org" Date: Tue, 15 Feb 2011 23:14:44 +0000 Subject: Update benchmarking clearCache routine to be able to preserve sslhostinfo: related entries. * The clearCache() API is part of the benchmarking extension. * Modified clearCache() to take an argument so that we can selectively clear SSL information or not. * The actual clear data call used to just call DoomAllEntries. It still does that for clearing everything. If preserving the ssl host entries, however, it will enumerate the cache. Ran into cache invalidation upon calling doom, which makes the clear inefficient, but functional. BUG=none TEST=none Review URL: http://codereview.chromium.org/6529012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75027 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_thread.cc | 4 ++-- chrome/renderer/render_thread.h | 4 +++- chrome/renderer/renderer_glue.cc | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'chrome/renderer') diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index fc74a39..85bcddc 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -768,9 +768,9 @@ void RenderThread::SetCacheMode(bool enabled) { Send(new ViewHostMsg_SetCacheMode(enabled)); } -void RenderThread::ClearCache() { +void RenderThread::ClearCache(bool preserve_ssl_host_info) { int rv; - Send(new ViewHostMsg_ClearCache(&rv)); + Send(new ViewHostMsg_ClearCache(preserve_ssl_host_info, &rv)); } void RenderThread::EnableSpdy(bool enable) { diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index bfb9e55..97bb0ef 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -215,7 +215,9 @@ class RenderThread : public RenderThreadBase, void SetCacheMode(bool enabled); // Sends a message to the browser to clear the disk cache. - void ClearCache(); + // |preserve_ssl_host_info| is a flag indicating if the cache should purge + // entries related to cached SSL information. + void ClearCache(bool preserve_ssl_host_info); // Sends a message to the browser to enable/disable spdy. void EnableSpdy(bool enable); diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index ecbf7f5..7ba91ff 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -256,8 +256,8 @@ void SetCacheMode(bool enabled) { RenderThread::current()->SetCacheMode(enabled); } -void ClearCache() { - RenderThread::current()->ClearCache(); +void ClearCache(bool preserve_ssl_host_info) { + RenderThread::current()->ClearCache(preserve_ssl_host_info); } std::string GetProductVersion() { -- cgit v1.1