 Chromium Code Reviews
 Chromium Code Reviews Issue 2481013007:
  Improve tracking of user initiated page loads.  (Closed)
    
  
    Issue 2481013007:
  Improve tracking of user initiated page loads.  (Closed) 
  | 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, | 250 // Whether the page load that aborted this page load was user initiated. Only | 
| 
Bryan McQuade
2016/11/10 15:51:22
I changed this comment as I feel this kind of comm
 
Charlie Harrison
2016/11/10 20:33:04
I'd like the comment to remain general, as it is i
 
Bryan McQuade
2016/11/10 20:58:18
Makes sense. I updated the comment to be a little
 | |
| 251 // more abort types will have this set to true. Currently, this is only set | 251 // set if this page load's abort type is set to a value other than ABORT_NONE. | 
| 252 // for navigations aborting navigations. | |
| 253 bool abort_user_initiated_; | 252 bool abort_user_initiated_; | 
| 254 | 253 | 
| 255 base::TimeTicks abort_time_; | 254 base::TimeTicks abort_time_; | 
| 256 | 255 | 
| 257 // We record separate metrics for events that occur after a background, | 256 // We record separate metrics for events that occur after a background, | 
| 258 // because metrics like layout/paint are delayed artificially | 257 // because metrics like layout/paint are delayed artificially | 
| 259 // when they occur in the background. | 258 // when they occur in the background. | 
| 260 base::TimeTicks background_time_; | 259 base::TimeTicks background_time_; | 
| 261 base::TimeTicks foreground_time_; | 260 base::TimeTicks foreground_time_; | 
| 262 bool started_in_foreground_; | 261 bool started_in_foreground_; | 
| 263 | 262 | 
| 264 PageLoadTiming timing_; | 263 PageLoadTiming timing_; | 
| 265 PageLoadMetadata metadata_; | 264 PageLoadMetadata metadata_; | 
| 266 | 265 | 
| 267 ui::PageTransition page_transition_; | 266 ui::PageTransition page_transition_; | 
| 268 | 267 | 
| 269 // Note: these are only approximations, based on WebContents attribution from | 268 // Note: these are only approximations, based on WebContents attribution from | 
| 270 // ResourceRequestInfo objects while this is the currently committed load in | 269 // ResourceRequestInfo objects while this is the currently committed load in | 
| 271 // the WebContents. | 270 // the WebContents. | 
| 272 int num_cache_requests_; | 271 int num_cache_requests_; | 
| 273 int num_network_requests_; | 272 int num_network_requests_; | 
| 274 | 273 | 
| 275 // This is derived from the user gesture bit in the renderer. For browser | 274 // This is derived from the user gesture bit in the renderer. For browser | 
| 276 // initiated navigations this will always be true. | 275 // initiated navigations this will always be true. | 
| 277 bool user_gesture_; | 276 bool user_initiated_; | 
| 278 | 277 | 
| 279 // This is a subtle member. If a provisional load A gets aborted by | 278 // 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 | 279 // 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. | 280 // 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 | 281 // 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 | 282 // 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. | 283 // reload will produce a long chain with the RELOAD transition. | 
| 285 const int aborted_chain_size_; | 284 const int aborted_chain_size_; | 
| 286 | 285 | 
| 287 // This member counts consecutive provisional aborts that share a url. It will | 286 // This member counts consecutive provisional aborts that share a url. It will | 
| 288 // always be less than or equal to |aborted_chain_size_|. | 287 // always be less than or equal to |aborted_chain_size_|. | 
| 289 const int aborted_chain_size_same_url_; | 288 const int aborted_chain_size_same_url_; | 
| 290 | 289 | 
| 291 // Interface to chrome features. Must outlive the class. | 290 // Interface to chrome features. Must outlive the class. | 
| 292 PageLoadMetricsEmbedderInterface* const embedder_interface_; | 291 PageLoadMetricsEmbedderInterface* const embedder_interface_; | 
| 293 | 292 | 
| 294 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_; | 293 std::vector<std::unique_ptr<PageLoadMetricsObserver>> observers_; | 
| 295 | 294 | 
| 296 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker); | 295 DISALLOW_COPY_AND_ASSIGN(PageLoadTracker); | 
| 297 }; | 296 }; | 
| 298 | 297 | 
| 299 } // namespace page_load_metrics | 298 } // namespace page_load_metrics | 
| 300 | 299 | 
| 301 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ | 300 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_TRACKER_H_ | 
| OLD | NEW |