Chromium Code Reviews| 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), |