diff options
Diffstat (limited to 'net/disk_cache')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 8 | ||||
-rw-r--r-- | net/disk_cache/backend_impl.h | 1 | ||||
-rw-r--r-- | net/disk_cache/disk_cache.h | 7 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.cc | 8 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.h | 1 |
5 files changed, 25 insertions, 0 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 9ab3271..3b3ca6a 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -494,6 +494,14 @@ bool BackendImpl::DoomEntry(const std::string& key) { return true; } +int BackendImpl::DoomEntry(const std::string& key, + CompletionCallback* callback) { + if (DoomEntry(key)) + return net::OK; + + return net::ERR_FAILED; +} + bool BackendImpl::DoomAllEntries() { if (!num_refs_) { PrepareForRestart(); diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index b9a288f..6267fac 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -68,6 +68,7 @@ class BackendImpl : public Backend { virtual int CreateEntry(const std::string& key, Entry** entry, CompletionCallback* callback); virtual bool DoomEntry(const std::string& key); + virtual int DoomEntry(const std::string& key, CompletionCallback* callback); virtual bool DoomAllEntries(); virtual int DoomAllEntries(CompletionCallback* callback); virtual bool DoomEntriesBetween(const base::Time initial_time, diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index c47bd47..3d2793b 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -113,8 +113,15 @@ class Backend { CompletionCallback* callback) = 0; // Marks the entry, specified by the given key, for deletion. + // Note: This method is deprecated. virtual bool DoomEntry(const std::string& key) = 0; + // Marks the entry, specified by the given key, for deletion. The return value + // is a net error code. If this method returns ERR_IO_PENDING, the |callback| + // will be invoked after the entry is doomed. + virtual int DoomEntry(const std::string& key, + CompletionCallback* callback) = 0; + // Marks all entries for deletion. // Note: This method is deprecated. virtual bool DoomAllEntries() = 0; diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc index 0b0d7bd..875efdc 100644 --- a/net/disk_cache/mem_backend_impl.cc +++ b/net/disk_cache/mem_backend_impl.cc @@ -144,6 +144,14 @@ bool MemBackendImpl::DoomEntry(const std::string& key) { return true; } +int MemBackendImpl::DoomEntry(const std::string& key, + CompletionCallback* callback) { + if (DoomEntry(key)) + return net::OK; + + return net::ERR_FAILED; +} + void MemBackendImpl::InternalDoomEntry(MemEntryImpl* entry) { // Only parent entries can be passed into this method. DCHECK(entry->type() == MemEntryImpl::kParentEntry); diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h index 5c9899e..48d196c 100644 --- a/net/disk_cache/mem_backend_impl.h +++ b/net/disk_cache/mem_backend_impl.h @@ -35,6 +35,7 @@ class MemBackendImpl : public Backend { virtual int CreateEntry(const std::string& key, Entry** entry, CompletionCallback* callback); virtual bool DoomEntry(const std::string& key); + virtual int DoomEntry(const std::string& key, CompletionCallback* callback); virtual bool DoomAllEntries(); virtual int DoomAllEntries(CompletionCallback* callback); virtual bool DoomEntriesBetween(const base::Time initial_time, |