| 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 5039557a870d9105b727da9e2eddc1834b170424..17f9c102caaa0a17934b041abce18f424ae00417 100644
|
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| @@ -49,6 +49,8 @@ const char kAbortChainSizeNoCommit[] =
|
| "PageLoad.Internal.ProvisionalAbortChainSize.NoCommit";
|
| const char kClientRedirectDelayAfterPaint[] =
|
| "PageLoad.Internal.ClientRedirectDelayAfterPaint";
|
| +const char kCommitToCompleteNoTimingIPCs[] =
|
| + "PageLoad.Internal.CommitToComplete.NoTimingIPCs";
|
|
|
| } // namespace internal
|
|
|
| @@ -263,9 +265,14 @@ PageLoadTracker::~PageLoadTracker() {
|
| return;
|
|
|
| const PageLoadExtraInfo info = ComputePageLoadExtraInfo();
|
| -
|
| + DCHECK_NE(static_cast<bool>(info.time_to_commit),
|
| + static_cast<bool>(failed_provisional_load_info_));
|
| if (info.time_to_commit && timing_.IsEmpty()) {
|
| RecordInternalError(ERR_NO_IPCS_RECEIVED);
|
| + const base::TimeTicks commit_time =
|
| + navigation_start_ + info.time_to_commit.value();
|
| + PAGE_LOAD_HISTOGRAM(internal::kCommitToCompleteNoTimingIPCs,
|
| + base::TimeTicks::Now() - commit_time);
|
| }
|
| // Recall that trackers that are given ABORT_UNKNOWN_NAVIGATION have their
|
| // chain length added to the next navigation. Take care not to double count
|
| @@ -274,7 +281,12 @@ PageLoadTracker::~PageLoadTracker() {
|
| LogAbortChainHistograms(nullptr);
|
|
|
| for (const auto& observer : observers_) {
|
| - observer->OnComplete(timing_, info);
|
| + if (failed_provisional_load_info_) {
|
| + observer->OnFailedProvisionalLoad(failed_provisional_load_info_.value(),
|
| + info);
|
| + } else {
|
| + observer->OnComplete(timing_, info);
|
| + }
|
| }
|
| }
|
|
|
| @@ -367,9 +379,9 @@ void PageLoadTracker::Commit(content::NavigationHandle* navigation_handle) {
|
|
|
| void PageLoadTracker::FailedProvisionalLoad(
|
| content::NavigationHandle* navigation_handle) {
|
| - for (const auto& observer : observers_) {
|
| - observer->OnFailedProvisionalLoad(navigation_handle);
|
| - }
|
| + failed_provisional_load_info_ = FailedProvisionalLoadInfo(
|
| + base::TimeTicks::Now() - navigation_handle->NavigationStart(),
|
| + navigation_handle->GetNetErrorCode());
|
| }
|
|
|
| void PageLoadTracker::Redirect(content::NavigationHandle* navigation_handle) {
|
|
|