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

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

Issue 1377223002: Add page load abort metrics to PageLoadMetrics system (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plm_backgrounded_master
Patch Set: Randy review + differentiate between background/foreground layouts 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.h
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.h b/components/page_load_metrics/browser/metrics_web_contents_observer.h
index 45780c10314b8299d30896b9c7e4127739fec65b..c271f6afd0d4b8af4384e62c9e5f0ece7ee0266c 100644
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.h
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h
@@ -12,6 +12,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
+#include "net/base/net_errors.h"
namespace content {
class NavigationHandle;
@@ -24,6 +25,32 @@ class Message;
namespace page_load_metrics {
+enum PageLoadEvent {
+ PAGE_LOAD_STARTED,
+
+ // A provisional load is a load before it commits.
Randy Smith (Not in Mondays) 2015/10/01 17:18:08 Define commits? I.e. (assuming I have the right d
Charlie Harrison 2015/10/01 17:58:17 Done.
+ // A load failed before it was committed for any reason, e.g. from a user
+ // abort or a network timeout.
+ PAGE_LOAD_FAILED_PROVISIONAL,
Randy Smith (Not in Mondays) 2015/10/01 17:18:08 suggestion: I think "FAILED_BEFORE_COMMIT" would b
Charlie Harrison 2015/10/01 17:58:17 Done.
+
+ // A subset of PAGE_LOAD_FAILED_PROVISIONAL, this counts the specific failures
+ // due to user aborts.
+ PAGE_LOAD_ABORTED_PROVISIONAL,
+
+ // When a load is aborted anytime before the page's first layout, we increase
+ // this count. This includes all failed provisional loads.
+ PAGE_LOAD_ABORTED_BEFORE_FIRST_LAYOUT,
+
+ // We increase this count if a page load successfully has a layout.
Randy Smith (Not in Mondays) 2015/10/01 17:18:09 nit: "these counts"
Charlie Harrison 2015/10/01 17:58:17 Done.
+ // Differentiate between loads that were backgrounded before first layout.
Randy Smith (Not in Mondays) 2015/10/01 17:18:08 Just confirming: If a page is backgrounded and the
Charlie Harrison 2015/10/01 17:58:17 Yupp, I edited the comment.
+ PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_FG,
+ PAGE_LOAD_SUCCESSFUL_FIRST_LAYOUT_BG,
Randy Smith (Not in Mondays) 2015/10/01 17:18:08 We historically discourage abbreviations in chromi
+
+ // Add values before this final count. Make sure you also update
+ // histograms.xml.
Randy Smith (Not in Mondays) 2015/10/01 17:18:09 Actually, the note about the link to histograms.xm
Charlie Harrison 2015/10/01 17:58:17 Done.
+ PAGE_LOAD_LAST_ENTRY
+};
+
class PageLoadTracker {
public:
explicit PageLoadTracker(bool in_foreground);
@@ -33,6 +60,7 @@ class PageLoadTracker {
// Returns true if the timing was successfully updated.
bool UpdateTiming(const PageLoadTiming& timing);
+ void RecordEvent(PageLoadEvent event);
private:
void RecordTimingHistograms();
« no previous file with comments | « components/page_load_metrics/browser/DEPS ('k') | components/page_load_metrics/browser/metrics_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698