| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. | 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ | 7 #ifndef NET_DISK_CACHE_BACKEND_IMPL_H_ |
| 8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ | 8 #define NET_DISK_CACHE_BACKEND_IMPL_H_ |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 // Returns the maximum size for a file to reside on the cache. | 113 // Returns the maximum size for a file to reside on the cache. |
| 114 int MaxFileSize() const; | 114 int MaxFileSize() const; |
| 115 | 115 |
| 116 // A user data block is being created, extended or truncated. | 116 // A user data block is being created, extended or truncated. |
| 117 void ModifyStorageSize(int32 old_size, int32 new_size); | 117 void ModifyStorageSize(int32 old_size, int32 new_size); |
| 118 | 118 |
| 119 // Logs requests that are denied due to being too big. | 119 // Logs requests that are denied due to being too big. |
| 120 void TooMuchStorageRequested(int32 size); | 120 void TooMuchStorageRequested(int32 size); |
| 121 | 121 |
| 122 // Returns true if this instance seems to be under heavy load. |
| 123 bool IsLoaded() const; |
| 124 |
| 122 // Returns the full histogram name, for the given base |name| and experiment, | 125 // Returns the full histogram name, for the given base |name| and experiment, |
| 123 // and the current cache type. The name will be "DiskCache.t.name_e" where n | 126 // and the current cache type. The name will be "DiskCache.t.name_e" where n |
| 124 // is the cache type and e the provided |experiment|. | 127 // is the cache type and e the provided |experiment|. |
| 125 std::string HistogramName(const char* name, int experiment); | 128 std::string HistogramName(const char* name, int experiment) const; |
| 126 | 129 |
| 127 net::CacheType cache_type() { | 130 net::CacheType cache_type() const { |
| 128 return cache_type_; | 131 return cache_type_; |
| 129 } | 132 } |
| 130 | 133 |
| 131 // Returns the group for this client, based on the current cache size. | 134 // Returns the group for this client, based on the current cache size. |
| 132 int GetSizeGroup(); | 135 int GetSizeGroup() const; |
| 133 | 136 |
| 134 // Returns true if we should send histograms for this user again. The caller | 137 // Returns true if we should send histograms for this user again. The caller |
| 135 // must call this function only once per run (because it returns always the | 138 // must call this function only once per run (because it returns always the |
| 136 // same thing on a given run). | 139 // same thing on a given run). |
| 137 bool ShouldReportAgain(); | 140 bool ShouldReportAgain(); |
| 138 | 141 |
| 139 // Reports some data when we filled up the cache. | 142 // Reports some data when we filled up the cache. |
| 140 void FirstEviction(); | 143 void FirstEviction(); |
| 141 | 144 |
| 142 // Reports a critical error (and disables the cache). | 145 // Reports a critical error (and disables the cache). |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 273 |
| 271 DISALLOW_EVIL_CONSTRUCTORS(BackendImpl); | 274 DISALLOW_EVIL_CONSTRUCTORS(BackendImpl); |
| 272 }; | 275 }; |
| 273 | 276 |
| 274 // Returns the prefered max cache size given the available disk space. | 277 // Returns the prefered max cache size given the available disk space. |
| 275 int PreferedCacheSize(int64 available); | 278 int PreferedCacheSize(int64 available); |
| 276 | 279 |
| 277 } // namespace disk_cache | 280 } // namespace disk_cache |
| 278 | 281 |
| 279 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 282 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
| OLD | NEW |