diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 20:50:55 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 20:50:55 +0000 |
commit | 8990e4716c6bf3f19625d24be013502fc6e24873 (patch) | |
tree | fe934abf9d3b6139c096e415de0dd99fbae3fecc /webkit/extensions | |
parent | d15f03f7d3aaa253d32c8bfc4f1543f5f9d6eeae (diff) | |
download | chromium_src-8990e4716c6bf3f19625d24be013502fc6e24873.zip chromium_src-8990e4716c6bf3f19625d24be013502fc6e24873.tar.gz chromium_src-8990e4716c6bf3f19625d24be013502fc6e24873.tar.bz2 |
Add chrome.benchmark routines to clear the host and predictor caches.
This will be used in web-page-replay to enable TCP preconnect and DNS prefetch.
BUG=None
TEST=unit_tests passes
Review URL: http://codereview.chromium.org/6660008
Patch from Ziga Mahkovec <ziga@chromium.org>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79610 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/extensions')
-rw-r--r-- | webkit/extensions/v8/benchmarking_extension.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/webkit/extensions/v8/benchmarking_extension.cc index 600eafa..e622ba7 100644 --- a/webkit/extensions/v8/benchmarking_extension.cc +++ b/webkit/extensions/v8/benchmarking_extension.cc @@ -31,6 +31,14 @@ class BenchmarkingWrapper : public v8::Extension { " native function ClearCache();" " ClearCache(preserve_ssl_entries);" "};" + "chrome.benchmarking.clearHostResolverCache = function() {" + " native function ClearHostResolverCache();" + " ClearHostResolverCache();" + "};" + "chrome.benchmarking.clearPredictorCache = function() {" + " native function ClearPredictorCache();" + " ClearPredictorCache();" + "};" "chrome.benchmarking.closeConnections = function() {" " native function CloseConnections();" " CloseConnections();" @@ -75,6 +83,10 @@ class BenchmarkingWrapper : public v8::Extension { return v8::FunctionTemplate::New(CloseConnections); } else if (name->Equals(v8::String::New("ClearCache"))) { return v8::FunctionTemplate::New(ClearCache); + } else if (name->Equals(v8::String::New("ClearHostResolverCache"))) { + return v8::FunctionTemplate::New(ClearHostResolverCache); + } else if (name->Equals(v8::String::New("ClearPredictorCache"))) { + return v8::FunctionTemplate::New(ClearPredictorCache); } else if (name->Equals(v8::String::New("EnableSpdy"))) { return v8::FunctionTemplate::New(EnableSpdy); } else if (name->Equals(v8::String::New("GetCounter"))) { @@ -102,6 +114,18 @@ class BenchmarkingWrapper : public v8::Extension { return v8::Undefined(); } + static v8::Handle<v8::Value> ClearHostResolverCache( + const v8::Arguments& args) { + webkit_glue::ClearHostResolverCache(); + return v8::Undefined(); + } + + static v8::Handle<v8::Value> ClearPredictorCache( + const v8::Arguments& args) { + webkit_glue::ClearPredictorCache(); + return v8::Undefined(); + } + static v8::Handle<v8::Value> EnableSpdy(const v8::Arguments& args) { if (!args.Length() || !args[0]->IsBoolean()) return v8::Undefined(); |