| 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/timer.h" | 10 #include "base/timer.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // Returns the full histogram name, for the given base |name| and experiment, | 116 // Returns the full histogram name, for the given base |name| and experiment, |
| 117 // and the current cache type. The name will be "DiskCache.t.name_e" where n | 117 // and the current cache type. The name will be "DiskCache.t.name_e" where n |
| 118 // is the cache type and e the provided |experiment|. | 118 // is the cache type and e the provided |experiment|. |
| 119 std::string HistogramName(const char* name, int experiment); | 119 std::string HistogramName(const char* name, int experiment); |
| 120 | 120 |
| 121 net::CacheType cache_type() { | 121 net::CacheType cache_type() { |
| 122 return cache_type_; | 122 return cache_type_; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Returns the group for this client, based on the current cache size. |
| 126 int GetSizeGroup(); |
| 127 |
| 125 // Returns true if we should send histograms for this user again. The caller | 128 // Returns true if we should send histograms for this user again. The caller |
| 126 // must call this function only once per run (because it returns always the | 129 // must call this function only once per run (because it returns always the |
| 127 // same thing on a given run). | 130 // same thing on a given run). |
| 128 bool ShouldReportAgain(); | 131 bool ShouldReportAgain(); |
| 129 | 132 |
| 130 // Reports some data when we filled up the cache. | 133 // Reports some data when we filled up the cache. |
| 131 void FirstEviction(); | 134 void FirstEviction(); |
| 132 | 135 |
| 133 // Reports a critical error (and disables the cache). | 136 // Reports a critical error (and disables the cache). |
| 134 void CriticalError(int error); | 137 void CriticalError(int error); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 261 |
| 259 DISALLOW_EVIL_CONSTRUCTORS(BackendImpl); | 262 DISALLOW_EVIL_CONSTRUCTORS(BackendImpl); |
| 260 }; | 263 }; |
| 261 | 264 |
| 262 // Returns the prefered max cache size given the available disk space. | 265 // Returns the prefered max cache size given the available disk space. |
| 263 int PreferedCacheSize(int64 available); | 266 int PreferedCacheSize(int64 available); |
| 264 | 267 |
| 265 } // namespace disk_cache | 268 } // namespace disk_cache |
| 266 | 269 |
| 267 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ | 270 #endif // NET_DISK_CACHE_BACKEND_IMPL_H_ |
| OLD | NEW |