| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 // The start URL for this page load (before redirects). | 241 // The start URL for this page load (before redirects). |
| 242 GURL start_url_; | 242 GURL start_url_; |
| 243 | 243 |
| 244 std::unique_ptr<FailedProvisionalLoadInfo> failed_provisional_load_info_; | 244 std::unique_ptr<FailedProvisionalLoadInfo> failed_provisional_load_info_; |
| 245 | 245 |
| 246 // Will be ABORT_NONE if we have not aborted this load yet. Otherwise will | 246 // Will be ABORT_NONE if we have not aborted this load yet. Otherwise will |
| 247 // be the first abort action the user performed. | 247 // be the first abort action the user performed. |
| 248 UserAbortType abort_type_; | 248 UserAbortType abort_type_; |
| 249 | 249 |
| 250 // This boolean is only an approximation. As the aborts pipeline is updated, | |
| 251 // more abort types will have this set to true. Currently, this is only set | |
| 252 // for navigations aborting navigations. | |
| 253 bool abort_user_initiated_; | |
| 254 | |
| 255 base::TimeTicks abort_time_; | 250 base::TimeTicks abort_time_; |
| 256 | 251 |
| 257 // We record separate metrics for events that occur after a background, | 252 // We record separate metrics for events that occur after a background, |
| 258 // because metrics like layout/paint are delayed artificially | 253 // because metrics like layout/paint are delayed artificially |
| 259 // when they occur in the background. | 254 // when they occur in the background. |
| 260 base::TimeTicks background_time_; | 255 base::TimeTicks background_time_; |
| 261 base::TimeTicks foreground_time_; | 256 base::TimeTicks foreground_time_; |
| 262 bool started_in_foreground_; | 257 bool started_in_foreground_; |
| 263 | 258 |
| 264 PageLoadTiming timing_; | 259 PageLoadTiming timing_; |
| 265 PageLoadMetadata metadata_; | 260 PageLoadMetadata metadata_; |
| 266 | 261 |
| 267 ui::PageTransition page_transition_; | 262 ui::PageTransition page_transition_; |
| 268 | 263 |
| 269 // Note: these are only approximations, based on WebContents attribution from | 264 // Note: these are only approximations, based on WebContents attribution from |
| 270 // ResourceRequestInfo objects while this is the currently committed load in | 265 // ResourceRequestInfo objects while this is the currently committed load in |
| 271 // the WebContents. | 266 // the WebContents. |
| 272 int num_cache_requests_; | 267 int num_cache_requests_; |
| 273 int num_network_requests_; | 268 int num_network_requests_; |
| 274 | 269 |
| 275 // This is derived from the user gesture bit in the renderer. For browser | 270 // This is derived from the user gesture bit in the renderer. For browser |
| 276 // initiated navigations this will always be true. | 271 // initiated navigations this will always be true. |
| 277 bool user_gesture_; | 272 bool user_initiated_; |
| 278 | 273 |
| 279 // This is a subtle member. If a provisional load A gets aborted by | 274 // This is a subtle member. If a provisional load A gets aborted by |
| 280 // provisional load B, which gets aborted by C that eventually commits, then | 275 // provisional load B, which gets aborted by C that eventually commits, then |
| 281 // there exists an abort chain of length 2, starting at A's navigation_start. | 276 // there exists an abort chain of length 2, starting at A's navigation_start. |
| 282 // This is useful because it allows histograming abort chain lengths based on | 277 // This is useful because it allows histograming abort chain lengths based on |
| 283 // what the last load's transition type is. i.e. holding down F-5 to spam | 278 // what the last load's transition type is. i.e. holding down F-5 to spam |
| 284 // reload will produce a long chain with the RELOAD transition. | 279 // reload will produce a long chain with the RELOAD transition. |
| 285 const int aborted_chain_size_; | 280 const int aborted_chain_size_; |
| 286 | 281 |
| 287 // This member counts consecutive provisional aborts that share a url. It will | 282 // This member counts consecutive provisional aborts that share a url. It will |
| 288 // always be less than or equal to |aborted_chain_size_|. | 283 // always be less than or equal to |aborted_chain_size_|. |
| 289 const int aborted_chain_size_same_url_; | 284 const int aborted_chain_size_same_url_; |
| 290 | 285 |
| 291 // Interface to chrome features. Must outlive the class. | 286 // Interface to chrome features. Must outlive the class. |
| 292 PageLoadMetricsEmbedderInterface* const embedder_interface_; | 287 PageLoadMetricsEmbedderInterface* const embedder_interface_; |
| 293 | 288 |
| 294 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_; | 289 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_; |
| 295 | 290 |
| 296 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker); | 291 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker); |
| 297 }; | 292 }; |
| 298 | 293 |
| 299 } // namespace page_load_metrics | 294 } // namespace page_load_metrics |
| 300 | 295 |
| 301 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ | 296 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ |
| OLD | NEW |