Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1528)

Unified Diff: chrome/browser/metrics/first_web_contents_profiler.cc

Issue 2388803003: Fix FirstWebContentsProfiler not getting created when using session restore. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/first_web_contents_profiler.h ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/first_web_contents_profiler.cc
diff --git a/chrome/browser/metrics/first_web_contents_profiler.cc b/chrome/browser/metrics/first_web_contents_profiler.cc
index 5e317c031aca4f5c2d613339d034727a499f9d34..2805f25b248b395b7743465dac20221d548a0412 100644
--- a/chrome/browser/metrics/first_web_contents_profiler.cc
+++ b/chrome/browser/metrics/first_web_contents_profiler.cc
@@ -19,6 +19,16 @@
#include "components/startup_metric_utils/browser/startup_metric_utils.h"
#include "content/public/browser/navigation_handle.h"
+void FirstWebContentsProfiler::WebContentsStarted(
+ content::WebContents* web_contents) {
+ static bool first_web_contents_profiled = false;
+ if (first_web_contents_profiled)
+ return;
+
+ first_web_contents_profiled = true;
+ new FirstWebContentsProfiler(web_contents);
gab 2016/10/04 19:15:17 // FirstWebContentsProfiler owns itself.
jam 2016/10/04 19:19:17 acknowledged, although in this case I think if som
gab 2016/10/04 19:26:23 okay, I personally find bare "new" surprising and
+}
+
FirstWebContentsProfiler::FirstWebContentsProfiler(
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
« no previous file with comments | « chrome/browser/metrics/first_web_contents_profiler.h ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698