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

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

Issue 1350673003: Remove WebContentsObserver::DidCommitNavigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 080f00b076152f9052e85a3fe361e88888520c83..3a1fbd9302c38026492c1c708a2043fa0efe8827 100644
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
@@ -71,8 +71,10 @@ bool MetricsWebContentsObserver::OnMessageReceived(
return handled;
}
-void MetricsWebContentsObserver::DidCommitNavigation(
+void MetricsWebContentsObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->HasCommitted())
+ return;
if (navigation_handle->IsInMainFrame() && !navigation_handle->IsSamePage())
RecordTimingHistograms();
if (IsRelevantNavigation(navigation_handle))
@@ -148,7 +150,7 @@ bool MetricsWebContentsObserver::IsRelevantNavigation(
const GURL& browser_url = web_contents()->GetLastCommittedURL();
return navigation_handle->IsInMainFrame() &&
!navigation_handle->IsSamePage() &&
- navigation_handle->HasCommittedDocument() &&
+ !navigation_handle->IsErrorPage() &&
navigation_handle->GetURL().SchemeIsHTTPOrHTTPS() &&
browser_url.SchemeIsHTTPOrHTTPS();
}

Powered by Google App Engine
This is Rietveld 408576698