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

Unified Diff: chrome/browser/predictors/resource_prefetcher.cc

Issue 2373443002: predictors: Key the resource prefetcher by URL, not navigation. (Closed)
Patch Set: Created 4 years, 3 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/predictors/resource_prefetcher.cc
diff --git a/chrome/browser/predictors/resource_prefetcher.cc b/chrome/browser/predictors/resource_prefetcher.cc
index 56ea3e8431360f7ec61710a45d390d91bfa1055b..422e67183b7ace968d1485b308a170f613d71b39 100644
--- a/chrome/browser/predictors/resource_prefetcher.cc
+++ b/chrome/browser/predictors/resource_prefetcher.cc
@@ -25,14 +25,12 @@ namespace predictors {
ResourcePrefetcher::ResourcePrefetcher(
Delegate* delegate,
const ResourcePrefetchPredictorConfig& config,
- const NavigationID& navigation_id,
- PrefetchKeyType key_type,
+ const GURL& main_frame_url,
const std::vector<GURL>& urls)
: state_(INITIALIZED),
delegate_(delegate),
config_(config),
- navigation_id_(navigation_id),
- key_type_(key_type) {
+ main_frame_url_(main_frame_url) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
std::copy(urls.begin(), urls.end(), std::back_inserter(request_queue_));
@@ -108,9 +106,9 @@ void ResourcePrefetcher::SendRequest(const GURL& url) {
host_inflight_counts_[url.host()] += 1;
url_request->set_method("GET");
- url_request->set_first_party_for_cookies(navigation_id_.main_frame_url);
- url_request->set_initiator(url::Origin(navigation_id_.main_frame_url));
- url_request->SetReferrer(navigation_id_.main_frame_url.spec());
+ url_request->set_first_party_for_cookies(main_frame_url_);
+ url_request->set_initiator(url::Origin(main_frame_url_));
+ url_request->SetReferrer(main_frame_url_.spec());
url_request->SetLoadFlags(url_request->load_flags() | net::LOAD_PREFETCH);
StartURLRequest(url_request.get());
inflight_requests_.insert(
« no previous file with comments | « chrome/browser/predictors/resource_prefetcher.h ('k') | chrome/browser/predictors/resource_prefetcher_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698