diff options
author | mlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 18:03:41 +0000 |
---|---|---|
committer | mlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 18:03:41 +0000 |
commit | 46210f046927e1d822da3fd46a8ef87df28043e4 (patch) | |
tree | d289ed393d4fd84cdd35008468b6abd6c3c9f13c /webkit | |
parent | 0b004da852f6c01fecba4b1e2a6ffab221061a63 (diff) | |
download | chromium_src-46210f046927e1d822da3fd46a8ef87df28043e4.zip chromium_src-46210f046927e1d822da3fd46a8ef87df28043e4.tar.gz chromium_src-46210f046927e1d822da3fd46a8ef87df28043e4.tar.bz2 |
Show a warning message if the cache might not be cleared between runs.
BUG=None.
TEST=Unit tests pass.
Review URL: http://codereview.chromium.org/2819037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/extensions/v8/benchmarking_extension.cc | 11 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 3 | ||||
-rw-r--r-- | webkit/support/webkit_support_glue.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 4 |
4 files changed, 22 insertions, 0 deletions
diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/webkit/extensions/v8/benchmarking_extension.cc index 362a928..5790ee4 100644 --- a/webkit/extensions/v8/benchmarking_extension.cc +++ b/webkit/extensions/v8/benchmarking_extension.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/command_line.h" #include "base/stats_table.h" #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" #include "webkit/extensions/v8/benchmarking_extension.h" @@ -35,6 +36,10 @@ class BenchmarkingWrapper : public v8::Extension { " native function GetCounter();" " return GetCounter(name);" "};" + "chrome.benchmarking.isSingleProcess = function() {" + " native function IsSingleProcess();" + " return IsSingleProcess();" + "};" ) {} virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( @@ -45,6 +50,8 @@ class BenchmarkingWrapper : public v8::Extension { return v8::FunctionTemplate::New(ClearCache); } else if (name->Equals(v8::String::New("GetCounter"))) { return v8::FunctionTemplate::New(GetCounter); + } else if (name->Equals(v8::String::New("IsSingleProcess"))) { + return v8::FunctionTemplate::New(IsSingleProcess); } return v8::Handle<v8::FunctionTemplate>(); } @@ -73,6 +80,10 @@ class BenchmarkingWrapper : public v8::Extension { int counter = StatsTable::current()->GetCounterValue(name); return v8::Integer::New(counter); } + + static v8::Handle<v8::Value> IsSingleProcess(const v8::Arguments& args) { + return v8::Boolean::New(webkit_glue::IsSingleProcess()); + } }; v8::Extension* BenchmarkingExtension::Get() { diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index 8f6b42c..110d15a 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -248,6 +248,9 @@ void ClearCache(); // Returns the product version. E.g., Chrome/4.1.333.0 std::string GetProductVersion(); +// Returns true if the embedder is running in single process mode. +bool IsSingleProcess(); + // ---- END FUNCTIONS IMPLEMENTED BY EMBEDDER --------------------------------- diff --git a/webkit/support/webkit_support_glue.cc b/webkit/support/webkit_support_glue.cc index 28bf904..a82b941 100644 --- a/webkit/support/webkit_support_glue.cc +++ b/webkit/support/webkit_support_glue.cc @@ -68,4 +68,8 @@ bool DownloadUrl(const std::string& url, HWND caller_window) { } #endif +bool IsSingleProcess() { + return true; +} + } // namespace webkit_glue diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 6845a95..63de00b 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -809,4 +809,8 @@ std::string GetProductVersion() { return std::string("Chrome/0.0.0.0"); } +bool IsSingleProcess() { + return true; +} + } // namespace webkit_glue |