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

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

Issue 2397943004: predictors: Use redirect data in prefetch. (Closed)
Patch Set: . 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..5834521c4972b3ec5f0b50ee3afd0fd61b2fef77 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -243,10 +243,28 @@ class ResourcePrefetchPredictor
// |urls| with resources that need to be prefetched.
bool GetPrefetchData(const GURL& main_frame_url, std::vector<GURL>* urls);
+ // Returns true if the URL-based table contains PrefetchData that can be
pasko 2016/10/07 11:42:43 not fully true, since the |urls| could be non-empt
alexilin 2016/10/07 13:09:29 Yeah, excellent observation! Nevertheless, I thin
+ // used for a |main_frame_url| and fills |urls| with resources that need to be
+ // prefetched.
+ bool GetURLPrefetchData(const std::string& main_frame_url,
+ std::vector<GURL>* urls);
+
+ // Returns true if the host-based table contains PrefetchData that can be used
pasko 2016/10/07 11:42:43 It is preferable to write 'iff' in this case (iff
alexilin 2016/10/07 13:09:29 Done.
+ // for a |main_frame_host| and fills |urls| with resources that need to be
+ // prefetched.
+ bool GetHostPrefetchData(const std::string& main_frame_host,
+ std::vector<GURL>* urls);
+
// Converts a PrefetchData into a list of URLs.
void PopulatePrefetcherRequest(const PrefetchData& data,
std::vector<GURL>* urls);
+ // Returns true if |redirect_data_map| contains confident redirect endpoint
+ // for |first_redirect| and assign it to the |final_redirect|.
+ bool GetFinalRedirect(const std::string& first_redirect,
pasko 2016/10/07 11:42:43 this seems not to require any state of the object.
alexilin 2016/10/07 13:09:29 Implemented the second one because "we have many".
+ RedirectDataMap* redirect_data_map,
+ std::string* final_redirect);
+
public:
// Starts prefetching if it is enabled and prefetching data exists for the
// NavigationID either at the URL or at the host level.

Powered by Google App Engine
This is Rietveld 408576698