| 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 5ca418e271de989d0e38c62fb8fb3c904efb6dfb..1271275c888356e7f288989121df0a0781fd6096 100644
|
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| @@ -128,14 +128,13 @@ PageLoadTracker::~PageLoadTracker() {
|
|
|
| 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();
|
| }
|
|
|
| @@ -195,9 +194,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_);
|
|
|