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