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

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

Issue 12223075: Make SimpleEntryImpl::Doom() completely asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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_entry_impl.h ('k') | net/disk_cache/simple/simple_synchronous_entry.h » ('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.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);
}
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.h ('k') | net/disk_cache/simple/simple_synchronous_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698