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

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

Issue 2397943004: predictors: Use redirect data in prefetch. (Closed)
Patch Set: Refactor GetPrefetchData, get rid of redirects sort. Created 4 years, 2 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_prefetch_predictor.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index 079f8b0bca4188f36610ab2da850db0bd8fa7f8f..be57fcc95ec60c33d65241b22912d2c980087677 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -224,6 +224,12 @@ class ResourcePrefetchPredictor
// Returns true if the request (should have a response in it) is "no-store".
static bool IsNoStore(const net::URLRequest* request);
+ // Returns true if |redirect_data_map| contains confident redirect endpoint
pasko 2016/10/07 13:44:27 nit: iff
alexilin 2016/10/07 14:29:05 Done.
+ // for |first_redirect| and assign it to the |final_redirect|.
pasko 2016/10/07 13:44:27 nit: s/assign/assigns/
pasko 2016/10/07 13:44:27 nit: first_redirect is not a good name, because a
alexilin 2016/10/07 14:29:05 Done.
+ static bool GetFinalRedirect(const std::string& first_redirect,
+ RedirectDataMap* redirect_data_map,
pasko 2016/10/07 13:44:27 if the object (RedirectDataMap) is not modified by
alexilin 2016/10/07 14:29:06 Ok, thanks! I know this rule but I was confused by
+ std::string* final_redirect);
pasko 2016/10/07 13:44:27 nit: |redirect_endpoint| sounds more intuitive (f
alexilin 2016/10/07 14:29:05 Done.
+
// KeyedService methods override.
void Shutdown() override;
@@ -239,12 +245,16 @@ class ResourcePrefetchPredictor
// this point are the only ones considered for prefetching.
void OnNavigationComplete(const NavigationID& nav_id_without_timing_info);
- // Returns true if there is PrefetchData that can be used for a URL and fills
- // |urls| with resources that need to be prefetched.
+ // Returns true iff there is PrefetchData that can be used for a
+ // |main_frame_url| and fills |urls| with resources that need to be
+ // prefetched.
bool GetPrefetchData(const GURL& main_frame_url, std::vector<GURL>* urls);
- // Converts a PrefetchData into a list of URLs.
- void PopulatePrefetcherRequest(const PrefetchData& data,
+ // Returns true iff the |data_map| contains PrefetchData that can be used
+ // for a |main_frame_key| and fills |urls| with resources that need to be
+ // prefetched.
+ bool PopulatePrefetcherRequest(const std::string& main_frame_key,
+ PrefetchDataMap* data_map,
pasko 2016/10/07 13:44:27 const reference here too
alexilin 2016/10/07 14:29:05 Done.
std::vector<GURL>* urls);
public:

Powered by Google App Engine
This is Rietveld 408576698