| 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 "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 enum Mode { | 67 enum Mode { |
| 68 URL_LEARNING = 1 << 0, | 68 URL_LEARNING = 1 << 0, |
| 69 HOST_LEARNING = 1 << 1, | 69 HOST_LEARNING = 1 << 1, |
| 70 URL_PREFETCHING = 1 << 2, // Should also turn on URL_LEARNING. | 70 URL_PREFETCHING = 1 << 2, // Should also turn on URL_LEARNING. |
| 71 HOST_PRFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. | 71 HOST_PRFETCHING = 1 << 3 // Should also turn on HOST_LEARNING. |
| 72 }; | 72 }; |
| 73 int mode; | 73 int mode; |
| 74 | 74 |
| 75 // Helpers to deal with mode. | 75 // Helpers to deal with mode. |
| 76 bool IsLearningEnabled() const; | 76 bool IsLearningEnabled() const; |
| 77 bool IsPrefetchingEnabled() const; | 77 bool IsPrefetchingEnabled(Profile* profile) const; |
| 78 bool IsURLLearningEnabled() const; | 78 bool IsURLLearningEnabled() const; |
| 79 bool IsHostLearningEnabled() const; | 79 bool IsHostLearningEnabled() const; |
| 80 bool IsURLPrefetchingEnabled() const; | 80 bool IsURLPrefetchingEnabled(Profile* profile) const; |
| 81 bool IsHostPrefetchingEnabled() const; | 81 bool IsHostPrefetchingEnabled(Profile* profile) const; |
| 82 |
| 83 bool IsLowConfidenceForTest() const; |
| 84 bool IsHighConfidenceForTest() const; |
| 85 bool IsMoreResourcesEnabledForTest() const; |
| 86 bool IsSmallDBEnabledForTest() const; |
| 82 | 87 |
| 83 // If a navigation hasn't seen a load complete event in this much time, it | 88 // If a navigation hasn't seen a load complete event in this much time, it |
| 84 // is considered abandoned. | 89 // is considered abandoned. |
| 85 size_t max_navigation_lifetime_seconds; | 90 size_t max_navigation_lifetime_seconds; |
| 86 | 91 |
| 87 // Size of LRU caches for the URL and host data. | 92 // Size of LRU caches for the URL and host data. |
| 88 size_t max_urls_to_track; | 93 size_t max_urls_to_track; |
| 89 size_t max_hosts_to_track; | 94 size_t max_hosts_to_track; |
| 90 | 95 |
| 91 // The number of times we should have seen a visit to this URL in history | 96 // The number of times we should have seen a visit to this URL in history |
| (...skipping 15 matching lines...) Expand all Loading... |
| 107 // Maximum number of prefetches that can be inflight for a single navigation. | 112 // Maximum number of prefetches that can be inflight for a single navigation. |
| 108 size_t max_prefetches_inflight_per_navigation; | 113 size_t max_prefetches_inflight_per_navigation; |
| 109 // Maximum number of prefetches that can be inflight for a host for a single | 114 // Maximum number of prefetches that can be inflight for a host for a single |
| 110 // navigation. | 115 // navigation. |
| 111 size_t max_prefetches_inflight_per_host_per_navigation; | 116 size_t max_prefetches_inflight_per_host_per_navigation; |
| 112 }; | 117 }; |
| 113 | 118 |
| 114 } // namespace predictors | 119 } // namespace predictors |
| 115 | 120 |
| 116 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 121 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| OLD | NEW |