| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // entries to enumerate. When the entry pointer is no longer needed, its | 128 // entries to enumerate. When the entry pointer is no longer needed, its |
| 129 // Close method should be called. The return value is a net error code. If | 129 // Close method should be called. The return value is a net error code. If |
| 130 // this method returns ERR_IO_PENDING, the |callback| will be invoked when the | 130 // this method returns ERR_IO_PENDING, the |callback| will be invoked when the |
| 131 // |next_entry| is available. The pointer to receive the |next_entry| must | 131 // |next_entry| is available. The pointer to receive the |next_entry| must |
| 132 // remain valid until the operation completes. | 132 // remain valid until the operation completes. |
| 133 // | 133 // |
| 134 // NOTE: This method does not modify the last_used field of the entry, and | 134 // NOTE: This method does not modify the last_used field of the entry, and |
| 135 // therefore it does not impact the eviction ranking of the entry. | 135 // therefore it does not impact the eviction ranking of the entry. |
| 136 virtual int OpenNextEntry(void** iter, Entry** next_entry, | 136 virtual int OpenNextEntry(void** iter, Entry** next_entry, |
| 137 OldCompletionCallback* callback) = 0; | 137 OldCompletionCallback* callback) = 0; |
| 138 virtual int OpenNextEntry(void** iter, Entry** next_entry, |
| 139 const net::CompletionCallback& callback) = 0; |
| 138 | 140 |
| 139 // Releases iter without returning the next entry. Whenever OpenNextEntry() | 141 // Releases iter without returning the next entry. Whenever OpenNextEntry() |
| 140 // returns true, but the caller is not interested in continuing the | 142 // returns true, but the caller is not interested in continuing the |
| 141 // enumeration by calling OpenNextEntry() again, the enumeration must be | 143 // enumeration by calling OpenNextEntry() again, the enumeration must be |
| 142 // ended by calling this method with iter returned by OpenNextEntry(). | 144 // ended by calling this method with iter returned by OpenNextEntry(). |
| 143 virtual void EndEnumeration(void** iter) = 0; | 145 virtual void EndEnumeration(void** iter) = 0; |
| 144 | 146 |
| 145 // Return a list of cache statistics. | 147 // Return a list of cache statistics. |
| 146 virtual void GetStats( | 148 virtual void GetStats( |
| 147 std::vector<std::pair<std::string, std::string> >* stats) = 0; | 149 std::vector<std::pair<std::string, std::string> >* stats) = 0; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // Note: This method is deprecated. | 310 // Note: This method is deprecated. |
| 309 virtual int ReadyForSparseIO(OldCompletionCallback* completion_callback) = 0; | 311 virtual int ReadyForSparseIO(OldCompletionCallback* completion_callback) = 0; |
| 310 | 312 |
| 311 protected: | 313 protected: |
| 312 virtual ~Entry() {} | 314 virtual ~Entry() {} |
| 313 }; | 315 }; |
| 314 | 316 |
| 315 } // namespace disk_cache | 317 } // namespace disk_cache |
| 316 | 318 |
| 317 #endif // NET_DISK_CACHE_DISK_CACHE_H_ | 319 #endif // NET_DISK_CACHE_DISK_CACHE_H_ |
| OLD | NEW |