| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 } | 424 } |
| 425 | 425 |
| 426 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnShown); | 426 INVOKE_AND_PRUNE_OBSERVERS(observers_, OnShown); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void PageLoadTracker::WillProcessNavigationResponse( | 429 void PageLoadTracker::WillProcessNavigationResponse( |
| 430 content::NavigationHandle* navigation_handle) { | 430 content::NavigationHandle* navigation_handle) { |
| 431 // PlzNavigate: NavigationHandle::GetGlobalRequestID() sometimes returns an | 431 // PlzNavigate: NavigationHandle::GetGlobalRequestID() sometimes returns an |
| 432 // uninitialized GlobalRequestID. Bail early in this case. See | 432 // uninitialized GlobalRequestID. Bail early in this case. See |
| 433 // crbug.com/680841 for details. | 433 // crbug.com/680841 for details. |
| 434 DCHECK(navigation_handle->GetGlobalRequestID() != content::GlobalRequestID()); |
| 434 if (content::IsBrowserSideNavigationEnabled() && | 435 if (content::IsBrowserSideNavigationEnabled() && |
| 435 navigation_handle->GetGlobalRequestID() == content::GlobalRequestID()) | 436 navigation_handle->GetGlobalRequestID() == content::GlobalRequestID()) |
| 436 return; | 437 return; |
| 437 | 438 |
| 438 DCHECK(!navigation_request_id_.has_value()); | 439 DCHECK(!navigation_request_id_.has_value()); |
| 439 navigation_request_id_ = navigation_handle->GetGlobalRequestID(); | 440 navigation_request_id_ = navigation_handle->GetGlobalRequestID(); |
| 440 DCHECK(navigation_request_id_.value() != content::GlobalRequestID()); | 441 DCHECK(navigation_request_id_.value() != content::GlobalRequestID()); |
| 441 } | 442 } |
| 442 | 443 |
| 443 void PageLoadTracker::Commit(content::NavigationHandle* navigation_handle) { | 444 void PageLoadTracker::Commit(content::NavigationHandle* navigation_handle) { |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 // user initiated. | 694 // user initiated. |
| 694 if (abort_type != ABORT_CLIENT_REDIRECT) | 695 if (abort_type != ABORT_CLIENT_REDIRECT) |
| 695 abort_user_initiated_info_ = user_initiated_info; | 696 abort_user_initiated_info_ = user_initiated_info; |
| 696 | 697 |
| 697 if (is_certainly_browser_timestamp) { | 698 if (is_certainly_browser_timestamp) { |
| 698 ClampBrowserTimestampIfInterProcessTimeTickSkew(&abort_time_); | 699 ClampBrowserTimestampIfInterProcessTimeTickSkew(&abort_time_); |
| 699 } | 700 } |
| 700 } | 701 } |
| 701 | 702 |
| 702 } // namespace page_load_metrics | 703 } // namespace page_load_metrics |
| OLD | NEW |