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

Unified Diff: components/html_viewer/html_document.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: Cleanup 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
Index: components/html_viewer/html_document.cc
diff --git a/components/html_viewer/html_document.cc b/components/html_viewer/html_document.cc
index 3d3a30312f8d2bcd0d25fe810d12bdd4513cd578..f699c86d98701db95c399f2552d0422493e08587 100644
--- a/components/html_viewer/html_document.cc
+++ b/components/html_viewer/html_document.cc
@@ -19,6 +19,7 @@
#include "components/html_viewer/geolocation_client_impl.h"
#include "components/html_viewer/global_state.h"
#include "components/html_viewer/media_factory.h"
+#include "components/html_viewer/stats_collection_controller.h"
#include "components/html_viewer/web_layer_tree_view_impl.h"
#include "components/html_viewer/web_storage_namespace_impl.h"
#include "components/html_viewer/web_url_loader_impl.h"
@@ -247,6 +248,9 @@ void HTMLDocument::Load(URLResponsePtr response) {
new DevToolsAgentImpl(main_frame, html_document_app_->shell()));
}
+ startup_performance_data_collector_ =
+ StatsCollectionController::Install(main_frame, html_document_app_);
+
GURL url(response->url);
WebURLRequestExtraData* extra_data = new WebURLRequestExtraData;
@@ -398,6 +402,13 @@ void HTMLDocument::didAddMessageToConsole(
<< message.text.utf8();
}
+void HTMLDocument::didHandleOnloadEvents(blink::WebLocalFrame* frame) {
+ if (startup_performance_data_collector_.get()) {
yzshen1 2015/08/17 05:46:38 nit: ".get()" is not necessary for null-check. (I
msw 2015/08/17 21:25:50 Done; thanks for the extra info.
+ startup_performance_data_collector_->SetFirstWebContentsMainFrameLoadTime(
yzshen1 2015/08/17 05:46:38 Do you think we should comment on why we call this
msw 2015/08/17 21:25:50 The mojom explains that only the first time is rec
+ base::Time::Now().ToInternalValue());
+ }
+}
+
void HTMLDocument::didFinishLoad(blink::WebLocalFrame* frame) {
// TODO(msw): Notify AxProvider clients of updates on child frame loads.
did_finish_load_ = true;
@@ -415,6 +426,13 @@ void HTMLDocument::didNavigateWithinPage(
navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
}
+void HTMLDocument::didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame) {
+ if (startup_performance_data_collector_) {
+ startup_performance_data_collector_->SetFirstVisuallyNonEmptyLayoutTime(
+ base::Time::Now().ToInternalValue());
+ }
+}
+
blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() {
return global_state_->media_factory()->GetEncryptedMediaClient();
}

Powered by Google App Engine
This is Rietveld 408576698