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) { |