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

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

Issue 2804963002: predictors: Put manifests for ResourcePrefetchPredictor behind a flag. (Closed)
Patch Set: Created 3 years, 8 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.cc
diff --git a/chrome/browser/predictors/resource_prefetch_common.cc b/chrome/browser/predictors/resource_prefetch_common.cc
index b48bf805120a905a1cc2631773db810fb8f9351f..ab9ec5da9d49cb0cf3ba0f0c19978d85c9e6fc4f 100644
--- a/chrome/browser/predictors/resource_prefetch_common.cc
+++ b/chrome/browser/predictors/resource_prefetch_common.cc
@@ -24,6 +24,7 @@ const char kLearningMode[] = "learning";
const char kExternalPrefetchingMode[] = "external-prefetching";
const char kPrefetchingMode[] = "prefetching";
const char kEnableUrlLearningParamName[] = "enable-url-learning";
+const char kEnableManifestsParamName[] = "enable-manifests";
const base::Feature kSpeculativeResourcePrefetchingFeature =
base::Feature(kSpeculativeResourcePrefetchingFeatureName,
@@ -62,9 +63,13 @@ bool IsSpeculativeResourcePrefetchingEnabled(
std::string enable_url_learning_value =
base::GetFieldTrialParamValueByFeature(
kSpeculativeResourcePrefetchingFeature, kEnableUrlLearningParamName);
- if (enable_url_learning_value == "true") {
+ if (enable_url_learning_value == "true")
config->is_url_learning_enabled = true;
- }
+
+ std::string enable_manifests_value = base::GetFieldTrialParamValueByFeature(
+ kSpeculativeResourcePrefetchingFeature, kEnableManifestsParamName);
+ if (enable_manifests_value == "true")
+ config->is_manifests_enabled = true;
// Ensure that a resource that was only seen once is never prefetched. This
// prevents the easy mistake of trying to prefetch an ephemeral url.
@@ -137,8 +142,8 @@ ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig()
min_resource_hits_to_trigger_prefetch(2),
max_prefetches_inflight_per_navigation(5),
max_prefetches_inflight_per_host_per_navigation(3),
- is_url_learning_enabled(false) {
-}
+ is_url_learning_enabled(false),
+ is_manifests_enabled(false) {}
ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig(
const ResourcePrefetchPredictorConfig& other) = default;
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.h ('k') | chrome/browser/predictors/resource_prefetch_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698