Chromium Code Reviews| 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(); |
| } |