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

Unified Diff: chrome/browser/net/resource_prefetch_predictor_observer.cc

Issue 2587443002: predictors: Make speculative_prefetch_predictor work with PlzNavigate (Closed)
Patch Set: Modified after clamy@ review Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/resource_prefetch_predictor_observer.cc
diff --git a/chrome/browser/net/resource_prefetch_predictor_observer.cc b/chrome/browser/net/resource_prefetch_predictor_observer.cc
index d1517f14920d6c532bcba1dbd7e9263fd1854ec2..b8925160a17880cf10a21527255102385a2c40fb 100644
--- a/chrome/browser/net/resource_prefetch_predictor_observer.cc
+++ b/chrome/browser/net/resource_prefetch_predictor_observer.cc
@@ -70,7 +70,9 @@ bool TryToFillNavigationID(
return false;
*navigation_id =
predictors::NavigationID(web_contents, main_frame_url, creation_time);
- return true;
+ // A WebContents might be associated with something that is not a tab.
+ // In this case tab_id will be -1 and is_valid() will return false.
+ return navigation_id->is_valid();
}
} // namespace
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698