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

Unified Diff: net/disk_cache/mem_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/mem_backend_impl.h ('k') | net/disk_cache/mem_entry_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/mem_backend_impl.cc
===================================================================
--- net/disk_cache/mem_backend_impl.cc (revision 30986)
+++ net/disk_cache/mem_backend_impl.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/sys_info.h"
+#include "net/base/net_errors.h"
#include "net/disk_cache/cache_util.h"
#include "net/disk_cache/mem_entry_impl.h"
@@ -99,6 +100,14 @@
return true;
}
+int MemBackendImpl::OpenEntry(const std::string& key, Entry** entry,
+ CompletionCallback* callback) {
+ if (OpenEntry(key, entry))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool MemBackendImpl::CreateEntry(const std::string& key, Entry** entry) {
EntryMap::iterator it = entries_.find(key);
if (it != entries_.end())
@@ -117,6 +126,14 @@
return true;
}
+int MemBackendImpl::CreateEntry(const std::string& key, Entry** entry,
+ CompletionCallback* callback) {
+ if (CreateEntry(key, entry))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool MemBackendImpl::DoomEntry(const std::string& key) {
Entry* entry;
if (!OpenEntry(key, &entry))
@@ -146,6 +163,13 @@
return true;
}
+int MemBackendImpl::DoomAllEntries(CompletionCallback* callback) {
+ if (DoomAllEntries())
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool MemBackendImpl::DoomEntriesBetween(const Time initial_time,
const Time end_time) {
if (end_time.is_null())
@@ -172,6 +196,15 @@
return true;
}
+int MemBackendImpl::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;
+}
+
bool MemBackendImpl::DoomEntriesSince(const Time initial_time) {
for (;;) {
// Get the entry in the front.
@@ -184,6 +217,14 @@
}
}
+int MemBackendImpl::DoomEntriesSince(const base::Time initial_time,
+ CompletionCallback* callback) {
+ if (DoomEntriesSince(initial_time))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
bool MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry) {
MemEntryImpl* current = reinterpret_cast<MemEntryImpl*>(*iter);
MemEntryImpl* node = rankings_.GetNext(current);
@@ -201,6 +242,14 @@
return NULL != node;
}
+int MemBackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
+ CompletionCallback* callback) {
+ if (OpenNextEntry(iter, next_entry))
+ return net::OK;
+
+ return net::ERR_FAILED;
+}
+
void MemBackendImpl::EndEnumeration(void** iter) {
*iter = NULL;
}
« no previous file with comments | « net/disk_cache/mem_backend_impl.h ('k') | net/disk_cache/mem_entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698