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 0d15216c24b23715201435999c527e6b5e2e46ba..54cfa044d80b4ff1d27859c014f8f40cc557c869 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) { |
@@ -599,6 +600,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); |
+} |
+ |
bool MetricsWebContentsObserver::ShouldTrackNavigation( |
content::NavigationHandle* navigation_handle) const { |
DCHECK(navigation_handle->IsInMainFrame()); |