Chromium Code Reviews| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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& committed_url, |
| 115 const GURL& start_url, | 115 const GURL& start_url, |
| 116 UserAbortType abort_type, | 116 UserAbortType abort_type, |
| 117 UserInitiatedInfo abort_user_initiated_info, | 117 UserInitiatedInfo abort_user_initiated_info, |
| 118 const base::Optional<base::TimeDelta>& time_to_abort, | 118 const base::Optional<base::TimeDelta>& time_to_abort, |
| 119 int num_cache_requests, | 119 int num_cache_requests, |
| 120 int num_network_requests, | 120 int num_network_requests, |
| 121 int64_t cache_bytes, | |
| 122 int64_t net_bytes, | |
| 121 const PageLoadMetadata& metadata); | 123 const PageLoadMetadata& metadata); |
| 122 | 124 |
| 123 PageLoadExtraInfo(const PageLoadExtraInfo& other); | 125 PageLoadExtraInfo(const PageLoadExtraInfo& other); |
| 124 | 126 |
| 125 ~PageLoadExtraInfo(); | 127 ~PageLoadExtraInfo(); |
| 126 | 128 |
| 127 // The first time that the page was backgrounded since the navigation started. | 129 // The first time that the page was backgrounded since the navigation started. |
| 128 const base::Optional<base::TimeDelta> first_background_time; | 130 const base::Optional<base::TimeDelta> first_background_time; |
| 129 | 131 |
| 130 // The first time that the page was foregrounded since the navigation started. | 132 // The first time that the page was foregrounded since the navigation started. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 161 UserInitiatedInfo abort_user_initiated_info; | 163 UserInitiatedInfo abort_user_initiated_info; |
| 162 | 164 |
| 163 const base::Optional<base::TimeDelta> time_to_abort; | 165 const base::Optional<base::TimeDelta> time_to_abort; |
| 164 | 166 |
| 165 // Note: these are only approximations, based on WebContents attribution from | 167 // Note: these are only approximations, based on WebContents attribution from |
| 166 // ResourceRequestInfo objects while this is the currently committed load in | 168 // ResourceRequestInfo objects while this is the currently committed load in |
| 167 // the WebContents. | 169 // the WebContents. |
| 168 int num_cache_requests; | 170 int num_cache_requests; |
| 169 int num_network_requests; | 171 int num_network_requests; |
| 170 | 172 |
| 173 // Bytes consumed by this page. | |
| 174 int64_t cache_bytes; | |
| 175 int64_t network_bytes; | |
|
Bryan McQuade
2016/12/16 14:28:45
i think it's implicit, but just to be extra clear,
jkarlin
2016/12/19 19:26:01
Done.
| |
| 176 | |
| 171 // Extra information supplied to the page load metrics system from the | 177 // Extra information supplied to the page load metrics system from the |
| 172 // renderer. | 178 // renderer. |
| 173 const PageLoadMetadata metadata; | 179 const PageLoadMetadata metadata; |
| 174 }; | 180 }; |
| 175 | 181 |
| 176 // Interface for PageLoadMetrics observers. All instances of this class are | 182 // Interface for PageLoadMetrics observers. All instances of this class are |
| 177 // owned by the PageLoadTracker tracking a page load. | 183 // owned by the PageLoadTracker tracking a page load. |
| 178 class PageLoadMetricsObserver { | 184 class PageLoadMetricsObserver { |
| 179 public: | 185 public: |
| 180 // ObservePolicy is used as a return value on some PageLoadMetricsObserver | 186 // ObservePolicy is used as a return value on some PageLoadMetricsObserver |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 // OnFailedProvisionalLoad is invoked for tracked page loads that did not | 311 // OnFailedProvisionalLoad is invoked for tracked page loads that did not |
| 306 // commit, immediately before the observer is deleted. | 312 // commit, immediately before the observer is deleted. |
| 307 virtual void OnFailedProvisionalLoad( | 313 virtual void OnFailedProvisionalLoad( |
| 308 const FailedProvisionalLoadInfo& failed_provisional_load_info, | 314 const FailedProvisionalLoadInfo& failed_provisional_load_info, |
| 309 const PageLoadExtraInfo& extra_info) {} | 315 const PageLoadExtraInfo& extra_info) {} |
| 310 }; | 316 }; |
| 311 | 317 |
| 312 } // namespace page_load_metrics | 318 } // namespace page_load_metrics |
| 313 | 319 |
| 314 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 320 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |