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

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

Issue 2199953002: Add CLIENT_REDIRECT variants for page load metrics abort types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aborts
Patch Set: fix histogram name Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
index dbb772135dbdce4e998988ef972c52ff1548b4af..f34a99596684586f6fd870b85392677e2762b6e4 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
@@ -191,6 +191,9 @@ void RecordAppBackgroundPageLoadCompleted(bool completed_after_background) {
// TODO(csharrison): Add a case for client side redirects, which is what JS
// initiated window.location / window.history navigations get set to.
UserAbortType AbortTypeForPageTransition(ui::PageTransition transition) {
+ if (transition & ui::PAGE_TRANSITION_CLIENT_REDIRECT) {
+ return ABORT_CLIENT_REDIRECT;
+ }
if (ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD))
return ABORT_RELOAD;
if (transition & ui::PAGE_TRANSITION_FORWARD_BACK)
@@ -334,6 +337,12 @@ void PageLoadTracker::LogAbortChainHistograms(
UMA_HISTOGRAM_COUNTS(internal::kAbortChainSizeForwardBack,
aborted_chain_size_);
return;
+ // TODO(csharrison): Refactor this code so it is based on the WillStart*
+ // code path instead of the committed load code path. Then, for every abort
+ // chain, log a histogram of the counts of each of these metrics. For now,
+ // merge client redirects with new navigations, which was (basically) the
+ // previous behavior.
+ case ABORT_CLIENT_REDIRECT:
case ABORT_NEW_NAVIGATION:
UMA_HISTOGRAM_COUNTS(internal::kAbortChainSizeNewNavigation,
aborted_chain_size_);
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698