Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Side by Side Diff: chrome/browser/page_load_metrics/page_load_tracker.cc

Issue 2635193004: Add DCHECK to show that plznav sometimes provides empty global request ids. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698