Index: components/html_viewer/html_frame.cc |
diff --git a/components/html_viewer/html_frame.cc b/components/html_viewer/html_frame.cc |
index a63f8ba5f5498d31dd1667c6e5f5fd2ac807f8c2..1297adc8560c45d0ca81a2ad9ad733b16bbf9b81 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" |
@@ -195,6 +196,9 @@ void HTMLFrame::Init( |
remote_web_frame->setReplicatedName(state_.name); |
} |
} |
+ |
+ startup_performance_data_collector_ = |
sky
2015/08/17 20:09:30
Do we really need this for all frames? Should it o
msw
2015/08/17 21:25:50
Done; thanks for the advice!
|
+ StatsCollectionController::Install(web_frame_, GetLocalRootApp()); |
} |
void HTMLFrame::OnViewUnembed() { |
@@ -751,6 +755,13 @@ void HTMLFrame::didAddMessageToConsole(const blink::WebConsoleMessage& message, |
<< message.text.utf8(); |
} |
+void HTMLFrame::didHandleOnloadEvents(blink::WebLocalFrame* frame) { |
+ if (startup_performance_data_collector_.get()) { |
yzshen1
2015/08/17 05:46:38
nit: .get() is not necessary.
msw
2015/08/17 21:25:50
Done.
|
+ startup_performance_data_collector_->SetFirstWebContentsMainFrameLoadTime( |
+ base::Time::Now().ToInternalValue()); |
+ } |
+} |
+ |
void HTMLFrame::didFinishLoad(blink::WebLocalFrame* frame) { |
if (GetLocalRoot() == this) |
delegate_->OnFrameDidFinishLoad(); |
@@ -763,6 +774,13 @@ void HTMLFrame::didNavigateWithinPage(blink::WebLocalFrame* frame, |
history_item.urlString().utf8()); |
} |
+void HTMLFrame::didFirstVisuallyNonEmptyLayout(blink::WebLocalFrame* frame) { |
+ if (startup_performance_data_collector_) { |
+ startup_performance_data_collector_->SetFirstVisuallyNonEmptyLayoutTime( |
+ base::Time::Now().ToInternalValue()); |
+ } |
+} |
+ |
blink::WebGeolocationClient* HTMLFrame::geolocationClient() { |
if (!geolocation_client_impl_) |
geolocation_client_impl_.reset(new GeolocationClientImpl); |