diff options
author | lzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 17:30:54 +0000 |
---|---|---|
committer | lzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 17:30:54 +0000 |
commit | 12893c317ae3887de59727df0de45faae3f660e6 (patch) | |
tree | 9a2c5515c4fec605af1a5b073bfdb5aa46ced546 /webkit/extensions | |
parent | 36955358355136978385ac8bb829807648c462e2 (diff) | |
download | chromium_src-12893c317ae3887de59727df0de45faae3f660e6.zip chromium_src-12893c317ae3887de59727df0de45faae3f660e6.tar.gz chromium_src-12893c317ae3887de59727df0de45faae3f660e6.tar.bz2 |
Enable/Disable Spdy in benchmarking.
Test=none
Bug=52624
Review URL: http://codereview.chromium.org/3169022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/extensions')
-rw-r--r-- | webkit/extensions/v8/benchmarking_extension.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/webkit/extensions/v8/benchmarking_extension.cc index 5790ee4..31bb080 100644 --- a/webkit/extensions/v8/benchmarking_extension.cc +++ b/webkit/extensions/v8/benchmarking_extension.cc @@ -4,6 +4,7 @@ #include "base/command_line.h" #include "base/stats_table.h" +#include "net/http/http_network_layer.h" #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" #include "webkit/extensions/v8/benchmarking_extension.h" #include "webkit/glue/webkit_glue.h" @@ -36,6 +37,10 @@ class BenchmarkingWrapper : public v8::Extension { " native function GetCounter();" " return GetCounter(name);" "};" + "chrome.benchmarking.enableSpdy = function(name) {" + " native function EnableSpdy();" + " EnableSpdy(name);" + "};" "chrome.benchmarking.isSingleProcess = function() {" " native function IsSingleProcess();" " return IsSingleProcess();" @@ -48,6 +53,8 @@ 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("EnableSpdy"))) { + return v8::FunctionTemplate::New(EnableSpdy); } else if (name->Equals(v8::String::New("GetCounter"))) { return v8::FunctionTemplate::New(GetCounter); } else if (name->Equals(v8::String::New("IsSingleProcess"))) { @@ -67,6 +74,14 @@ class BenchmarkingWrapper : public v8::Extension { return v8::Undefined(); } + static v8::Handle<v8::Value> EnableSpdy(const v8::Arguments& args) { + if (!args.Length() || !args[0]->IsBoolean()) + return v8::Undefined(); + + webkit_glue::EnableSpdy(args[0]->BooleanValue()); + return v8::Undefined(); + } + static v8::Handle<v8::Value> GetCounter(const v8::Arguments& args) { if (!args.Length() || !args[0]->IsString() || !StatsTable::current()) return v8::Undefined(); |