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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 355028: Disk Cache: New interface that enables asynchronous completion... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/backend_impl.h ('k') | net/disk_cache/disk_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.cc
===================================================================
--- net/disk_cache/backend_impl.cc (revision 30986)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/sys_info.h"
#include "base/timer.h"
#include "base/worker_pool.h"
+#include "net/base/net_errors.h"
#include "net/disk_cache/cache_util.h"
#include "net/disk_cache/entry_impl.h"
#include "net/disk_cache/errors.h"
@@ -379,6 +380,14 @@
return true;
}
+int BackendImpl::OpenEntry(const std::string& key, Entry** entry,
+ CompletionCallback* callback) {
+ if (OpenEntry(key, entry))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) {
if (disabled_ || key.empty())
return false;
@@ -461,6 +470,14 @@
return true;
}
+int BackendImpl::CreateEntry(const std::string& key, Entry** entry,
+ CompletionCallback* callback) {
+ if (CreateEntry(key, entry))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool BackendImpl::DoomEntry(const std::string& key) {
if (disabled_)
return false;
@@ -492,6 +509,13 @@
}
}
+int BackendImpl::DoomAllEntries(CompletionCallback* callback) {
+ if (DoomAllEntries())
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool BackendImpl::DoomEntriesBetween(const Time initial_time,
const Time end_time) {
if (end_time.is_null())
@@ -528,6 +552,15 @@
return true;
}
+int BackendImpl::DoomEntriesBetween(const base::Time initial_time,
+ const base::Time end_time,
+ CompletionCallback* callback) {
+ if (DoomEntriesBetween(initial_time, end_time))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
// We use OpenNextEntry to retrieve elements from the cache, until we get
// entries that are too old.
bool BackendImpl::DoomEntriesSince(const Time initial_time) {
@@ -552,10 +585,26 @@
}
}
+int BackendImpl::DoomEntriesSince(const base::Time initial_time,
+ CompletionCallback* callback) {
+ if (DoomEntriesSince(initial_time))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool BackendImpl::OpenNextEntry(void** iter, Entry** next_entry) {
return OpenFollowingEntry(true, iter, next_entry);
}
+int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
+ CompletionCallback* callback) {
+ if (OpenNextEntry(iter, next_entry))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
void BackendImpl::EndEnumeration(void** iter) {
scoped_ptr<Rankings::Iterator> iterator(
reinterpret_cast<Rankings::Iterator*>(*iter));
« no previous file with comments | « net/disk_cache/backend_impl.h ('k') | net/disk_cache/disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698