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

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: gavin comments 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
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 27c591d44501dfe84e4cb46e01514692b7a013af..19c7c86f91e6c832caf0fcf8859f476d92b873ad 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -722,7 +722,10 @@ 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);
« net/disk_cache/simple/simple_entry_impl.cc ('K') | « 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