Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 base::Time end_time, | 138 base::Time end_time, |
| 139 const CompletionCallback& callback) = 0; | 139 const CompletionCallback& callback) = 0; |
| 140 | 140 |
| 141 // Marks all entries accessed since |initial_time| for deletion. The return | 141 // Marks all entries accessed since |initial_time| for deletion. The return |
| 142 // value is a net error code. If this method returns ERR_IO_PENDING, the | 142 // value is a net error code. If this method returns ERR_IO_PENDING, the |
| 143 // |callback| will be invoked when the operation completes. | 143 // |callback| will be invoked when the operation completes. |
| 144 // Entries with |initial_time| <= access time are deleted. | 144 // Entries with |initial_time| <= access time are deleted. |
| 145 virtual int DoomEntriesSince(base::Time initial_time, | 145 virtual int DoomEntriesSince(base::Time initial_time, |
| 146 const CompletionCallback& callback) = 0; | 146 const CompletionCallback& callback) = 0; |
| 147 | 147 |
| 148 // Calculate the total size of entries satisfying the condition | |
| 149 // |initial_time| <= access_time < |end_time|. This supports unbounded | |
| 150 // counting in either direction by using null Time values for either argument. | |
| 151 // The return value is the number of bytes written or a net error code. | |
|
rvargas (doing something else)
2015/09/12 00:13:02
bytes written?
msramek
2015/09/15 11:42:36
Done. Sorry, copy-paste.
| |
| 152 // If this method returns ERR_IO_PENDING, the |callback| will be invoked when | |
| 153 // the operation completes. | |
| 154 virtual int CalculateSizeOfEntriesBetween( | |
| 155 base::Time initial_time, | |
| 156 base::Time end_time, | |
| 157 const CompletionCallback& callback) = 0; | |
| 158 | |
| 148 // Returns an iterator which will enumerate all entries of the cache in an | 159 // Returns an iterator which will enumerate all entries of the cache in an |
| 149 // undefined order. | 160 // undefined order. |
| 150 virtual scoped_ptr<Iterator> CreateIterator() = 0; | 161 virtual scoped_ptr<Iterator> CreateIterator() = 0; |
| 151 | 162 |
| 152 // Return a list of cache statistics. | 163 // Return a list of cache statistics. |
| 153 virtual void GetStats(base::StringPairs* stats) = 0; | 164 virtual void GetStats(base::StringPairs* stats) = 0; |
| 154 | 165 |
| 155 // Called whenever an external cache in the system reuses the resource | 166 // Called whenever an external cache in the system reuses the resource |
| 156 // referred to by |key|. | 167 // referred to by |key|. |
| 157 virtual void OnExternalCacheHit(const std::string& key) = 0; | 168 virtual void OnExternalCacheHit(const std::string& key) = 0; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 entry->Close(); | 329 entry->Close(); |
| 319 } | 330 } |
| 320 }; | 331 }; |
| 321 | 332 |
| 322 // Automatically closes an entry when it goes out of scope. | 333 // Automatically closes an entry when it goes out of scope. |
| 323 typedef scoped_ptr<Entry, EntryDeleter> ScopedEntryPtr; | 334 typedef scoped_ptr<Entry, EntryDeleter> ScopedEntryPtr; |
| 324 | 335 |
| 325 } // namespace disk_cache | 336 } // namespace disk_cache |
| 326 | 337 |
| 327 #endif // NET_DISK_CACHE_DISK_CACHE_H_ | 338 #endif // NET_DISK_CACHE_DISK_CACHE_H_ |
| OLD | NEW |