| 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 94528773f8549445bc1188541819f3a6ebf81317..433d7e0d2af00c198ae2a0b06f074bb965436d0d 100644
|
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| @@ -192,8 +192,7 @@ PageLoadTracker::PageLoadTracker(
|
|
|
| PageLoadTracker::~PageLoadTracker() {
|
| const PageLoadExtraInfo info = GetPageLoadMetricsInfo();
|
| - if (!info.time_to_commit.is_zero() && renderer_tracked() &&
|
| - timing_.IsEmpty()) {
|
| + if (info.committed && renderer_tracked() && timing_.IsEmpty()) {
|
| RecordInternalError(ERR_NO_IPCS_RECEIVED);
|
| }
|
| // Recall that trackers that are given ABORT_UNKNOWN_NAVIGATION have their
|
| @@ -331,27 +330,30 @@ PageLoadExtraInfo PageLoadTracker::GetPageLoadMetricsInfo() {
|
| base::TimeDelta first_foreground_time;
|
| base::TimeDelta time_to_abort;
|
| base::TimeDelta time_to_commit;
|
| + bool committed = false;
|
| if (!background_time_.is_null())
|
| first_background_time = background_time_ - navigation_start_;
|
| if (!foreground_time_.is_null())
|
| first_foreground_time = foreground_time_ - navigation_start_;
|
| if (abort_type_ != ABORT_NONE) {
|
| - DCHECK_GT(abort_time_, navigation_start_);
|
| + DCHECK_GE(abort_time_, navigation_start_);
|
| time_to_abort = abort_time_ - navigation_start_;
|
| } else {
|
| DCHECK(abort_time_.is_null());
|
| }
|
|
|
| if (!commit_time_.is_null()) {
|
| - DCHECK_GT(commit_time_, navigation_start_);
|
| + DCHECK_GE(commit_time_, navigation_start_);
|
| time_to_commit = commit_time_ - navigation_start_;
|
| + committed = true;
|
| } else {
|
| DCHECK(commit_time_.is_null());
|
| }
|
| +
|
| return PageLoadExtraInfo(first_background_time, first_foreground_time,
|
| - started_in_foreground_,
|
| - commit_time_.is_null() ? GURL() : url_,
|
| - time_to_commit, abort_type_, time_to_abort);
|
| + started_in_foreground_, committed ? url_ : GURL(),
|
| + committed, time_to_commit, abort_type_,
|
| + time_to_abort);
|
| }
|
|
|
| void PageLoadTracker::NotifyAbort(UserAbortType abort_type,
|
|
|