Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1658)

Unified Diff: content/renderer/render_view_impl.cc

Issue 12389073: Collect tab timing information for use in telementry-based startup tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix telemetry tests with reference builds. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 63938f91deffebb60a97f36c3ed7aaa6f30bb513..6aa1142ee69bc2ccfc3c1290eae1e795762181ea 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -111,6 +111,8 @@
#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"
@@ -713,6 +715,9 @@ 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;
@@ -802,6 +807,8 @@ 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);
@@ -3654,6 +3661,15 @@ 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) {

Powered by Google App Engine
This is Rietveld 408576698