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

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

Issue 2397943004: predictors: Use redirect data in prefetch. (Closed)
Patch Set: Non-empty check. 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
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6c238fb336f3e9049c5d7766aa603c4d1898384c 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -155,6 +155,10 @@ class ResourcePrefetchPredictor
OnSubresourceResponse);
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, GetCorrectPLT);
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, HandledResourceTypes);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest,
+ PopulatePrefetcherRequest);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, GetRedirectEndpoint);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, GetPrefetchData);
enum InitializationState {
NOT_INITIALIZED = 0,
@@ -224,6 +228,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 iff |redirect_data_map| contains confident redirect endpoint
+ // for |entry_point| and assigns it to the |redirect_endpoint|.
+ static bool GetRedirectEndpoint(const std::string& entry_point,
+ const RedirectDataMap& redirect_data_map,
+ std::string* redirect_endpoint);
+
// KeyedService methods override.
void Shutdown() override;
@@ -239,12 +249,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,
+ const PrefetchDataMap& data_map,
std::vector<GURL>* urls);
public:
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698