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

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

Issue 2223453003: Thread user gesture through page_load_metrics abort pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 base::TimeDelta time_to_failed_provisional_load; 59 base::TimeDelta time_to_failed_provisional_load;
60 net::Error error; 60 net::Error error;
61 }; 61 };
62 62
63 struct PageLoadExtraInfo { 63 struct PageLoadExtraInfo {
64 PageLoadExtraInfo( 64 PageLoadExtraInfo(
65 const base::Optional<base::TimeDelta>& first_background_time, 65 const base::Optional<base::TimeDelta>& first_background_time,
66 const base::Optional<base::TimeDelta>& first_foreground_time, 66 const base::Optional<base::TimeDelta>& first_foreground_time,
67 bool started_in_foreground, 67 bool started_in_foreground,
68 bool user_gesture,
68 const GURL& committed_url, 69 const GURL& committed_url,
69 const base::Optional<base::TimeDelta>& time_to_commit, 70 const base::Optional<base::TimeDelta>& time_to_commit,
70 UserAbortType abort_type, 71 UserAbortType abort_type,
72 bool abort_user_initiated,
71 const base::Optional<base::TimeDelta>& time_to_abort, 73 const base::Optional<base::TimeDelta>& time_to_abort,
72 int num_cache_requests, 74 int num_cache_requests,
73 int num_network_requests, 75 int num_network_requests,
74 const PageLoadMetadata& metadata); 76 const PageLoadMetadata& metadata);
75 77
76 PageLoadExtraInfo(const PageLoadExtraInfo& other); 78 PageLoadExtraInfo(const PageLoadExtraInfo& other);
77 79
78 ~PageLoadExtraInfo(); 80 ~PageLoadExtraInfo();
79 81
80 // The first time that the page was backgrounded since the navigation started. 82 // The first time that the page was backgrounded since the navigation started.
81 const base::Optional<base::TimeDelta> first_background_time; 83 const base::Optional<base::TimeDelta> first_background_time;
82 84
83 // The first time that the page was foregrounded since the navigation started. 85 // The first time that the page was foregrounded since the navigation started.
84 const base::Optional<base::TimeDelta> first_foreground_time; 86 const base::Optional<base::TimeDelta> first_foreground_time;
85 87
86 // True if the page load started in the foreground. 88 // True if the page load started in the foreground.
87 const bool started_in_foreground; 89 const bool started_in_foreground;
88 90
91 // True if this is either a browser initiated navigation or the user_gesture
92 // bit is true in the renderer.
93 const bool user_gesture;
94
89 // Committed URL. If the page load did not commit, |committed_url| will be 95 // Committed URL. If the page load did not commit, |committed_url| will be
90 // empty. 96 // empty.
91 const GURL committed_url; 97 const GURL committed_url;
92 98
93 // Time from navigation start until commit. 99 // Time from navigation start until commit.
94 const base::Optional<base::TimeDelta> time_to_commit; 100 const base::Optional<base::TimeDelta> time_to_commit;
95 101
96 // The abort time and time to abort for this page load. If the page was not 102 // The abort time and time to abort for this page load. If the page was not
97 // aborted, |abort_type| will be |ABORT_NONE|. 103 // aborted, |abort_type| will be |ABORT_NONE|.
98 const UserAbortType abort_type; 104 const UserAbortType abort_type;
99 105
106 // TODO(csharrison): If more metadata for aborts is needed we should provide a
107 // better abstraction. Note that this is an approximation.
108 bool abort_user_initiated;
109
100 const base::Optional<base::TimeDelta> time_to_abort; 110 const base::Optional<base::TimeDelta> time_to_abort;
101 111
102 // Note: these are only approximations, based on WebContents attribution from 112 // Note: these are only approximations, based on WebContents attribution from
103 // ResourceRequestInfo objects while this is the currently committed load in 113 // ResourceRequestInfo objects while this is the currently committed load in
104 // the WebContents. 114 // the WebContents.
105 int num_cache_requests; 115 int num_cache_requests;
106 int num_network_requests; 116 int num_network_requests;
107 117
108 // Extra information supplied to the page load metrics system from the 118 // Extra information supplied to the page load metrics system from the
109 // renderer. 119 // renderer.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // loads that result in downloads or 204s are aborted by the system, and are 225 // loads that result in downloads or 204s are aborted by the system, and are
216 // also included as failed provisional loads. 226 // also included as failed provisional loads.
217 virtual void OnFailedProvisionalLoad( 227 virtual void OnFailedProvisionalLoad(
218 const FailedProvisionalLoadInfo& failed_provisional_load_info, 228 const FailedProvisionalLoadInfo& failed_provisional_load_info,
219 const PageLoadExtraInfo& extra_info) {} 229 const PageLoadExtraInfo& extra_info) {}
220 }; 230 };
221 231
222 } // namespace page_load_metrics 232 } // namespace page_load_metrics
223 233
224 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 234 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698