Index: chrome/renderer/chrome_content_renderer_client.cc |
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc |
index a7323cea1cd522c1f9443b76f8820260882f5184..779a8a4cb55243d3705dd389a118073b3d0f2d88 100644 |
--- a/chrome/renderer/chrome_content_renderer_client.cc |
+++ b/chrome/renderer/chrome_content_renderer_client.cc |
@@ -62,6 +62,7 @@ |
#include "components/nacl/renderer/ppb_nacl_private.h" |
#include "components/nacl/renderer/ppb_nacl_private_impl.h" |
#include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
+#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" |
#include "components/password_manager/content/renderer/credential_manager_client.h" |
#include "components/pdf/renderer/pepper_pdf_host.h" |
#include "components/plugins/renderer/mobile_youtube_plugin.h" |
@@ -564,6 +565,12 @@ void ChromeContentRendererClient::RenderFrameCreated( |
new NetErrorHelper(render_frame); |
} |
+ if (render_frame->GetWebFrame()->parent() == nullptr) { |
+ // Only attach MainRenderFrameObserver to the main frame, since |
+ // we only want to log page load metrics for the main frame. |
+ new page_load_metrics::MetricsRenderFrameObserver(render_frame); |
+ } |
+ |
PasswordAutofillAgent* password_autofill_agent = |
new PasswordAutofillAgent(render_frame); |
PasswordGenerationAgent* password_generation_agent = |