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/feature_list.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "components/sessions/core/session_id.h" | 12 #include "components/sessions/core/session_id.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 } | 19 } |
20 | 20 |
21 namespace predictors { | 21 namespace predictors { |
22 | 22 |
23 extern const char kSpeculativeResourcePrefetchingFeatureName[]; | 23 extern const char kSpeculativeResourcePrefetchingFeatureName[]; |
24 extern const char kModeParamName[]; | 24 extern const char kModeParamName[]; |
25 extern const char kLearningMode[]; | 25 extern const char kLearningMode[]; |
26 extern const char kExternalPrefetchingMode[]; | 26 extern const char kExternalPrefetchingMode[]; |
27 extern const char kPrefetchingMode[]; | 27 extern const char kPrefetchingMode[]; |
28 extern const char kEnableUrlLearningParamName[]; | 28 extern const char kEnableUrlLearningParamName[]; |
29 extern const char kEnableManifestsParamName[]; | 29 extern const char kEnableManifestsParamName[]; |
| 30 extern const char kEnableOriginLearningParamName[]; |
30 extern const base::Feature kSpeculativeResourcePrefetchingFeature; | 31 extern const base::Feature kSpeculativeResourcePrefetchingFeature; |
31 | 32 |
32 struct ResourcePrefetchPredictorConfig; | 33 struct ResourcePrefetchPredictorConfig; |
33 | 34 |
34 // Returns true if prefetching is enabled. And will initilize the |config| | 35 // Returns true if prefetching is enabled. And will initilize the |config| |
35 // fields to the appropritate values. | 36 // fields to the appropritate values. |
36 bool IsSpeculativeResourcePrefetchingEnabled( | 37 bool IsSpeculativeResourcePrefetchingEnabled( |
37 Profile* profile, | 38 Profile* profile, |
38 ResourcePrefetchPredictorConfig* config); | 39 ResourcePrefetchPredictorConfig* config); |
39 | 40 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 125 |
125 // Maximum number of prefetches that can be inflight for a single navigation. | 126 // Maximum number of prefetches that can be inflight for a single navigation. |
126 size_t max_prefetches_inflight_per_navigation; | 127 size_t max_prefetches_inflight_per_navigation; |
127 // Maximum number of prefetches that can be inflight for a host for a single | 128 // Maximum number of prefetches that can be inflight for a host for a single |
128 // navigation. | 129 // navigation. |
129 size_t max_prefetches_inflight_per_host_per_navigation; | 130 size_t max_prefetches_inflight_per_host_per_navigation; |
130 // True iff the predictor could use a url-based database. | 131 // True iff the predictor could use a url-based database. |
131 bool is_url_learning_enabled; | 132 bool is_url_learning_enabled; |
132 // True iff the predictor could use manifests. | 133 // True iff the predictor could use manifests. |
133 bool is_manifests_enabled; | 134 bool is_manifests_enabled; |
134 // True iff the origin-based prediction is enabled. | 135 // True iff origin-based learning is enabled. |
135 bool is_origin_prediction_enabled; | 136 bool is_origin_learning_enabled; |
136 }; | 137 }; |
137 | 138 |
138 } // namespace predictors | 139 } // namespace predictors |
139 | 140 |
140 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 141 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
OLD | NEW |