| OLD | NEW |
| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 user_gesture(user_gesture), | 104 user_gesture(user_gesture), |
| 105 user_input_event(user_input_event) {} | 105 user_input_event(user_input_event) {} |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 struct PageLoadExtraInfo { | 108 struct PageLoadExtraInfo { |
| 109 PageLoadExtraInfo( | 109 PageLoadExtraInfo( |
| 110 const base::Optional<base::TimeDelta>& first_background_time, | 110 const base::Optional<base::TimeDelta>& first_background_time, |
| 111 const base::Optional<base::TimeDelta>& first_foreground_time, | 111 const base::Optional<base::TimeDelta>& first_foreground_time, |
| 112 bool started_in_foreground, | 112 bool started_in_foreground, |
| 113 UserInitiatedInfo user_initiated_info, | 113 UserInitiatedInfo user_initiated_info, |
| 114 const GURL& committed_url, | 114 const GURL& url, |
| 115 const GURL& start_url, | 115 const GURL& start_url, |
| 116 bool did_commit, |
| 116 UserAbortType abort_type, | 117 UserAbortType abort_type, |
| 117 UserInitiatedInfo abort_user_initiated_info, | 118 UserInitiatedInfo abort_user_initiated_info, |
| 118 const base::Optional<base::TimeDelta>& time_to_abort, | 119 const base::Optional<base::TimeDelta>& time_to_abort, |
| 119 const PageLoadMetadata& metadata); | 120 const PageLoadMetadata& metadata); |
| 120 | 121 |
| 121 PageLoadExtraInfo(const PageLoadExtraInfo& other); | 122 PageLoadExtraInfo(const PageLoadExtraInfo& other); |
| 122 | 123 |
| 123 ~PageLoadExtraInfo(); | 124 ~PageLoadExtraInfo(); |
| 124 | 125 |
| 125 // The first time that the page was backgrounded since the navigation started. | 126 // The first time that the page was backgrounded since the navigation started. |
| 126 const base::Optional<base::TimeDelta> first_background_time; | 127 const base::Optional<base::TimeDelta> first_background_time; |
| 127 | 128 |
| 128 // The first time that the page was foregrounded since the navigation started. | 129 // The first time that the page was foregrounded since the navigation started. |
| 129 const base::Optional<base::TimeDelta> first_foreground_time; | 130 const base::Optional<base::TimeDelta> first_foreground_time; |
| 130 | 131 |
| 131 // True if the page load started in the foreground. | 132 // True if the page load started in the foreground. |
| 132 const bool started_in_foreground; | 133 const bool started_in_foreground; |
| 133 | 134 |
| 134 // Whether the page load was initiated by a user. | 135 // Whether the page load was initiated by a user. |
| 135 const UserInitiatedInfo user_initiated_info; | 136 const UserInitiatedInfo user_initiated_info; |
| 136 | 137 |
| 137 // Committed URL. If the page load did not commit, |committed_url| will be | 138 // Most recent URL for this page. Can be updated at navigation start, upon |
| 138 // empty. | 139 // redirection, and at commit time. |
| 139 const GURL committed_url; | 140 const GURL url; |
| 140 | 141 |
| 141 // The URL that started the navigation, before redirects. | 142 // The URL that started the navigation, before redirects. |
| 142 const GURL start_url; | 143 const GURL start_url; |
| 143 | 144 |
| 145 // Whether the navigation for this page load committed. |
| 146 const bool did_commit; |
| 147 |
| 144 // The abort time and time to abort for this page load. If the page was not | 148 // The abort time and time to abort for this page load. If the page was not |
| 145 // aborted, |abort_type| will be |ABORT_NONE|. | 149 // aborted, |abort_type| will be |ABORT_NONE|. |
| 146 const UserAbortType abort_type; | 150 const UserAbortType abort_type; |
| 147 | 151 |
| 148 // Whether the abort for this page load was user initiated. For example, if | 152 // Whether the abort for this page load was user initiated. For example, if |
| 149 // this page load was aborted by a new navigation, this field tracks whether | 153 // this page load was aborted by a new navigation, this field tracks whether |
| 150 // that new navigation was user-initiated. This field is only useful if this | 154 // that new navigation was user-initiated. This field is only useful if this |
| 151 // page load's abort type is a value other than ABORT_NONE. Note that this | 155 // page load's abort type is a value other than ABORT_NONE. Note that this |
| 152 // value is currently experimental, and is subject to change. In particular, | 156 // value is currently experimental, and is subject to change. In particular, |
| 153 // this field is not currently set for some abort types, such as stop and | 157 // this field is not currently set for some abort types, such as stop and |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 const FailedProvisionalLoadInfo& failed_provisional_load_info, | 330 const FailedProvisionalLoadInfo& failed_provisional_load_info, |
| 327 const PageLoadExtraInfo& extra_info) {} | 331 const PageLoadExtraInfo& extra_info) {} |
| 328 | 332 |
| 329 // Called whenever a request is loaded for this page load. | 333 // Called whenever a request is loaded for this page load. |
| 330 virtual void OnLoadedResource(const ExtraRequestInfo& extra_request_info) {} | 334 virtual void OnLoadedResource(const ExtraRequestInfo& extra_request_info) {} |
| 331 }; | 335 }; |
| 332 | 336 |
| 333 } // namespace page_load_metrics | 337 } // namespace page_load_metrics |
| 334 | 338 |
| 335 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 339 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |