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

Side by Side Diff: chrome/browser/page_load_metrics/page_load_metrics_observer.h

Issue 2132603002: [page_load_metrics] Add a NavigationThrottle for richer abort metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko@ nits 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/optional.h" 9 #include "base/optional.h"
10 #include "chrome/common/page_load_metrics/page_load_timing.h" 10 #include "chrome/common/page_load_metrics/page_load_timing.h"
(...skipping 24 matching lines...) Expand all
35 ABORT_STOP, 35 ABORT_STOP,
36 36
37 // If the navigation is aborted by closing the tab or browser. 37 // If the navigation is aborted by closing the tab or browser.
38 ABORT_CLOSE, 38 ABORT_CLOSE,
39 39
40 // We don't know why the navigation aborted. This is the value we assign to an 40 // We don't know why the navigation aborted. This is the value we assign to an
41 // aborted load if the only signal we get is a provisional load finishing 41 // aborted load if the only signal we get is a provisional load finishing
42 // without committing, either without error or with net::ERR_ABORTED. 42 // without committing, either without error or with net::ERR_ABORTED.
43 ABORT_OTHER, 43 ABORT_OTHER,
44 44
45 // The load aborted due to another navigation, but it isn't clear what type of
46 // navigation it was.
47 ABORT_UNKNOWN_NAVIGATION,
48
49 // Add values before this final count. 45 // Add values before this final count.
50 ABORT_LAST_ENTRY 46 ABORT_LAST_ENTRY
51 }; 47 };
52 48
53 // Information related to failed provisional loads. 49 // Information related to failed provisional loads.
54 struct FailedProvisionalLoadInfo { 50 struct FailedProvisionalLoadInfo {
55 FailedProvisionalLoadInfo(base::TimeDelta interval, net::Error error); 51 FailedProvisionalLoadInfo(base::TimeDelta interval, net::Error error);
56 ~FailedProvisionalLoadInfo(); 52 ~FailedProvisionalLoadInfo();
57 53
58 base::TimeDelta time_to_failed_provisional_load; 54 base::TimeDelta time_to_failed_provisional_load;
(...skipping 27 matching lines...) Expand all
86 // Committed URL. If the page load did not commit, |committed_url| will be 82 // Committed URL. If the page load did not commit, |committed_url| will be
87 // empty. 83 // empty.
88 const GURL committed_url; 84 const GURL committed_url;
89 85
90 // Time from navigation start until commit. 86 // Time from navigation start until commit.
91 const base::Optional<base::TimeDelta> time_to_commit; 87 const base::Optional<base::TimeDelta> time_to_commit;
92 88
93 // The abort time and time to abort for this page load. If the page was not 89 // The abort time and time to abort for this page load. If the page was not
94 // aborted, |abort_type| will be |ABORT_NONE|. 90 // aborted, |abort_type| will be |ABORT_NONE|.
95 const UserAbortType abort_type; 91 const UserAbortType abort_type;
92
96 const base::Optional<base::TimeDelta> time_to_abort; 93 const base::Optional<base::TimeDelta> time_to_abort;
97 94
98 // Extra information supplied to the page load metrics system from the 95 // Extra information supplied to the page load metrics system from the
99 // renderer. 96 // renderer.
100 const PageLoadMetadata metadata; 97 const PageLoadMetadata metadata;
101 }; 98 };
102 99
103 // Interface for PageLoadMetrics observers. All instances of this class are 100 // Interface for PageLoadMetrics observers. All instances of this class are
104 // owned by the PageLoadTracker tracking a page load. 101 // owned by the PageLoadTracker tracking a page load.
105 class PageLoadMetricsObserver { 102 class PageLoadMetricsObserver {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // loads that result in downloads or 204s are aborted by the system, and are 200 // loads that result in downloads or 204s are aborted by the system, and are
204 // also included as failed provisional loads. 201 // also included as failed provisional loads.
205 virtual void OnFailedProvisionalLoad( 202 virtual void OnFailedProvisionalLoad(
206 const FailedProvisionalLoadInfo& failed_provisional_load_info, 203 const FailedProvisionalLoadInfo& failed_provisional_load_info,
207 const PageLoadExtraInfo& extra_info) {} 204 const PageLoadExtraInfo& extra_info) {}
208 }; 205 };
209 206
210 } // namespace page_load_metrics 207 } // namespace page_load_metrics
211 208
212 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 209 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698