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

Unified Diff: net/disk_cache/disk_cache.h

Issue 2626173003: Calculate the size of all cache entries between two points in time. (Closed)
Patch Set: revert cache_storage_cache_unittest.cc Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/cache_creator.cc ('k') | net/disk_cache/disk_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/disk_cache.h
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index f71bc81964b929f4dce5596d724c41bf36429279..09924065c4b7bc39be9b031246e9456a0042b888 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -19,6 +19,7 @@
#include "base/time/time.h"
#include "net/base/cache_type.h"
#include "net/base/completion_callback.h"
+#include "net/base/net_errors.h"
#include "net/base/net_export.h"
namespace base {
@@ -149,8 +150,19 @@ class NET_EXPORT Backend {
// Calculate the total size of the cache. The return value is the size in
// bytes or a net error code. If this method returns ERR_IO_PENDING,
// the |callback| will be invoked when the operation completes.
- virtual int CalculateSizeOfAllEntries(
- const CompletionCallback& callback) = 0;
+ virtual int CalculateSizeOfAllEntries(const CompletionCallback& callback) = 0;
+
+ // Calculate the size of all cache entries accessed between |initial_time| and
+ // |end_time|.
+ // The return value is the size in bytes or a net error code. The default
+ // implementation returns ERR_NOT_IMPLEMENTED and should only be overwritten
+ // if there is an efficient way for the backend to determine the size for a
+ // subset of the cache without reading the whole cache from disk.
+ // If this method returns ERR_IO_PENDING, the |callback| will be invoked when
+ // the operation completes.
+ virtual int CalculateSizeOfEntriesBetween(base::Time initial_time,
+ base::Time end_time,
+ const CompletionCallback& callback);
// Returns an iterator which will enumerate all entries of the cache in an
// undefined order.
« no previous file with comments | « net/disk_cache/cache_creator.cc ('k') | net/disk_cache/disk_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698