Chromium Code Reviews| 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 b2757517596812390a0ffdbc733108f0d606df07..a9ea09d5fbe00c9dbaed5d8b470abba981912d08 100644 |
| --- a/net/disk_cache/simple/simple_entry_impl.cc |
| +++ b/net/disk_cache/simple/simple_entry_impl.cc |
| @@ -174,15 +174,12 @@ int SimpleEntryImpl::DoomEntry(const FilePath& path, |
| void SimpleEntryImpl::Doom() { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - if (!synchronous_entry_) { |
| - NOTIMPLEMENTED() << ": Overlapping an asynchronous operation."; |
| - return; |
| - } |
| - WorkerPool::PostTask(FROM_HERE, |
| - base::Bind(&SimpleSynchronousEntry::DoomAndClose, |
| - base::Unretained(ReleaseSynchronousEntry())), |
| - true); |
| - has_been_doomed_ = true; |
| +#if defined(OS_WIN) |
|
felipeg
2013/02/12 13:36:56
For windows we could fallback to the previous impl
gavinp
2013/02/12 16:36:31
Hmmm. But I've removed SimpleSynchronousEntry::Doo
|
| + NOTIMPLEMENTED(); |
| +#else |
| + // This implementation depends on POSIX file erasure semantics working. |
|
felipeg
2013/02/12 13:36:56
Maybe adding a little bit more info here would be
gavinp
2013/02/12 16:36:31
Done.
|
| + DoomEntry(path_, key_, CompletionCallback()); |
| +#endif |
| } |
| void SimpleEntryImpl::Close() { |
| @@ -192,13 +189,12 @@ void SimpleEntryImpl::Close() { |
| delete this; |
| return; |
| } |
| - if (!has_been_doomed_) { |
| - WorkerPool::PostTask(FROM_HERE, |
| - base::Bind(&SimpleSynchronousEntry::Close, |
| - base::Unretained( |
| - ReleaseSynchronousEntry())), |
| - true); |
| - } |
| + |
| + WorkerPool::PostTask(FROM_HERE, |
| + base::Bind(&SimpleSynchronousEntry::Close, |
| + base::Unretained( |
| + ReleaseSynchronousEntry())), |
| + true); |
| // Entry::Close() is expected to release this entry. See disk_cache.h for |
| // details. |
| delete this; |
| @@ -324,8 +320,7 @@ SimpleEntryImpl::SimpleEntryImpl( |
| : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
| path_(synchronous_entry->path()), |
| key_(synchronous_entry->key()), |
| - synchronous_entry_(NULL), |
| - has_been_doomed_(false) { |
| + synchronous_entry_(NULL) { |
| SetSynchronousEntry(synchronous_entry); |
| } |