Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Defines the public interface of the disk cache. For more details see | 5 // Defines the public interface of the disk cache. For more details see |
| 6 // http://dev.chromium.org/developers/design-documents/network-stack/disk-cache | 6 // http://dev.chromium.org/developers/design-documents/network-stack/disk-cache |
| 7 | 7 |
| 8 #ifndef NET_DISK_CACHE_DISK_CACHE_H_ | 8 #ifndef NET_DISK_CACHE_DISK_CACHE_H_ |
| 9 #define NET_DISK_CACHE_DISK_CACHE_H_ | 9 #define NET_DISK_CACHE_DISK_CACHE_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 | 130 |
| 131 // Releases iter without returning the next entry. Whenever OpenNextEntry() | 131 // Releases iter without returning the next entry. Whenever OpenNextEntry() |
| 132 // returns true, but the caller is not interested in continuing the | 132 // returns true, but the caller is not interested in continuing the |
| 133 // enumeration by calling OpenNextEntry() again, the enumeration must be | 133 // enumeration by calling OpenNextEntry() again, the enumeration must be |
| 134 // ended by calling this method with iter returned by OpenNextEntry(). | 134 // ended by calling this method with iter returned by OpenNextEntry(). |
| 135 virtual void EndEnumeration(void** iter) = 0; | 135 virtual void EndEnumeration(void** iter) = 0; |
| 136 | 136 |
| 137 // Return a list of cache statistics. | 137 // Return a list of cache statistics. |
| 138 virtual void GetStats( | 138 virtual void GetStats( |
| 139 std::vector<std::pair<std::string, std::string> >* stats) = 0; | 139 std::vector<std::pair<std::string, std::string> >* stats) = 0; |
| 140 | |
| 141 // Improves the rank of the specified resource in the LRU cache as if it had | |
| 142 // been used directly. This allows feedback from the renderer's memory cache | |
|
rvargas (doing something else)
2011/07/28 22:27:01
There should not be a reference to the renderer's
| |
| 143 // to improve the selection of resources in the disk cache. | |
| 144 virtual void OnExternalCacheHit(const std::string& key) = 0; | |
| 140 }; | 145 }; |
| 141 | 146 |
| 142 // This interface represents an entry in the disk cache. | 147 // This interface represents an entry in the disk cache. |
| 143 class NET_TEST Entry { | 148 class NET_TEST Entry { |
| 144 public: | 149 public: |
| 145 // Marks this cache entry for deletion. | 150 // Marks this cache entry for deletion. |
| 146 virtual void Doom() = 0; | 151 virtual void Doom() = 0; |
| 147 | 152 |
| 148 // Releases this entry. Calling this method does not cancel pending IO | 153 // Releases this entry. Calling this method does not cancel pending IO |
| 149 // operations on this entry. Even after the last reference to this object has | 154 // operations on this entry. Even after the last reference to this object has |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 // Note: This method is deprecated. | 296 // Note: This method is deprecated. |
| 292 virtual int ReadyForSparseIO(CompletionCallback* completion_callback) = 0; | 297 virtual int ReadyForSparseIO(CompletionCallback* completion_callback) = 0; |
| 293 | 298 |
| 294 protected: | 299 protected: |
| 295 virtual ~Entry() {} | 300 virtual ~Entry() {} |
| 296 }; | 301 }; |
| 297 | 302 |
| 298 } // namespace disk_cache | 303 } // namespace disk_cache |
| 299 | 304 |
| 300 #endif // NET_DISK_CACHE_DISK_CACHE_H_ | 305 #endif // NET_DISK_CACHE_DISK_CACHE_H_ |
| OLD | NEW |