| 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;
|
| }
|
|
|