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

Unified Diff: net/disk_cache/simple/simple_entry_impl.cc

Issue 23486006: Track entries pending Doom in SimpleCache backend. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: net/disk_cache/simple/simple_entry_impl.cc
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc
index 32a22b44984766480bb5d432646b6aad47500116..9a53d7f7fa90738affdf7afe74496b28cebdb214 100644
--- a/net/disk_cache/simple/simple_entry_impl.cc
+++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -891,11 +891,13 @@ void SimpleEntryImpl::WriteDataInternal(int stream_index,
}
void SimpleEntryImpl::DoomEntryInternal(const CompletionCallback& callback) {
+ if (backend_)
+ backend_->OnDoomStart(entry_hash_);
PostTaskAndReplyWithResult(
worker_pool_, FROM_HERE,
base::Bind(&SimpleSynchronousEntry::DoomEntry, path_, key_, entry_hash_),
- base::Bind(&SimpleEntryImpl::DoomOperationComplete, this, callback,
- state_));
+ base::Bind(&SimpleEntryImpl::DoomOperationComplete,
+ this, backend_, callback, state_));
state_ = STATE_IO_PENDING;
}
@@ -1069,10 +1071,14 @@ void SimpleEntryImpl::WriteOperationComplete(
stream_index, completion_callback, *entry_stat, result.Pass());
}
-void SimpleEntryImpl::DoomOperationComplete(const CompletionCallback& callback,
- State state_to_restore,
- int result) {
+void SimpleEntryImpl::DoomOperationComplete(
+ const base::WeakPtr<SimpleBackendImpl>& backend,
+ const CompletionCallback& callback,
+ State state_to_restore,
+ int result) {
state_ = state_to_restore;
+ if (backend)
+ backend->OnDoomComplete(entry_hash_);
if (!callback.is_null())
callback.Run(result);
RunNextOperationIfNeeded();
« net/disk_cache/simple/simple_backend_impl.cc ('K') | « net/disk_cache/simple/simple_entry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698