Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Side by Side Diff: net/disk_cache/disk_cache.h

Issue 1304363013: Add a size estimation mechanism to StoragePartitionHttpCacheDataRemover. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static_cast Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/blockfile/in_flight_backend_io.cc ('k') | net/disk_cache/disk_cache_test_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 the cache. The return value is the size in
149 // bytes or a net error code. If this method returns ERR_IO_PENDING,
150 // the |callback| will be invoked when the operation completes.
151 virtual int CalculateSizeOfAllEntries(
152 const CompletionCallback& callback) = 0;
153
148 // Returns an iterator which will enumerate all entries of the cache in an 154 // Returns an iterator which will enumerate all entries of the cache in an
149 // undefined order. 155 // undefined order.
150 virtual scoped_ptr<Iterator> CreateIterator() = 0; 156 virtual scoped_ptr<Iterator> CreateIterator() = 0;
151 157
152 // Return a list of cache statistics. 158 // Return a list of cache statistics.
153 virtual void GetStats(base::StringPairs* stats) = 0; 159 virtual void GetStats(base::StringPairs* stats) = 0;
154 160
155 // Called whenever an external cache in the system reuses the resource 161 // Called whenever an external cache in the system reuses the resource
156 // referred to by |key|. 162 // referred to by |key|.
157 virtual void OnExternalCacheHit(const std::string& key) = 0; 163 virtual void OnExternalCacheHit(const std::string& key) = 0;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 entry->Close(); 324 entry->Close();
319 } 325 }
320 }; 326 };
321 327
322 // Automatically closes an entry when it goes out of scope. 328 // Automatically closes an entry when it goes out of scope.
323 typedef scoped_ptr<Entry, EntryDeleter> ScopedEntryPtr; 329 typedef scoped_ptr<Entry, EntryDeleter> ScopedEntryPtr;
324 330
325 } // namespace disk_cache 331 } // namespace disk_cache
326 332
327 #endif // NET_DISK_CACHE_DISK_CACHE_H_ 333 #endif // NET_DISK_CACHE_DISK_CACHE_H_
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/in_flight_backend_io.cc ('k') | net/disk_cache/disk_cache_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698