diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 21:06:24 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 21:06:24 +0000 |
commit | 7e6a4f39d228f64a9f666ea8ccbe88bcff3850d2 (patch) | |
tree | cdec59f4684bf672a94b37179a5352ab18bb0e58 /net/http/http_cache.cc | |
parent | c32f04146677ab69289f661de3236fda5791c953 (diff) | |
download | chromium_src-7e6a4f39d228f64a9f666ea8ccbe88bcff3850d2.zip chromium_src-7e6a4f39d228f64a9f666ea8ccbe88bcff3850d2.tar.gz chromium_src-7e6a4f39d228f64a9f666ea8ccbe88bcff3850d2.tar.bz2 |
Http Cache: Eliminate EntryAvailable() and make the cache use
callbacks to notify the transaction about the completion
of AddTransactionToEntry.
BUG=26729
TEST=current tests.
Review URL: http://codereview.chromium.org/593058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache.cc')
-rw-r--r-- | net/http/http_cache.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index d4e3d2b..b0305af 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -555,7 +555,7 @@ int HttpCache::AddTransactionToEntry(ActiveEntry* entry, Transaction* trans) { if (!entry->writer && !entry->pending_queue.empty()) ProcessPendingQueue(entry); - return trans->EntryAvailable(entry); + return OK; } void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans, @@ -602,7 +602,8 @@ void HttpCache::DoneWritingToEntry(ActiveEntry* entry, bool success) { // We need to do something about these pending entries, which now need to // be added to a new entry. while (!pending_queue.empty()) { - pending_queue.front()->AddToEntry(); + // ERR_CACHE_RACE causes the transaction to restart the whole process. + pending_queue.front()->io_callback()->Run(ERR_CACHE_RACE); pending_queue.pop_front(); } } @@ -718,7 +719,10 @@ void HttpCache::OnProcessPendingQueue(ActiveEntry* entry) { entry->pending_queue.erase(entry->pending_queue.begin()); - AddTransactionToEntry(entry, next); + int rv = AddTransactionToEntry(entry, next); + if (rv != ERR_IO_PENDING) { + next->io_callback()->Run(rv); + } } void HttpCache::OnIOComplete(int result, NewEntry* new_entry) { |