summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/DEPS3
-rw-r--r--webkit/extensions/v8/benchmarking_extension.cc13
2 files changed, 16 insertions, 0 deletions
diff --git a/webkit/DEPS b/webkit/DEPS
index 113d8488..a8ad57f 100644
--- a/webkit/DEPS
+++ b/webkit/DEPS
@@ -14,6 +14,9 @@ include_rules = [
# For databases/
"+app/sql",
+ # For extensions/v8/benchmarking_extension.cc
+ "+chrome/common",
+
# TODO(brettw) - review these; move up if it's ok, or remove the dependency
"+net/base",
"+net/ftp",
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() {