| 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/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // comparison of two NavigationIDs because it cannot always be determined | 56 // comparison of two NavigationIDs because it cannot always be determined |
| 57 // correctly. | 57 // correctly. |
| 58 base::TimeTicks creation_time; | 58 base::TimeTicks creation_time; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 // Represents the config for the resource prefetch prediction algorithm. It is | 61 // Represents the config for the resource prefetch prediction algorithm. It is |
| 62 // useful for running experiments. | 62 // useful for running experiments. |
| 63 struct ResourcePrefetchPredictorConfig { | 63 struct ResourcePrefetchPredictorConfig { |
| 64 // Initializes the config with default values. | 64 // Initializes the config with default values. |
| 65 ResourcePrefetchPredictorConfig(); | 65 ResourcePrefetchPredictorConfig(); |
| 66 ResourcePrefetchPredictorConfig(const ResourcePrefetchPredictorConfig& other); |
| 66 ~ResourcePrefetchPredictorConfig(); | 67 ~ResourcePrefetchPredictorConfig(); |
| 67 | 68 |
| 68 // The mode the prefetcher is running in. Forms a bit map. | 69 // The mode the prefetcher is running in. Forms a bit map. |
| 69 enum Mode { | 70 enum Mode { |
| 70 URL_LEARNING = 1 << 0, | 71 URL_LEARNING = 1 << 0, |
| 71 HOST_LEARNING = 1 << 1, | 72 HOST_LEARNING = 1 << 1, |
| 72 URL_PREFETCHING = 1 << 2, // Should also turn on URL_LEARNING. | 73 URL_PREFETCHING = 1 << 2, // Should also turn on URL_LEARNING. |
| 73 HOST_PRFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. | 74 HOST_PRFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. |
| 74 }; | 75 }; |
| 75 int mode; | 76 int mode; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Maximum number of prefetches that can be inflight for a single navigation. | 115 // Maximum number of prefetches that can be inflight for a single navigation. |
| 115 size_t max_prefetches_inflight_per_navigation; | 116 size_t max_prefetches_inflight_per_navigation; |
| 116 // Maximum number of prefetches that can be inflight for a host for a single | 117 // Maximum number of prefetches that can be inflight for a host for a single |
| 117 // navigation. | 118 // navigation. |
| 118 size_t max_prefetches_inflight_per_host_per_navigation; | 119 size_t max_prefetches_inflight_per_host_per_navigation; |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 } // namespace predictors | 122 } // namespace predictors |
| 122 | 123 |
| 123 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 124 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| OLD | NEW |