Chromium Code Reviews| 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..b3178dfa50e2c34701e5ab02eedaa3d15abc2477 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,9 @@ HTMLFrame::HTMLFrame(CreateParams* params) |
| blink::WebRemoteFrame::create(state_.tree_scope, this); |
| local_web_frame->swap(remote_web_frame); |
| web_frame_ = remote_web_frame; |
| + } else { |
| + startup_performance_data_collector_ = |
|
yzshen1
2015/08/17 21:45:52
Please consider commenting on why it is only insta
msw
2015/08/17 22:08:04
Done.
|
| + StatsCollectionController::Install(web_frame_, GetLocalRootApp()); |
| } |
| } else if (!params->allow_local_shared_frame && params->view && |
| id_ == params->view->id()) { |
| @@ -750,6 +754,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 +775,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); |