Chromium Code Reviews| 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 cfb422ce1fb715c8bb9c42e486e3043914e94d31..3b60b4371614ada5faf2048f6f1777d75bef0cb5 100644 |
| --- a/chrome/browser/predictors/resource_prefetch_common.h |
| +++ b/chrome/browser/predictors/resource_prefetch_common.h |
| @@ -59,30 +59,28 @@ struct NavigationID { |
| base::TimeTicks creation_time; |
| }; |
| -// Represents the config for the resource prefetch prediction algorithm. It is |
| -// useful for running experiments. |
| +// Represents the config for the resource prefetch prediction algorithm. |
| struct ResourcePrefetchPredictorConfig { |
| // Initializes the config with default values. |
| ResourcePrefetchPredictorConfig(); |
| ResourcePrefetchPredictorConfig(const ResourcePrefetchPredictorConfig& other); |
| ~ResourcePrefetchPredictorConfig(); |
| + // Indicates what caused the prefetch request. |
| + enum Origin { ORIGIN_NAVIGATION = 0, ORIGIN_EXTERNAL = 1 }; |
|
pasko
2016/11/29 14:44:44
Please move it out of ResourcePrefetchPredictorCon
Benoit L
2016/11/29 17:02:51
Done.
|
| + |
| // The mode the prefetcher is running in. Forms a bit map. |
| enum Mode { |
| - URL_LEARNING = 1 << 0, |
| - HOST_LEARNING = 1 << 1, |
| - URL_PREFETCHING = 1 << 2, // Should also turn on URL_LEARNING. |
| - HOST_PREFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. |
| + LEARNING = 1 << 0, |
| + PREFETCHING_FOR_NAVIGATION = 1 << 2, // Also enables LEARNING. |
| + PREFETCHING_FOR_EXTERNAL = 1 << 3 // Also enables LEARNING. |
| }; |
| int mode; |
| // Helpers to deal with mode. |
| bool IsLearningEnabled() const; |
| - bool IsPrefetchingEnabled(Profile* profile) const; |
| - bool IsURLLearningEnabled() const; |
| - bool IsHostLearningEnabled() const; |
| - bool IsURLPrefetchingEnabled(Profile* profile) const; |
| - bool IsHostPrefetchingEnabled(Profile* profile) const; |
| + bool IsAnyPrefetchingEnabled(Profile* profile) const; |
| + bool IsPrefetchingEnabled(Profile* profile, Origin origin) const; |
|
pasko
2016/11/29 14:44:44
how about:
IsPrefetchingEnabledForOrigin(profile,
Benoit L
2016/11/29 17:02:51
Done.
|
| bool IsLowConfidenceForTest() const; |
| bool IsHighConfidenceForTest() const; |