| 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 #include "chrome/browser/page_load_metrics/page_load_tracker.h" | 5 #include "chrome/browser/page_load_metrics/page_load_tracker.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 abort_user_initiated_info_(UserInitiatedInfo::NotUserInitiated()), | 298 abort_user_initiated_info_(UserInitiatedInfo::NotUserInitiated()), |
| 299 started_in_foreground_(in_foreground), | 299 started_in_foreground_(in_foreground), |
| 300 page_transition_(navigation_handle->GetPageTransition()), | 300 page_transition_(navigation_handle->GetPageTransition()), |
| 301 num_cache_requests_(0), | 301 num_cache_requests_(0), |
| 302 num_network_requests_(0), | 302 num_network_requests_(0), |
| 303 user_initiated_info_(user_initiated_info), | 303 user_initiated_info_(user_initiated_info), |
| 304 aborted_chain_size_(aborted_chain_size), | 304 aborted_chain_size_(aborted_chain_size), |
| 305 aborted_chain_size_same_url_(aborted_chain_size_same_url), | 305 aborted_chain_size_same_url_(aborted_chain_size_same_url), |
| 306 embedder_interface_(embedder_interface) { | 306 embedder_interface_(embedder_interface) { |
| 307 DCHECK(!navigation_handle->HasCommitted()); | 307 DCHECK(!navigation_handle->HasCommitted()); |
| 308 if (embedder_interface_->IsPrerendering( | |
| 309 navigation_handle->GetWebContents())) { | |
| 310 DCHECK(!started_in_foreground_); | |
| 311 // For the time being, we do not track prerenders. See crbug.com/648338 for | |
| 312 // details. | |
| 313 StopTracking(); | |
| 314 return; | |
| 315 } | |
| 316 | |
| 317 embedder_interface_->RegisterObservers(this); | 308 embedder_interface_->RegisterObservers(this); |
| 318 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnStart, navigation_handle, | 309 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnStart, navigation_handle, |
| 319 currently_committed_url, started_in_foreground_); | 310 currently_committed_url, started_in_foreground_); |
| 320 } | 311 } |
| 321 | 312 |
| 322 PageLoadTracker::~PageLoadTracker() { | 313 PageLoadTracker::~PageLoadTracker() { |
| 323 if (app_entered_background_) { | 314 if (app_entered_background_) { |
| 324 RecordAppBackgroundPageLoadCompleted(true); | 315 RecordAppBackgroundPageLoadCompleted(true); |
| 325 } | 316 } |
| 326 | 317 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 // user initiated. | 675 // user initiated. |
| 685 if (abort_type != ABORT_CLIENT_REDIRECT) | 676 if (abort_type != ABORT_CLIENT_REDIRECT) |
| 686 abort_user_initiated_info_ = user_initiated_info; | 677 abort_user_initiated_info_ = user_initiated_info; |
| 687 | 678 |
| 688 if (is_certainly_browser_timestamp) { | 679 if (is_certainly_browser_timestamp) { |
| 689 ClampBrowserTimestampIfInterProcessTimeTickSkew(&abort_time_); | 680 ClampBrowserTimestampIfInterProcessTimeTickSkew(&abort_time_); |
| 690 } | 681 } |
| 691 } | 682 } |
| 692 | 683 |
| 693 } // namespace page_load_metrics | 684 } // namespace page_load_metrics |
| OLD | NEW |