| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/feature_list.h" |
| 10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 11 #include "components/sessions/core/session_id.h" | 12 #include "components/sessions/core/session_id.h" |
| 12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 13 | 14 |
| 14 class Profile; | 15 class Profile; |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class WebContents; | 18 class WebContents; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace predictors { | 21 namespace predictors { |
| 21 | 22 |
| 22 extern const char kSpeculativeResourcePrefetchingFeatureName[]; | 23 extern const char kSpeculativeResourcePrefetchingFeatureName[]; |
| 23 extern const char kModeParamName[]; | 24 extern const char kModeParamName[]; |
| 24 extern const char kLearningMode[]; | 25 extern const char kLearningMode[]; |
| 25 extern const char kExternalPrefetchingMode[]; | 26 extern const char kExternalPrefetchingMode[]; |
| 26 extern const char kPrefetchingMode[]; | 27 extern const char kPrefetchingMode[]; |
| 27 extern const char kEnableUrlLearningParamName[]; | 28 extern const char kEnableUrlLearningParamName[]; |
| 29 extern const base::Feature kSpeculativeResourcePrefetchingFeature; |
| 28 | 30 |
| 29 struct ResourcePrefetchPredictorConfig; | 31 struct ResourcePrefetchPredictorConfig; |
| 30 | 32 |
| 31 // Returns true if prefetching is enabled. And will initilize the |config| | 33 // Returns true if prefetching is enabled. And will initilize the |config| |
| 32 // fields to the appropritate values. | 34 // fields to the appropritate values. |
| 33 bool IsSpeculativeResourcePrefetchingEnabled( | 35 bool IsSpeculativeResourcePrefetchingEnabled( |
| 34 Profile* profile, | 36 Profile* profile, |
| 35 ResourcePrefetchPredictorConfig* config); | 37 ResourcePrefetchPredictorConfig* config); |
| 36 | 38 |
| 37 // Represents the type of key based on which prefetch data is stored. | 39 // Represents the type of key based on which prefetch data is stored. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Maximum number of prefetches that can be inflight for a host for a single | 124 // Maximum number of prefetches that can be inflight for a host for a single |
| 123 // navigation. | 125 // navigation. |
| 124 size_t max_prefetches_inflight_per_host_per_navigation; | 126 size_t max_prefetches_inflight_per_host_per_navigation; |
| 125 // True iff the predictor could use a url-based database. | 127 // True iff the predictor could use a url-based database. |
| 126 bool is_url_learning_enabled; | 128 bool is_url_learning_enabled; |
| 127 }; | 129 }; |
| 128 | 130 |
| 129 } // namespace predictors | 131 } // namespace predictors |
| 130 | 132 |
| 131 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 133 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| OLD | NEW |