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

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

Issue 22859060: Fix race condition for non-open/create operations happening after a doom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix parameters alignment 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
« no previous file with comments | « net/disk_cache/simple/simple_backend_impl.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_entry_impl.h
diff --git a/net/disk_cache/simple/simple_entry_impl.h b/net/disk_cache/simple/simple_entry_impl.h
index 7eb8914e8731ab73d1dca0ef0b394b678123db87..e3a948723024beb07b0d7e1b121db530623e833c 100644
--- a/net/disk_cache/simple/simple_entry_impl.h
+++ b/net/disk_cache/simple/simple_entry_impl.h
@@ -177,6 +177,8 @@ class SimpleEntryImpl : public Entry, public base::RefCounted<SimpleEntryImpl>,
const CompletionCallback& callback,
bool truncate);
+ void DoomEntryInternal(const CompletionCallback& callback);
+
// Called after a SimpleSynchronousEntry has completed CreateEntry() or
// OpenEntry(). If |in_sync_entry| is non-NULL, creation is successful and we
// can return |this| SimpleEntryImpl to |*out_entry|. Runs
@@ -214,6 +216,12 @@ class SimpleEntryImpl : public Entry, public base::RefCounted<SimpleEntryImpl>,
scoped_ptr<SimpleEntryStat> entry_stat,
scoped_ptr<int> result);
+ // Called after an asynchronous doom completes. |state_to_restore| was the
+ // state of the entry instance before it transitioned to IO_PENDING.
+ void DoomOperationComplete(State state_to_restore,
+ const CompletionCallback& callback,
+ int result);
+
// Called after validating the checksums on an entry. Passes through the
// original result if successful, propogates the error if the checksum does
// not validate.
@@ -274,8 +282,7 @@ class SimpleEntryImpl : public Entry, public base::RefCounted<SimpleEntryImpl>,
CheckCrcResult crc_check_state_[kSimpleEntryFileCount];
// The |synchronous_entry_| is the worker thread object that performs IO on
- // entries. It's owned by this SimpleEntryImpl whenever |operation_running_|
- // is false (i.e. when an operation is not pending on the worker pool).
Randy Smith (Not in Mondays) 2013/08/27 19:16:39 I'd really like to keep a comment here describing
+ // entries.
SimpleSynchronousEntry* synchronous_entry_;
std::queue<SimpleEntryOperation> pending_operations_;
« no previous file with comments | « net/disk_cache/simple/simple_backend_impl.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698