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

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

Issue 2632503005: predictors: Collect page load metrics for ResourcePrefetchPredictor. (Closed)
Patch Set: Mark suffix as base. Created 3 years, 11 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 ab2e70b3b1a833ff3fe4fbe4b9b29e94c95e112e..5bfc2bc4d502b698076f17c5160745a061895500 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -172,6 +172,9 @@ class ResourcePrefetchPredictor
// in flight.
void OnPrefetchingFinished(const GURL& main_frame_url);
+ // Returns true if prefetching data exists for the |main_frame_url|.
+ virtual bool IsUrlPrefetchable(const GURL& main_frame_url);
+
// Sets the |observer| to be notified when the resource prefetch predictor
// data changes. Previously registered observer will be discarded. Call
// this with nullptr parameter to de-register observer.
@@ -257,15 +260,16 @@ class ResourcePrefetchPredictor
// 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);
+ // prefetched. |urls| pointer may be equal nullptr to get return value only.
+ bool GetPrefetchData(const GURL& main_frame_url,
+ std::vector<GURL>* urls) const;
// 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.
+ // prefetched. |urls| pointer may be equal nullptr to get return value only.
bool PopulatePrefetcherRequest(const std::string& main_frame_key,
const PrefetchDataMap& data_map,
- std::vector<GURL>* urls);
+ std::vector<GURL>* urls) const;
// Callback for task to read predictor database. Takes ownership of
// all arguments.
@@ -320,11 +324,6 @@ class ResourcePrefetchPredictor
size_t max_redirect_map_size,
RedirectDataMap* redirect_map);
- // Returns true iff the |data_map| contains PrefetchData that can be used
- // for |main_frame_key| prefetching.
- bool IsDataPrefetchable(const std::string& main_frame_key,
- const PrefetchDataMap& data_map) const;
-
// Returns true iff |resource| has sufficient confidence level and required
// number of hits.
bool IsResourcePrefetchable(const ResourceData& resource) const;

Powered by Google App Engine
This is Rietveld 408576698