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

Side by Side Diff: net/disk_cache/simple/simple_entry_impl.cc

Issue 23823002: Don't doom the wrong simple cache entry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to CQed version upstream Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/disk_cache/simple/simple_entry_impl.h" 5 #include "net/disk_cache/simple/simple_entry_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // have the entry in the index but we don't have the created files yet, this 246 // have the entry in the index but we don't have the created files yet, this
247 // way we never leak files. CreationOperationComplete will remove the entry 247 // way we never leak files. CreationOperationComplete will remove the entry
248 // from the index if the creation fails. 248 // from the index if the creation fails.
249 backend_->index()->Insert(entry_hash_); 249 backend_->index()->Insert(entry_hash_);
250 250
251 RunNextOperationIfNeeded(); 251 RunNextOperationIfNeeded();
252 return ret_value; 252 return ret_value;
253 } 253 }
254 254
255 int SimpleEntryImpl::DoomEntry(const CompletionCallback& callback) { 255 int SimpleEntryImpl::DoomEntry(const CompletionCallback& callback) {
256 if (doomed_)
pasko 2013/09/12 10:46:48 hm, so if the MarkAsDoomed() on the previous entry
gavinp 2013/09/12 15:39:48 Done.
257 return net::OK;
256 net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_DOOM_CALL); 258 net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_DOOM_CALL);
257 net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_DOOM_BEGIN); 259 net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_DOOM_BEGIN);
258 260
259 MarkAsDoomed(); 261 MarkAsDoomed();
260 pending_operations_.push(SimpleEntryOperation::DoomOperation(this, callback)); 262 pending_operations_.push(SimpleEntryOperation::DoomOperation(this, callback));
261 RunNextOperationIfNeeded(); 263 RunNextOperationIfNeeded();
262 return net::ERR_IO_PENDING; 264 return net::ERR_IO_PENDING;
263 } 265 }
264 266
265 void SimpleEntryImpl::SetKey(const std::string& key) { 267 void SimpleEntryImpl::SetKey(const std::string& key) {
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 type = conflicting ? WRITE_FOLLOWS_CONFLICTING_WRITE 1227 type = conflicting ? WRITE_FOLLOWS_CONFLICTING_WRITE
1226 : WRITE_FOLLOWS_NON_CONFLICTING_WRITE; 1228 : WRITE_FOLLOWS_NON_CONFLICTING_WRITE;
1227 } 1229 }
1228 } 1230 }
1229 SIMPLE_CACHE_UMA(ENUMERATION, 1231 SIMPLE_CACHE_UMA(ENUMERATION,
1230 "WriteDependencyType", cache_type_, 1232 "WriteDependencyType", cache_type_,
1231 type, WRITE_DEPENDENCY_TYPE_MAX); 1233 type, WRITE_DEPENDENCY_TYPE_MAX);
1232 } 1234 }
1233 1235
1234 } // namespace disk_cache 1236 } // namespace disk_cache
OLDNEW
« net/disk_cache/entry_unittest.cc ('K') | « net/disk_cache/simple/simple_entry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698