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 | |
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')
-rw-r--r-- | webkit/extensions/v8/benchmarking_extension.cc | 15 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 3 | ||||
-rw-r--r-- | webkit/support/webkit_support_glue.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 4 |
4 files changed, 25 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(); diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index d912494..6c7387d 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -265,6 +265,9 @@ std::string GetProductVersion(); // Returns true if the embedder is running in single process mode. bool IsSingleProcess(); +// Enables/Disables Spdy for requests afterwards. Used for benchmarking. +void EnableSpdy(bool enable); + #if defined(OS_LINUX) // Return a read-only file descriptor to the font which best matches the given // properties or -1 on failure. diff --git a/webkit/support/webkit_support_glue.cc b/webkit/support/webkit_support_glue.cc index bae6374..96eb800 100644 --- a/webkit/support/webkit_support_glue.cc +++ b/webkit/support/webkit_support_glue.cc @@ -72,6 +72,9 @@ bool IsSingleProcess() { return true; } +void EnableSpdy(bool enable) { +} + #if defined(OS_LINUX) int MatchFontWithFallback(const std::string& face, bool bold, bool italic, int charset) { diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index c4023d5..07416a6 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -805,6 +805,10 @@ void ClearCache() { // Used in benchmarking, Ignored for test_shell. } +void EnableSpdy(bool enable) { + // Used in benchmarking, Ignored for test_shell. +} + std::string GetProductVersion() { return std::string("Chrome/0.0.0.0"); } |