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

Unified Diff: net/http/http_cache.cc

Issue 2774603003: Doom and create new entry when validation is not a match (Closed)
Patch Set: Rebased with parent branch Created 3 years, 8 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 | « no previous file | net/http/http_cache_transaction.h » ('j') | net/http/http_cache_transaction.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 315bf3e2f5788bd3e750fbdda9fc0e35b379e491..bec3dec190f77ec4b56441fc46864c215994eb65 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -978,8 +978,13 @@ void HttpCache::ProcessEntryFailure(ActiveEntry* entry) {
RemoveAllQueuedTransactions(entry, &list);
}
// ERR_CACHE_RACE causes the transaction to restart the whole process.
- for (auto* transaction : list)
- transaction->io_callback().Run(net::ERR_CACHE_RACE);
+ for (auto* transaction : list) {
+ // Post task here to avoid a race in case we are here because of the
+ // transaction that is dooming this entry and creating a new one because of
+ // validation not matching.
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(transaction->io_callback(), net::ERR_CACHE_RACE));
Randy Smith (Not in Mondays) 2017/04/27 17:47:12 Random thought, not for this CL: If we do this eve
+ }
}
void HttpCache::ProcessQueuedTransactions(ActiveEntry* entry) {
« no previous file with comments | « no previous file | net/http/http_cache_transaction.h » ('j') | net/http/http_cache_transaction.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698