From 46210f046927e1d822da3fd46a8ef87df28043e4 Mon Sep 17 00:00:00 2001 From: "mlloyd@chromium.org" Date: Fri, 2 Jul 2010 18:03:41 +0000 Subject: 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 --- webkit/extensions/v8/benchmarking_extension.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'webkit/extensions') 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 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(); } @@ -73,6 +80,10 @@ class BenchmarkingWrapper : public v8::Extension { int counter = StatsTable::current()->GetCounterValue(name); return v8::Integer::New(counter); } + + static v8::Handle IsSingleProcess(const v8::Arguments& args) { + return v8::Boolean::New(webkit_glue::IsSingleProcess()); + } }; v8::Extension* BenchmarkingExtension::Get() { -- cgit v1.1