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

Unified Diff: components/html_viewer/html_frame.cc

Issue 1278673002: Add stats collection for telemetry startup.warm.blank_page test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment. Created 5 years, 4 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
« no previous file with comments | « components/html_viewer/html_frame.h ('k') | components/html_viewer/html_frame_tree_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/html_frame.cc
diff --git a/components/html_viewer/html_frame.cc b/components/html_viewer/html_frame.cc
index dfa183f3beb9556d4ee8167f2029b3b241cdd763..3a897a1045b8f529cebde6cdf7ce16b7fcfccce9 100644
--- a/components/html_viewer/html_frame.cc
+++ b/components/html_viewer/html_frame.cc
@@ -23,6 +23,7 @@
#include "components/html_viewer/html_frame_properties.h"
#include "components/html_viewer/html_frame_tree_manager.h"
#include "components/html_viewer/media_factory.h"
+#include "components/html_viewer/stats_collection_controller.h"
#include "components/html_viewer/touch_handler.h"
#include "components/html_viewer/web_layer_impl.h"
#include "components/html_viewer/web_layer_tree_view_impl.h"
@@ -162,6 +163,11 @@ HTMLFrame::HTMLFrame(CreateParams* params)
blink::WebRemoteFrame::create(state_.tree_scope, this);
local_web_frame->swap(remote_web_frame);
web_frame_ = remote_web_frame;
+ } else {
+ // Collect startup perf data for local main frames in test environments.
+ // Child frames aren't tracked, and tracking remote frames is redundant.
+ startup_performance_data_collector_ =
+ StatsCollectionController::Install(web_frame_, GetLocalRootApp());
}
} else if (!params->allow_local_shared_frame && params->view &&
id_ == params->view->id()) {
@@ -750,6 +756,15 @@ void HTMLFrame::didAddMessageToConsole(const blink::WebConsoleMessage& message,
<< message.text.utf8();
}
+void HTMLFrame::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
+ static bool recorded = false;
+ if (!recorded && startup_performance_data_collector_) {
+ startup_performance_data_collector_->SetFirstWebContentsMainFrameLoadTime(
+ base::Time::Now().ToInternalValue());
+ recorded = true;
+ }
+}
+
void HTMLFrame::didFinishLoad(blink::WebLocalFrame* frame) {
if (GetLocalRoot() == this)
delegate_->OnFrameDidFinishLoad();
@@ -762,6 +777,15 @@ void HTMLFrame::didNavigateWithinPage(blink::WebLocalFrame* frame,
history_item.urlString().utf8());
}
+void HTMLFrame::didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame) {
+ static bool recorded = false;
+ if (!recorded && startup_performance_data_collector_) {
+ startup_performance_data_collector_->SetFirstVisuallyNonEmptyLayoutTime(
+ base::Time::Now().ToInternalValue());
+ recorded = true;
+ }
+}
+
blink::WebGeolocationClient* HTMLFrame::geolocationClient() {
if (!geolocation_client_impl_)
geolocation_client_impl_.reset(new GeolocationClientImpl);
« no previous file with comments | « components/html_viewer/html_frame.h ('k') | components/html_viewer/html_frame_tree_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698