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

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

Issue 760763002: Add startup metrics that measure the performance of the first web contents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from asvitkine, rkaplow. Created 6 years 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
Index: chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
index 5ca78d2c878dadfd35ef372b82e66b50e6ab46ac..93c9c70f7f84cda0b6d0a8b79b9b7407fe73d433 100644
--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -264,6 +264,12 @@ void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
UMA_HISTOGRAM_COUNTS_100("Hardware.Display.Count.OnStartup", display_count_);
gfx::Screen::GetNativeScreen()->AddObserver(this);
is_screen_observer_ = true;
+
+ if (FirstWebContentsProfiler::ShouldCollectMetrics()) {
+ first_web_contents_profiler_ =
+ FirstWebContentsProfiler::CreateProfilerForFirstWebContents(this)
+ .Pass();
+ }
}
void ChromeBrowserMainExtraPartsMetrics::OnDisplayAdded(
@@ -281,6 +287,10 @@ void ChromeBrowserMainExtraPartsMetrics::OnDisplayMetricsChanged(
uint32_t changed_metrics) {
}
+void ChromeBrowserMainExtraPartsMetrics::ProfilerFinishedCollectingMetrics() {
+ first_web_contents_profiler_.reset();
+}
+
void ChromeBrowserMainExtraPartsMetrics::EmitDisplaysChangedMetric() {
int display_count = gfx::Screen::GetNativeScreen()->GetNumDisplays();
if (display_count != display_count_) {

Powered by Google App Engine
This is Rietveld 408576698