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 22cbc956972cfc096089ca9021cd23100eb288bb..bf914747f80577c50d0b121e83ce786c01cbb1c1 100644 |
--- a/net/disk_cache/simple/simple_entry_impl.cc |
+++ b/net/disk_cache/simple/simple_entry_impl.cc |
@@ -39,22 +39,22 @@ int SimpleEntryImpl::OpenEntry(const scoped_refptr<SimpleIndex>& index, |
const std::string& key, |
Entry** entry, |
const CompletionCallback& callback) { |
- // TODO(gavinp): More closely unify the last_used_ in the |
- // SimpleSynchronousEntry and the SimpleIndex. |
- if (!index || index->UseIfExists(key)) { |
- scoped_refptr<SimpleEntryImpl> new_entry = |
- new SimpleEntryImpl(index, path, key); |
- SynchronousCreationCallback sync_creation_callback = |
- base::Bind(&SimpleEntryImpl::CreationOperationComplete, |
- new_entry, entry, callback); |
- WorkerPool::PostTask(FROM_HERE, |
- base::Bind(&SimpleSynchronousEntry::OpenEntry, path, |
- key, MessageLoopProxy::current(), |
- sync_creation_callback), |
- true); |
- return net::ERR_IO_PENDING; |
- } |
- return net::ERR_FAILED; |
+ // If entry is not known to the index, initiate fast failover to the network. |
+ if (index && !index->Has(key)) |
felipeg
2013/04/18 10:05:05
This change is not related and is not necessary to
pasko-google - do not use
2013/04/18 10:16:06
thanks for review, dodged a bug here.
Since I had
|
+ return net::ERR_FAILED; |
+ |
+ // Go down to the disk to find the entry. |
+ scoped_refptr<SimpleEntryImpl> new_entry = |
+ new SimpleEntryImpl(index, path, key); |
+ SynchronousCreationCallback sync_creation_callback = |
+ base::Bind(&SimpleEntryImpl::CreationOperationComplete, |
+ new_entry, entry, callback); |
+ WorkerPool::PostTask(FROM_HERE, |
+ base::Bind(&SimpleSynchronousEntry::OpenEntry, path, |
+ key, MessageLoopProxy::current(), |
+ sync_creation_callback), |
+ true); |
+ return net::ERR_IO_PENDING; |
} |
// static |