Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
index a58984656eec1b8effd05e16e67ee570f0d744ab..f3b298d0f73d7988d6e737885322e0fc81075b4d 100644 |
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
@@ -64,17 +64,18 @@ UserInitiatedInfo CreateUserInitiatedInfo( |
} // namespace |
-// static |
MetricsWebContentsObserver::MetricsWebContentsObserver( |
content::WebContents* web_contents, |
std::unique_ptr<PageLoadMetricsEmbedderInterface> embedder_interface) |
: content::WebContentsObserver(web_contents), |
in_foreground_(false), |
embedder_interface_(std::move(embedder_interface)), |
- has_navigated_(false) { |
+ has_navigated_(false), |
+ page_load_metrics_binding_(web_contents, this) { |
RegisterInputEventObserver(web_contents->GetRenderViewHost()); |
} |
+// static |
MetricsWebContentsObserver* MetricsWebContentsObserver::CreateForWebContents( |
content::WebContents* web_contents, |
std::unique_ptr<PageLoadMetricsEmbedderInterface> embedder_interface) { |
@@ -580,6 +581,14 @@ void MetricsWebContentsObserver::OnTimingUpdated( |
committed_load_->UpdateTiming(timing, metadata); |
} |
+void MetricsWebContentsObserver::UpdateTiming( |
+ const PageLoadTiming& timing, |
+ const PageLoadMetadata& metadata) { |
+ content::RenderFrameHost* render_frame_host = |
+ page_load_metrics_binding_.GetCurrentTargetFrame(); |
+ OnTimingUpdated(render_frame_host, timing, metadata); |
Zhen Wang
2017/04/19 18:49:54
This is using the same timing update function as t
Zhen Wang
2017/04/19 18:56:31
I just realized that you may not need to do any sp
|
+} |
+ |
bool MetricsWebContentsObserver::ShouldTrackNavigation( |
content::NavigationHandle* navigation_handle) const { |
DCHECK(navigation_handle->IsInMainFrame()); |