summaryrefslogtreecommitdiffstats
path: root/webkit/extensions
diff options
context:
space:
mode:
authormlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 21:40:28 +0000
committermlloyd@chromium.org <mlloyd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 21:40:28 +0000
commitf7451d29b7efd0c08007a5f56414006cee20a3ef (patch)
tree798df5bcc6c177ead3ff164ccd441e32c8d43378 /webkit/extensions
parentfb129a38e3f5148fd564a9df0132a4acbbd01ddb (diff)
downloadchromium_src-f7451d29b7efd0c08007a5f56414006cee20a3ef.zip
chromium_src-f7451d29b7efd0c08007a5f56414006cee20a3ef.tar.gz
chromium_src-f7451d29b7efd0c08007a5f56414006cee20a3ef.tar.bz2
Show a warning message if the cache might not be cleared correctly between runs.
This new version adds a missing dep to webkit/DEPS. BUG=44688 TEST=trybots pass Review URL: http://codereview.chromium.org/2875010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/extensions')
-rw-r--r--webkit/extensions/v8/benchmarking_extension.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/webkit/extensions/v8/benchmarking_extension.cc
index 362a928..8eb0f00 100644
--- a/webkit/extensions/v8/benchmarking_extension.cc
+++ b/webkit/extensions/v8/benchmarking_extension.cc
@@ -2,7 +2,9 @@
// 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 "chrome/common/chrome_switches.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
#include "webkit/extensions/v8/benchmarking_extension.h"
#include "webkit/glue/webkit_glue.h"
@@ -35,6 +37,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 +51,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 +81,11 @@ 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(CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess));
+ }
};
v8::Extension* BenchmarkingExtension::Get() {