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

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

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.h
diff --git a/chrome/browser/predictors/resource_prefetcher.h b/chrome/browser/predictors/resource_prefetcher.h
index 9a960b32eca7acf7d36f92752b799cbfe9a92189..ea548440a79dfa5b8f2b48ec50dcfd0f09eebc53 100644
--- a/chrome/browser/predictors/resource_prefetcher.h
+++ b/chrome/browser/predictors/resource_prefetcher.h
@@ -27,8 +27,8 @@ class URLRequestContext;
namespace predictors {
-// Responsible for prefetching resources for a single navigation based on the
-// input list of resources.
+// Responsible for prefetching resources for a single main frame URL based on
+// the input list of resources.
// - Limits the max number of resources in flight for any host and also across
// hosts.
// - When stopped, will wait for the pending requests to finish.
@@ -51,16 +51,14 @@ class ResourcePrefetcher : public net::URLRequest::Delegate {
// |delegate| has to outlive the ResourcePrefetcher.
ResourcePrefetcher(Delegate* delegate,
const ResourcePrefetchPredictorConfig& config,
- const NavigationID& navigation_id,
- PrefetchKeyType key_type,
+ const GURL& main_frame_url,
const std::vector<GURL>& urls);
~ResourcePrefetcher() override;
void Start(); // Kicks off the prefetching. Can only be called once.
void Stop(); // No additional prefetches will be queued after this.
- const NavigationID& navigation_id() const { return navigation_id_; }
- PrefetchKeyType key_type() const { return key_type_; }
+ const GURL& main_frame_url() const { return main_frame_url_; }
private:
friend class ResourcePrefetcherTest;
@@ -113,8 +111,7 @@ class ResourcePrefetcher : public net::URLRequest::Delegate {
PrefetcherState state_;
Delegate* const delegate_;
ResourcePrefetchPredictorConfig const config_;
- NavigationID navigation_id_;
- PrefetchKeyType key_type_;
+ GURL main_frame_url_;
std::unique_ptr<GURL> urls_;
std::map<net::URLRequest*, std::unique_ptr<net::URLRequest>>
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_predictor.cc ('k') | chrome/browser/predictors/resource_prefetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698