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

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

Issue 1169503002: Do not record startup metrics when non-browser UI was displayed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 5 years, 6 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
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 a75ffdc09e986da4dd64717583a031f703a4e82d..c933c95e7057ebce391738c68e5efb3182380875 100644
--- a/chrome/browser/metrics/first_web_contents_profiler.cc
+++ b/chrome/browser/metrics/first_web_contents_profiler.cc
@@ -4,6 +4,8 @@
#if !defined(OS_ANDROID)
+#include <string>
+
#include "chrome/browser/metrics/first_web_contents_profiler.h"
#include "base/location.h"
@@ -17,6 +19,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/metrics/profiler/tracking_synchronizer.h"
#include "components/metrics/proto/profiler_event.pb.h"
+#include "components/startup_metric_utils/startup_metric_utils.h"
#include "content/public/browser/browser_thread.h"
namespace {
@@ -128,6 +131,10 @@ FirstWebContentsProfiler::FirstWebContentsProfiler(
void FirstWebContentsProfiler::DidFirstVisuallyNonEmptyPaint() {
if (collected_paint_metric_)
return;
+ if (startup_metric_utils::WasNonBrowserUIDisplayed()) {
+ FinishedCollectingMetrics();
+ return;
+ }
collected_paint_metric_ = true;
if (!process_creation_time_.is_null()) {
@@ -167,6 +174,10 @@ void FirstWebContentsProfiler::DidFirstVisuallyNonEmptyPaint() {
void FirstWebContentsProfiler::DocumentOnLoadCompletedInMainFrame() {
if (collected_load_metric_)
return;
+ if (startup_metric_utils::WasNonBrowserUIDisplayed()) {
+ FinishedCollectingMetrics();
+ return;
+ }
collected_load_metric_ = true;
if (!process_creation_time_.is_null()) {
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/simple_message_box_mac.mm » ('j') | chrome/browser/ui/profile_error_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698