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

Unified Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc

Issue 2884753002: [PageLoadMetrics] Relax invariants and log the exceptions (Closed)
Patch Set: Address comments from PS2 Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
index 711eed8760f7c30adc9699d412f778bc571a9d3c..9b37f75a0629d1416d43c1b706e4e3141e04dbc1 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
@@ -215,7 +215,12 @@ PageLoadTracker* MetricsWebContentsObserver::GetTrackerOrNullForRequest(
const content::GlobalRequestID& request_id,
content::ResourceType resource_type,
base::TimeTicks creation_time) {
- if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
+ // TODO(jkarlin): The WebContentsTester framework doesn't provide a default
+ // GlobalRequestID to its NavigationHandles. Once the test framework
+ // supports real ids, remove the request_id != content::GlobalRequestID()
+ // condition. See https://crbug.com/711352.
+ if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME &&
+ request_id != content::GlobalRequestID()) {
// The main frame request can complete either before or after commit, so we
// look at both provisional loads and the committed load to find a
// PageLoadTracker with a matching request id. See https://goo.gl/6TzCYN for

Powered by Google App Engine
This is Rietveld 408576698