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

Unified Diff: net/http/http_cache.cc

Issue 13907009: Support optimistic Create and Write operations on the SimpleCache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « net/disk_cache/simple/simple_entry_impl.cc ('k') | no next file » | no next file with comments »
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 27c591d44501dfe84e4cb46e01514692b7a013af..421300ebfedd0d8b89b73b1bf31d4e7899507e66 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -722,7 +722,9 @@ int HttpCache::OpenEntry(const std::string& key, ActiveEntry** entry,
int HttpCache::CreateEntry(const std::string& key, ActiveEntry** entry,
Transaction* trans) {
- DCHECK(!FindActiveEntry(key));
+ if (FindActiveEntry(key)) {
+ return ERR_CACHE_RACE;
+ }
WorkItem* item = new WorkItem(WI_CREATE_ENTRY, trans, entry);
PendingOp* pending_op = GetPendingOp(key);
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698