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

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: Removed public GetEntrySize Created 5 years, 3 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
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 entries satisfying the condition
149 // |initial_time| <= access_time < |end_time|. The return value is the number
150 // of bytes written or a net error code. If this method returns
151 // ERR_IO_PENDING, the |callback| will be invoked when the operation
152 // completes.
pasko 2015/09/08 13:13:49 Please also make it similar to DoomEntriesBetween
msramek 2015/09/08 18:32:22 As explained in the other comment, this part is ap
pasko 2015/09/09 09:09:29 opps, for simple_cache we certainly allow unbounde
msramek 2015/09/09 09:20:42 The comment is in Patchset 6, backend_impl.cc. In
153 virtual int CalculateSizeOfEntriesBetween(
154 base::Time initial_time,
155 base::Time end_time,
156 const CompletionCallback& callback) = 0;
157
148 // Returns an iterator which will enumerate all entries of the cache in an 158 // Returns an iterator which will enumerate all entries of the cache in an
149 // undefined order. 159 // undefined order.
150 virtual scoped_ptr<Iterator> CreateIterator() = 0; 160 virtual scoped_ptr<Iterator> CreateIterator() = 0;
151 161
152 // Return a list of cache statistics. 162 // Return a list of cache statistics.
153 virtual void GetStats(base::StringPairs* stats) = 0; 163 virtual void GetStats(base::StringPairs* stats) = 0;
154 164
155 // Called whenever an external cache in the system reuses the resource 165 // Called whenever an external cache in the system reuses the resource
156 // referred to by |key|. 166 // referred to by |key|.
157 virtual void OnExternalCacheHit(const std::string& key) = 0; 167 virtual void OnExternalCacheHit(const std::string& key) = 0;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 entry->Close(); 328 entry->Close();
319 } 329 }
320 }; 330 };
321 331
322 // Automatically closes an entry when it goes out of scope. 332 // Automatically closes an entry when it goes out of scope.
323 typedef scoped_ptr<Entry, EntryDeleter> ScopedEntryPtr; 333 typedef scoped_ptr<Entry, EntryDeleter> ScopedEntryPtr;
324 334
325 } // namespace disk_cache 335 } // namespace disk_cache
326 336
327 #endif // NET_DISK_CACHE_DISK_CACHE_H_ 337 #endif // NET_DISK_CACHE_DISK_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698