diff options
21 files changed, 72 insertions, 355 deletions
diff --git a/chrome/test/perf/page_cycler_test.cc b/chrome/test/perf/page_cycler_test.cc index ce82558..9d13000 100644 --- a/chrome/test/perf/page_cycler_test.cc +++ b/chrome/test/perf/page_cycler_test.cc @@ -130,7 +130,6 @@ class PageCyclerTest : public UIPerfTest { num_test_iterations_(kTestIterations) { show_window_ = true; dom_automation_enabled_ = true; - stats_collection_controller_enabled_ = true; const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); if (parsed_command_line.HasSwitch(switches::kPageCyclerIterations)) { @@ -279,8 +278,8 @@ class PageCyclerTest : public UIPerfTest { ASSERT_TRUE(tab->ExecuteAndExtractString( std::wstring(), L"window.domAutomationController.send(" - L"window.statsCollectionController.getHistogram ? " - L"window.statsCollectionController.getHistogram(\"" + + L"window.domAutomationController.getHistogram ? " + L"window.domAutomationController.getHistogram(\"" + base::SysUTF8ToWide(name) + L"\") : '')", &whistogram)); std::string histogram = base::SysWideToNativeMB(whistogram); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index a767298..8521934 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -85,7 +85,6 @@ UITestBase::UITestBase() homepage_(content::kAboutBlankURL), wait_for_initial_loads_(true), dom_automation_enabled_(false), - stats_collection_controller_enabled_(false), show_window_(false), clear_profile_(true), include_testing_id_(true), @@ -100,7 +99,6 @@ UITestBase::UITestBase(base::MessageLoop::Type msg_loop_type) expected_crashes_(0), wait_for_initial_loads_(true), dom_automation_enabled_(false), - stats_collection_controller_enabled_(false), show_window_(false), clear_profile_(true), include_testing_id_(true), @@ -189,8 +187,6 @@ void UITestBase::SetLaunchSwitches() { launch_arguments_.AppendSwitch(switches::kEnableFileCookies); if (dom_automation_enabled_) launch_arguments_.AppendSwitch(switches::kDomAutomationController); - if (stats_collection_controller_enabled_) - launch_arguments_.AppendSwitch(switches::kStatsCollectionController); // Allow off-store extension installs. launch_arguments_.AppendSwitchASCII( switches::kEasyOffStoreExtensionInstall, "1"); diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 99b3603..02d759a 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -299,10 +299,6 @@ class UITestBase { // This can be set to true to have the test run the dom automation case. bool dom_automation_enabled_; - // This can be set to true to enable the stats collection controller JS - // bindings. - bool stats_collection_controller_enabled_; - // See set_template_user_data(). base::FilePath template_user_data_; diff --git a/content/browser/histogram_message_filter.cc b/content/browser/histogram_message_filter.cc index be6f85fc..ac08af3 100644 --- a/content/browser/histogram_message_filter.cc +++ b/content/browser/histogram_message_filter.cc @@ -49,17 +49,17 @@ void HistogramMessageFilter::OnGetBrowserHistogram( DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); // Security: Only allow access to browser histograms when running in the // context of a test. - bool using_stats_collection_controller = + bool using_dom_controller = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kStatsCollectionController); + switches::kDomAutomationController); bool reduced_security = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kReduceSecurityForStatsCollectionTests); + switches::kReduceSecurityForDomAutomationTests); - if (!using_stats_collection_controller || !reduced_security) { + if (!using_dom_controller || !reduced_security) { LOG(ERROR) << "Attempt at reading browser histogram without specifying " - << "--" << switches::kStatsCollectionController << " and " - << "--" << switches::kReduceSecurityForStatsCollectionTests + << "--" << switches::kDomAutomationController << " and " + << "--" << switches::kReduceSecurityForDomAutomationTests << " switches."; return; } diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 096698c..e864f81 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -942,7 +942,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kRendererStartupDialog, switches::kShowPaintRects, switches::kSitePerProcess, - switches::kStatsCollectionController, switches::kTestSandbox, switches::kTouchEvents, switches::kTraceStartup, diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi index e2cb9d1..4458e98 100644 --- a/content/content_renderer.gypi +++ b/content/content_renderer.gypi @@ -311,10 +311,6 @@ 'renderer/skia_benchmarking_extension.h', 'renderer/speech_recognition_dispatcher.cc', 'renderer/speech_recognition_dispatcher.h', - 'renderer/stats_collection_controller.cc', - 'renderer/stats_collection_controller.h', - 'renderer/stats_collection_observer.cc', - 'renderer/stats_collection_observer.h', 'renderer/text_input_client_observer.cc', 'renderer/text_input_client_observer.h', 'renderer/v8_value_converter_impl.cc', diff --git a/content/public/common/bindings_policy.h b/content/public/common/bindings_policy.h index 8c8a743..140cef3 100644 --- a/content/public/common/bindings_policy.h +++ b/content/public/common/bindings_policy.h @@ -20,11 +20,6 @@ enum BindingsPolicy { BINDINGS_POLICY_DOM_AUTOMATION = 1 << 1, // Bindings that allow access to the external host (through automation). BINDINGS_POLICY_EXTERNAL_HOST = 1 << 2, - // Bindings that allows the JS content to retrieve a variety of internal - // metrics. (By default this isn't allowed unless the app has been started up - // with the --enable-stats-collection-bindings switch.) - BINDINGS_POLICY_STATS_COLLECTION = 1 << 3, - }; } diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 53131ce..de63b7c 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -247,15 +247,8 @@ const char kDomAutomationController[] = "dom-automation"; // Loosen security. Needed for tests using some of the functionality of // |DOMAutomationController|. -const char kReduceSecurityForStatsCollectionTests[] = - "reduce-security-for-stats-collection-tests"; - -// Specifies if the |StatsCollectionController| needs to be bound in the -// renderer. This binding happens on per-frame basis and hence can potentially -// be a performance bottleneck. One should only enable it when running a test -// that needs to access the provided statistics. -const char kStatsCollectionController[] = - "enable-stats-collection-bindings"; +const char kReduceSecurityForDomAutomationTests[] = + "reduce-security-for-dom-automation-tests"; // Enable hardware accelerated page painting. const char kEnableAcceleratedPainting[] = "enable-accelerated-painting"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 70d6628..7bb7b53 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -92,8 +92,7 @@ extern const char kDisableWebSecurity[]; extern const char kEnableExperimentalWebSocket[]; extern const char kDisableXSSAuditor[]; CONTENT_EXPORT extern const char kDomAutomationController[]; -CONTENT_EXPORT extern const char kReduceSecurityForStatsCollectionTests[]; -CONTENT_EXPORT extern const char kStatsCollectionController[]; +CONTENT_EXPORT extern const char kReduceSecurityForDomAutomationTests[]; CONTENT_EXPORT extern const char kEnableAcceleratedPainting[]; CONTENT_EXPORT extern const char kEnableAcceleratedFilters[]; extern const char kEnableAccessibilityLogging[]; diff --git a/content/renderer/dom_automation_controller.cc b/content/renderer/dom_automation_controller.cc index 27120c1..1718d64 100644 --- a/content/renderer/dom_automation_controller.cc +++ b/content/renderer/dom_automation_controller.cc @@ -31,6 +31,12 @@ DomAutomationController::DomAutomationController() base::Unretained(this))); BindCallback("sendWithId", base::Bind(&DomAutomationController::SendWithId, base::Unretained(this))); + BindCallback("getHistogram", + base::Bind(&DomAutomationController::GetHistogram, + base::Unretained(this))); + BindCallback("getBrowserHistogram", + base::Bind(&DomAutomationController::GetBrowserHistogram, + base::Unretained(this))); } void DomAutomationController::Send(const CppArgumentList& args, @@ -171,4 +177,40 @@ void DomAutomationController::SetAutomationId( result->Set(true); } +void DomAutomationController::GetHistogram(const CppArgumentList& args, + CppVariant* result) { + if (args.size() != 1) { + result->SetNull(); + return; + } + base::HistogramBase* histogram = + base::StatisticsRecorder::FindHistogram(args[0].ToString()); + std::string output; + if (!histogram) { + output = "{}"; + } else { + histogram->WriteJSON(&output); + } + result->Set(output); +} + +void DomAutomationController::GetBrowserHistogram(const CppArgumentList& args, + CppVariant* result) { + if (args.size() != 1) { + result->SetNull(); + return; + } + + if (!sender_) { + NOTREACHED(); + result->SetNull(); + return; + } + + std::string histogram_json; + sender_->Send(new ChildProcessHostMsg_GetBrowserHistogram( + args[0].ToString(), &histogram_json)); + result->Set(histogram_json); +} + } // namespace content diff --git a/content/renderer/dom_automation_controller.h b/content/renderer/dom_automation_controller.h index 1516eea..b4fe4c0 100644 --- a/content/renderer/dom_automation_controller.h +++ b/content/renderer/dom_automation_controller.h @@ -115,6 +115,15 @@ class DomAutomationController : public webkit_glue::CppBoundClass { sender_ = sender; } + // Retrieves a histogram and returns a JSON representation of it. + void GetHistogram(const webkit_glue::CppArgumentList& args, + webkit_glue::CppVariant* result); + + // Retrieves a histogram from the browser process and returns a JSON + // representation of it. + void GetBrowserHistogram(const webkit_glue::CppArgumentList& args, + webkit_glue::CppVariant* result); + private: IPC::Sender* sender_; diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 729637a..47d804f 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -110,8 +110,6 @@ #include "content/renderer/renderer_webcolorchooser_impl.h" #include "content/renderer/savable_resources.h" #include "content/renderer/speech_recognition_dispatcher.h" -#include "content/renderer/stats_collection_controller.h" -#include "content/renderer/stats_collection_observer.h" #include "content/renderer/text_input_client_observer.h" #include "content/renderer/v8_value_converter_impl.h" #include "content/renderer/web_ui_extension.h" @@ -715,9 +713,6 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(switches::kStatsCollectionController)) - stats_collection_observer_.reset(new StatsCollectionObserver(this)); - #if defined(OS_ANDROID) content::DeviceTelephonyInfo device_info; @@ -807,8 +802,6 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) { if (command_line.HasSwitch(switches::kDomAutomationController)) enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; - if (command_line.HasSwitch(switches::kStatsCollectionController)) - enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; ProcessViewLayoutFlags(command_line); @@ -3662,15 +3655,6 @@ void RenderViewImpl::didClearWindowObject(WebFrame* frame) { dom_automation_controller_->BindToJavascript(frame, "domAutomationController"); } - - if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION) { - if (!stats_collection_controller_.get()) - stats_collection_controller_.reset(new StatsCollectionController()); - stats_collection_controller_->set_message_sender( - static_cast<RenderView*>(this)); - stats_collection_controller_->BindToJavascript(frame, - "statsCollectionController"); - } } void RenderViewImpl::didCreateDocumentElement(WebFrame* frame) { diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 39734b4..3bef002 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -38,7 +38,6 @@ #include "content/renderer/render_view_pepper_helper.h" #include "content/renderer/render_widget.h" #include "content/renderer/renderer_webcookiejar_impl.h" -#include "content/renderer/stats_collection_observer.h" #include "ipc/ipc_platform_file.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" @@ -165,7 +164,6 @@ class RendererPpapiHost; class RendererWebColorChooserImpl; class RenderWidgetFullscreenPepper; class SpeechRecognitionDispatcher; -class StatsCollectionController; class WebPluginDelegateProxy; struct CustomContextMenuContext; struct FaviconURL; @@ -269,12 +267,6 @@ class CONTENT_EXPORT RenderViewImpl void AddObserver(RenderViewObserver* observer); void RemoveObserver(RenderViewObserver* observer); - // Returns the StatsCollectionObserver associated with this view, or NULL - // if one wasn't created; - StatsCollectionObserver* GetStatsCollectionObserver() { - return stats_collection_observer_.get(); - } - // Adds the given file chooser request to the file_chooser_completion_ queue // (see that var for more) and requests the chooser be displayed if there are // no other waiting items in the queue. @@ -1530,20 +1522,14 @@ class CONTENT_EXPORT RenderViewImpl // DOM automation bindings are enabled. scoped_ptr<DomAutomationController> dom_automation_controller_; - // Allows JS to read out a variety of internal various metrics. The JS object - // is only exposed when the stats collection bindings are enabled. - scoped_ptr<StatsCollectionController> stats_collection_controller_; - // This field stores drag/drop related info for the event that is currently // being handled. If the current event results in starting a drag/drop // session, this info is sent to the browser along with other drag/drop info. DragEventSourceInfo possible_drag_event_info_; - // NOTE: pepper_helper_ and stats_collection_observer_ should be the last - // members because their constructors call the AddObservers method of - // RenderViewImpl. + // NOTE: pepper_helper_ should be last member because its constructor calls + // AddObservers method of RenderViewImpl from c-tor. scoped_ptr<RenderViewPepperHelper> pepper_helper_; - scoped_ptr<StatsCollectionObserver> stats_collection_observer_; // --------------------------------------------------------------------------- // ADDING NEW DATA? Please see if it fits appropriately in one of the above diff --git a/content/renderer/stats_collection_controller.cc b/content/renderer/stats_collection_controller.cc deleted file mode 100644 index 9826eef..0000000 --- a/content/renderer/stats_collection_controller.cc +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/renderer/stats_collection_controller.h" - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/json/json_writer.h" -#include "base/metrics/histogram.h" -#include "base/metrics/statistics_recorder.h" -#include "base/string_util.h" -#include "content/common/child_process_messages.h" -#include "content/renderer/render_view_impl.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" - -using webkit_glue::CppArgumentList; -using webkit_glue::CppVariant; - -namespace content { - -namespace { - -bool CurrentRenderViewImpl(RenderViewImpl** out) { - WebKit::WebFrame* web_frame = WebKit::WebFrame::frameForCurrentContext(); - if (!web_frame) - return false; - - WebKit::WebView* web_view = web_frame->view(); - if (!web_view) - return false; - - RenderViewImpl* render_view_impl = - RenderViewImpl::FromWebView(web_view); - if (!render_view_impl) - return false; - - *out = render_view_impl; - return true; -} - -// Encodes a WebContentsLoadTime as JSON. -// Input: -// - |load_start_time| - time at which page load started. -// - |load_stop_time| - time at which page load stopped. -// - |result| - returned JSON. -// Example return value: -// {'load_start_ms': 1, 'load_duration_ms': 2.5} -// either value may be null if a web contents hasn't fully loaded. -// load_start_ms is represented as milliseconds since system boot. -void ConvertLoadTimeToJSON( - const base::TimeTicks& load_start_time, - const base::TimeTicks& load_stop_time, - std::string *result) { - DictionaryValue item; - - if (load_start_time.is_null()) { - item.Set("load_start_ms", Value::CreateNullValue()); - } else { - // This code relies on an implementation detail of TimeTicks::Now() - that - // its return value happens to coincide with the system uptime value in - // microseconds, on Win/Mac/iOS/Linux/ChromeOS and Android. See comments - // in base::SysInfo::Uptime(). - item.SetDouble("load_start_ms", load_start_time.ToInternalValue() / 1000); - } - if (load_stop_time.is_null() || load_stop_time.is_null()) { - item.Set("load_duration_ms", Value::CreateNullValue()); - } else { - item.SetDouble("load_duration_ms", - (load_stop_time - load_start_time).InMilliseconds()); - } - base::JSONWriter::Write(&item, result); -} - -} // namespace - -StatsCollectionController::StatsCollectionController() - : sender_(NULL) { - BindCallback("getHistogram", - base::Bind(&StatsCollectionController::GetHistogram, - base::Unretained(this))); - BindCallback("getBrowserHistogram", - base::Bind(&StatsCollectionController::GetBrowserHistogram, - base::Unretained(this))); - BindCallback("tabLoadTiming", - base::Bind( - &StatsCollectionController::GetTabLoadTiming, - base::Unretained(this))); -} - -void StatsCollectionController::GetHistogram(const CppArgumentList& args, - CppVariant* result) { - if (args.size() != 1) { - result->SetNull(); - return; - } - base::HistogramBase* histogram = - base::StatisticsRecorder::FindHistogram(args[0].ToString()); - std::string output; - if (!histogram) { - output = "{}"; - } else { - histogram->WriteJSON(&output); - } - result->Set(output); -} - -void StatsCollectionController::GetBrowserHistogram(const CppArgumentList& args, - CppVariant* result) { - if (args.size() != 1) { - result->SetNull(); - return; - } - - if (!sender_) { - NOTREACHED(); - result->SetNull(); - return; - } - - std::string histogram_json; - sender_->Send(new ChildProcessHostMsg_GetBrowserHistogram( - args[0].ToString(), &histogram_json)); - result->Set(histogram_json); -} - -void StatsCollectionController::GetTabLoadTiming( - const CppArgumentList& args, - CppVariant* result) { - if (!sender_) { - NOTREACHED(); - result->SetNull(); - return; - } - - RenderViewImpl *render_view_impl = NULL; - if (!CurrentRenderViewImpl(&render_view_impl)) { - NOTREACHED(); - result->SetNull(); - return; - } - - StatsCollectionObserver* observer = - render_view_impl->GetStatsCollectionObserver(); - if (!observer) { - NOTREACHED(); - result->SetNull(); - return; - } - - std::string tab_timing_json; - ConvertLoadTimeToJSON( - observer->load_start_time(), observer->load_stop_time(), - &tab_timing_json); - result->Set(tab_timing_json); -} - -} // namespace content diff --git a/content/renderer/stats_collection_controller.h b/content/renderer/stats_collection_controller.h deleted file mode 100644 index eb1ccb0..0000000 --- a/content/renderer/stats_collection_controller.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_ -#define CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_ - -#include "ipc/ipc_sender.h" -#include "webkit/glue/cpp_bound_class.h" - -namespace content { - -// This class is exposed in JS as window.statsCollectionController and provides -// functionality to read out statistics from the browser. -// Its use must be enabled specifically via the -// --enable-stats-collection-bindings command line flag. -class StatsCollectionController : public webkit_glue::CppBoundClass { - public: - StatsCollectionController(); - - void set_message_sender(IPC::Sender* sender) { - sender_ = sender; - } - - // Retrieves a histogram and returns a JSON representation of it. - void GetHistogram(const webkit_glue::CppArgumentList& args, - webkit_glue::CppVariant* result); - - // Retrieves a histogram from the browser process and returns a JSON - // representation of it. - void GetBrowserHistogram(const webkit_glue::CppArgumentList& args, - webkit_glue::CppVariant* result); - - // Returns JSON representation of tab timing information for the current tab. - void GetTabLoadTiming(const webkit_glue::CppArgumentList& args, - webkit_glue::CppVariant* result); - private: - IPC::Sender* sender_; -}; - -} // namespace content - -#endif // CONTENT_RENDERER_STATS_COLLECTION_CONTROLLER_H_ diff --git a/content/renderer/stats_collection_observer.cc b/content/renderer/stats_collection_observer.cc deleted file mode 100644 index 4192ec0..0000000 --- a/content/renderer/stats_collection_observer.cc +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/renderer/stats_collection_observer.h" - -#include "base/time.h" -#include "content/renderer/render_view_impl.h" - -namespace content { - -StatsCollectionObserver::StatsCollectionObserver(RenderViewImpl* render_view) - : RenderViewObserver(render_view) { -} - -StatsCollectionObserver::~StatsCollectionObserver() { -} - -void StatsCollectionObserver::DidStartLoading() { - DCHECK(start_time_.is_null()); - start_time_ = base::TimeTicks::Now(); -} - -void StatsCollectionObserver::DidStopLoading() { - DCHECK(stop_time_.is_null()); - stop_time_ = base::TimeTicks::Now(); - - // Stop observing so we don't get called again. - RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); - impl->RemoveObserver(this); -} - -} // namespace content diff --git a/content/renderer/stats_collection_observer.h b/content/renderer/stats_collection_observer.h deleted file mode 100644 index 52d67b8..0000000 --- a/content/renderer/stats_collection_observer.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_RENDERER_STATS_COLLECTION_OBSERVER_H_ -#define CONTENT_RENDERER_STATS_COLLECTION_OBSERVER_H_ - -#include "base/time.h" -#include "content/public/renderer/render_view_observer.h" - -namespace content { - -class RenderViewImpl; - -// Collect timing information for page loads. -// If a Renderview performs multiple loads, only the first one is recorded. -class StatsCollectionObserver : public RenderViewObserver { - public: - explicit StatsCollectionObserver(RenderViewImpl* render_view); - virtual ~StatsCollectionObserver(); - - // RenderViewObserver implementation - virtual void DidStartLoading() OVERRIDE; - virtual void DidStopLoading() OVERRIDE; - - // Timing for the page load start and stop. These functions may return - // a null time value under various circumstances. - const base::TimeTicks& load_start_time() { return start_time_; } - const base::TimeTicks& load_stop_time() { return stop_time_; } - - private: - base::TimeTicks start_time_; - base::TimeTicks stop_time_; - - DISALLOW_COPY_AND_ASSIGN(StatsCollectionObserver); -}; - -} // namespace content - -#endif // CONTENT_RENDERER_STATS_COLLECTION_OBSERVER_H_ diff --git a/tools/perf/perf_tools/histogram_metric.py b/tools/perf/perf_tools/histogram_metric.py index 10b9a27..d05394e 100644 --- a/tools/perf/perf_tools/histogram_metric.py +++ b/tools/perf/perf_tools/histogram_metric.py @@ -36,7 +36,7 @@ class HistogramMetric(object): return 'getHistogram' def _GetHistogramFromDomAutomation(self, tab): - js = ('window.statsCollectionController.%s ? ' - 'window.statsCollectionController.%s("%s") : ""' % + js = ('window.domAutomationController.%s ? ' + 'window.domAutomationController.%s("%s") : ""' % (self.histogram_function, self.histogram_function, self.name)) return tab.EvaluateJavaScript(js) diff --git a/tools/perf/perf_tools/memory_measurement.py b/tools/perf/perf_tools/memory_measurement.py index 476f746..37e14a2 100644 --- a/tools/perf/perf_tools/memory_measurement.py +++ b/tools/perf/perf_tools/memory_measurement.py @@ -29,7 +29,7 @@ class MemoryMeasurement(page_measurement.PageMeasurement): h.Start(page, tab) def CustomizeBrowserOptions(self, options): - options.AppendExtraBrowserArg('--enable-stats-collection-bindings') + options.AppendExtraBrowserArg('--dom-automation') # For a hard-coded set of Google pages (such as GMail), we produce custom # memory histograms (V8.Something_gmail) instead of the generic histograms # (V8.Something), if we detect that a renderer is only rendering this page @@ -38,8 +38,7 @@ class MemoryMeasurement(page_measurement.PageMeasurement): # pages. options.AppendExtraBrowserArg('--disable-histogram-customizer') options.AppendExtraBrowserArg('--memory-metrics') - options.AppendExtraBrowserArg( - '--reduce-security-for-stats-collection-tests') + options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests') def CanRunForPage(self, page): return hasattr(page, 'stress_memory') diff --git a/tools/perf/perf_tools/page_cycler.py b/tools/perf/perf_tools/page_cycler.py index e629000..6c5d1da 100644 --- a/tools/perf/perf_tools/page_cycler.py +++ b/tools/perf/perf_tools/page_cycler.py @@ -62,7 +62,7 @@ class PageCycler(page_measurement.PageMeasurement): h.Start(page, tab) def CustomizeBrowserOptions(self, options): - options.AppendExtraBrowserArg('--enable-stats-collection-bindings') + options.AppendExtraBrowserArg('--dom-automation') options.AppendExtraBrowserArg('--js-flags=--expose_gc') options.AppendExtraBrowserArg('--no-sandbox') diff --git a/tools/perf/perf_tools/startup_measurement.py b/tools/perf/perf_tools/startup_measurement.py index a182ebe..0c4284f 100644 --- a/tools/perf/perf_tools/startup_measurement.py +++ b/tools/perf/perf_tools/startup_measurement.py @@ -19,12 +19,11 @@ class PerfWarm(page_measurement.PageMeasurement): discard_first_result=True) def CustomizeBrowserOptions(self, options): - options.AppendExtraBrowserArg('--enable-stats-collection-bindings') - options.AppendExtraBrowserArg( - '--reduce-security-for-stats-collection-tests') + options.AppendExtraBrowserArg('--dom-automation') + options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests') def MeasurePage(self, page, tab, results): - get_histogram_js = "statsCollectionController.getBrowserHistogram(\"%s\")" + get_histogram_js = "domAutomationController.getBrowserHistogram(\"%s\")" for display_name, histogram_name in self.HISTOGRAMS_TO_RECORD.iteritems(): result = tab.EvaluateJavaScript(get_histogram_js % histogram_name) |