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

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

Issue 2729563002: predictors: Disable URL-based learning by default. (Closed)
Patch Set: Created 3 years, 10 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 3ec303d25d186fc7eced89b76116017943ed572b..6303eba4ac4849823f1040974cc690ee7f1eb569 100644
--- a/chrome/browser/predictors/resource_prefetch_common.h
+++ b/chrome/browser/predictors/resource_prefetch_common.h
@@ -7,7 +7,6 @@
#include <stddef.h>
-#include "base/feature_list.h"
#include "base/time/time.h"
#include "components/sessions/core/session_id.h"
#include "url/gurl.h"
@@ -25,6 +24,10 @@ extern const char kModeParamName[];
extern const char kLearningMode[];
extern const char kExternalPrefetchingMode[];
extern const char kPrefetchingMode[];
+extern const char kKeyTypeParamName[];
+extern const char kUrlKeyType[];
+extern const char kHostKeyType[];
+extern const char kBothKeyType[];
struct ResourcePrefetchPredictorConfig;
@@ -76,14 +79,17 @@ struct ResourcePrefetchPredictorConfig {
// The mode the prefetcher is running in. Forms a bit map.
enum Mode {
- LEARNING = 1 << 0,
- PREFETCHING_FOR_NAVIGATION = 1 << 2, // Also enables LEARNING.
- PREFETCHING_FOR_EXTERNAL = 1 << 3 // Also enables LEARNING.
+ URL_LEARNING = 1 << 0,
+ HOST_LEARNING = 1 << 1,
+ PREFETCHING_FOR_NAVIGATION = 1 << 2,
+ PREFETCHING_FOR_EXTERNAL = 1 << 3
};
int mode;
// Helpers to deal with mode.
bool IsLearningEnabled() const;
+ bool IsURLLearningEnabled() const;
+ bool IsHostLearningEnabled() const;
bool IsPrefetchingEnabledForSomeOrigin(Profile* profile) const;
bool IsPrefetchingEnabledForOrigin(Profile* profile,
PrefetchOrigin origin) const;

Powered by Google App Engine
This is Rietveld 408576698