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

Unified Diff: components/page_load_metrics/browser/metrics_web_contents_observer.cc

Issue 1686643002: Add metric with time between background tab being foregrounded and the first paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: components/page_load_metrics/browser/metrics_web_contents_observer.cc
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.cc b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
index 81747999c028915585e5ee3799c708978daacb5d..21130fa48e099d66c5a0a96865dcc28282b0fb88 100644
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
@@ -159,14 +159,13 @@ void PageLoadTracker::LogAbortChainHistograms(
void PageLoadTracker::WebContentsHidden() {
// Only log the first time we background in a given page load.
- if (started_in_foreground_ && background_time_.is_null())
+ if (background_time_.is_null())
background_time_ = base::TimeTicks::Now();
}
void PageLoadTracker::WebContentsShown() {
// Only log the first time we foreground in a given page load.
- // Don't log foreground time if we started foregrounded.
- if (!started_in_foreground_ && foreground_time_.is_null())
+ if (foreground_time_.is_null())
foreground_time_ = base::TimeTicks::Now();
}
@@ -227,9 +226,9 @@ PageLoadExtraInfo PageLoadTracker::GetPageLoadMetricsInfo() {
base::TimeDelta first_foreground_time;
base::TimeDelta time_to_abort;
base::TimeDelta time_to_commit;
- if (!background_time_.is_null() && started_in_foreground_)
+ if (!background_time_.is_null())
first_background_time = background_time_ - navigation_start_;
- if (!foreground_time_.is_null() && !started_in_foreground_)
+ if (!foreground_time_.is_null())
first_foreground_time = foreground_time_ - navigation_start_;
if (abort_type_ != ABORT_NONE) {
DCHECK_GT(abort_time_, navigation_start_);

Powered by Google App Engine
This is Rietveld 408576698