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

Unified Diff: components/page_load_metrics/browser/page_load_metrics_observer.h

Issue 1476503004: [page_load_metrics] User Initiated Abort Tracking (Observer version) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new_observer
Patch Set: Update for EventOccurredInForeground Created 5 years 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/page_load_metrics_observer.h
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h
index dddfb823179542be103f0cad7af6189d2699f13a..2d3d0f757ab51c2dcacfe6a5ecf8c3a1e2f17515 100644
--- a/components/page_load_metrics/browser/page_load_metrics_observer.h
+++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -11,11 +11,47 @@
namespace page_load_metrics {
+class PageLoadMetricsObservable;
+
+// This enum represents how a page load ends. If the action occurs before the
+// page load finishes (or reaches some point like first paint), then we consider
+// the load to be aborted.
+enum UserAbortType {
+ // Represents no abort.
+ ABORT_NONE,
+
+ // If the user presses reload or shift-reload.
+ ABORT_RELOAD,
+
+ // The user presses the back/forward button.
+ ABORT_FORWARD_BACK,
+
+ // If the navigation is replaced by a new navigation. This includes link
+ // clicks, typing in the omnibox (not a reload), and form submissions.
+ ABORT_NEW_NAVIGATION,
+
+ // If the user presses the stop X button.
+ ABORT_STOP,
+
+ // If the navigation is aborted by closing the tab or browser.
+ ABORT_CLOSE,
+
+ // We don't know why the navigation aborted. This is the value we assign to an
+ // aborted load if the only signal we get is a provisional load finishing
+ // without committing, either without error or with net::ERR_ABORTED.
+ ABORT_OTHER,
+
+ // Add values before this final count.
+ ABORT_LAST_ENTRY
+};
+
struct PageLoadExtraInfo {
PageLoadExtraInfo(const base::TimeDelta& first_background_time,
const base::TimeDelta& first_foreground_time,
bool started_in_foreground,
- bool has_commit);
+ bool has_commit,
+ UserAbortType abort_type,
+ const base::TimeDelta& time_to_abort);
// Returns the time to first background if the page load started in the
// foreground. If the page has not been backgrounded, or the page started in
@@ -32,6 +68,12 @@ struct PageLoadExtraInfo {
// True if the page load committed and received its first bytes of data.
const bool has_commit;
+
+ // The abort time and time to abort for this page load. If the page was not
+ // aborted, |abort_type| will be |ABORT_NONE| and |time_to_abort| will be
+ // |base::TimeDelta()|.
+ const UserAbortType abort_type;
+ const base::TimeDelta time_to_abort;
};
// Interface for PageLoadMetrics observers. All instances of this class are

Powered by Google App Engine
This is Rietveld 408576698