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 --- webkit/extensions/v8/benchmarking_extension.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'webkit/extensions') diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/webkit/extensions/v8/benchmarking_extension.cc index 2fa56eb0..600eafa 100644 --- a/webkit/extensions/v8/benchmarking_extension.cc +++ b/webkit/extensions/v8/benchmarking_extension.cc @@ -27,9 +27,9 @@ class BenchmarkingWrapper : public v8::Extension { "if (typeof(chrome.benchmarking) == 'undefined') {" " chrome.benchmarking = {};" "};" - "chrome.benchmarking.clearCache = function() {" + "chrome.benchmarking.clearCache = function(preserve_ssl_entries) {" " native function ClearCache();" - " ClearCache();" + " ClearCache(preserve_ssl_entries);" "};" "chrome.benchmarking.closeConnections = function() {" " native function CloseConnections();" @@ -94,7 +94,10 @@ class BenchmarkingWrapper : public v8::Extension { } static v8::Handle ClearCache(const v8::Arguments& args) { - webkit_glue::ClearCache(); + bool preserve_ssl_host_entries = false; + if (args.Length() && args[0]->IsBoolean()) + preserve_ssl_host_entries = args[0]->BooleanValue(); + webkit_glue::ClearCache(preserve_ssl_host_entries); WebCache::clear(); return v8::Undefined(); } -- cgit v1.1