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

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

Issue 10817004: Adds speculative prefetching of resources. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing Dominich's comment. Created 8 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_prefetch_common.h
diff --git a/chrome/browser/predictors/resource_prefetch_common.h b/chrome/browser/predictors/resource_prefetch_common.h
index 9f63d18fa978017f921ee9b353bcef9db8ff1173..5680cec097520f7f172684fa85bfd6747adbe413 100644
--- a/chrome/browser/predictors/resource_prefetch_common.h
+++ b/chrome/browser/predictors/resource_prefetch_common.h
@@ -40,6 +40,39 @@ struct NavigationID {
base::TimeTicks creation_time;
};
+// Represents the config for the resource prefetch prediction algorithm. It is
+// useful for running experiments.
+struct ResourcePrefetchPredictorConfig {
+ // Initializes the config with default values.
+ ResourcePrefetchPredictorConfig();
+
+ // If a navigation hasn't seen a load complete event in this much time, it
+ // is considered abandoned.
+ int max_navigation_lifetime_seconds;
+ // Size of LRU caches for the URL data.
+ int max_urls_to_track;
+ // The number of times, we should have seen a visit to this URL in history
+ // to start tracking it. This is to ensure we dont bother with oneoff
+ // entries.
+ int min_url_visit_count;
+ // The maximum number of resources to store per entry.
+ int max_resources_per_entry;
+ // The number of consecutive misses after we stop tracking a resource URL.
+ int max_consecutive_misses;
+
+ // The minimum confidence (accuracy of hits) required for a resource to be
+ // prefetched.
+ float min_resource_confidence_to_trigger_prefetch;
+ // The minimum number of times we must have a URL on record to prefetch it.
+ int min_resource_hits_to_trigger_prefetch;
+
+ // Maximum number of prefetches that can be inflight for a single navigation.
+ int max_prefetches_inflight_per_navigation;
+ // Maximum number of prefetches that can be inflight for a host for a single
+ // navigation.
+ int max_prefetches_inflight_per_host_per_navigation;
+};
+
} // namespace predictors
#endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_

Powered by Google App Engine
This is Rietveld 408576698