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..d1dd6f68349d785a76702bb70f859a6a5d60a09d 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,15 @@ void HTMLDocument::didAddMessageToConsole( |
<< message.text.utf8(); |
} |
+void HTMLDocument::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 HTMLDocument::didFinishLoad(blink::WebLocalFrame* frame) { |
// TODO(msw): Notify AxProvider clients of updates on child frame loads. |
did_finish_load_ = true; |
@@ -415,6 +428,15 @@ void HTMLDocument::didNavigateWithinPage( |
navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); |
} |
+void HTMLDocument::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::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() { |
return global_state_->media_factory()->GetEncryptedMediaClient(); |
} |