| 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 df37a05170039af3a2dc72aef32bfb39e3572255..ab5b7c2bcb36d59e505b21c7d0ae327616214995 100644
|
| --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
|
| @@ -69,13 +69,9 @@ PageLoadTracker::PageLoadTracker(bool in_foreground)
|
| }
|
|
|
| PageLoadTracker::~PageLoadTracker() {
|
| - // Even a load that failed a provisional load should log
|
| - // that it aborted before first layout.
|
| - if (timing_.first_layout.is_zero())
|
| - RecordEvent(PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT);
|
| -
|
| - if (has_commit_)
|
| + if (has_commit_) {
|
| RecordTimingHistograms();
|
| + }
|
| }
|
|
|
| void PageLoadTracker::WebContentsHidden() {
|
| @@ -135,7 +131,10 @@ void PageLoadTracker::RecordTimingHistograms() {
|
| timing_.load_event_start);
|
| }
|
| }
|
| - if (!timing_.first_layout.is_zero()) {
|
| + if (timing_.first_layout.is_zero()) {
|
| + RecordEvent(PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT);
|
| + RecordEvent(PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT_RELEVANT);
|
| + } else {
|
| if (timing_.first_layout < background_delta) {
|
| PAGE_LOAD_HISTOGRAM("PageLoad.Timing2.NavigationToFirstLayout",
|
| timing_.first_layout);
|
| @@ -198,8 +197,10 @@ void MetricsWebContentsObserver::DidFinishNavigation(
|
| // will be ignored.
|
| if (!navigation_handle->HasCommitted()) {
|
| finished_nav->RecordEvent(PAGE_LOAD_FAILED_BEFORE_COMMIT);
|
| - if (navigation_handle->GetNetErrorCode() == net::ERR_ABORTED)
|
| + if (navigation_handle->GetNetErrorCode() == net::ERR_ABORTED) {
|
| finished_nav->RecordEvent(PAGE_LOAD_ABORTED_BEFORE_COMMIT);
|
| + finished_nav->RecordEvent(PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT);
|
| + }
|
| return;
|
| }
|
|
|
|
|