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

Unified Diff: net/disk_cache/simple/simple_index_file.cc

Issue 691803003: Do not DCHECK on SimpleCache deletion-while-closing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove bigger example test Created 6 years, 2 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
« net/disk_cache/backend_unittest.cc ('K') | « net/disk_cache/backend_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index_file.cc
diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc
index c6a29a28333d99d2617adfa7f26911760c632177..91dc3b7d77a35edb190f70f03f0fb7eb1bb0c149 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -71,7 +71,7 @@ void UmaRecordIndexInitMethod(IndexInitMethod method,
bool WritePickleFile(Pickle* pickle, const base::FilePath& file_name) {
File file(
file_name,
- File::FLAG_CREATE_ALWAYS | File::FLAG_WRITE | File::FLAG_SHARE_DELETE);
+ File::FLAG_CREATE | File::FLAG_WRITE | File::FLAG_SHARE_DELETE);
gavinp 2014/10/30 18:59:20 This change is good to do while we are here: if mu
if (!file.IsValid())
return false;
@@ -222,8 +222,8 @@ void SimpleIndexFile::SyncWriteToDisk(net::CacheType cache_type,
}
// Atomically rename the temporary index file to become the real one.
- bool result = base::ReplaceFile(temp_index_filename, index_filename, NULL);
- DCHECK(result);
+ if (!base::ReplaceFile(temp_index_filename, index_filename, NULL))
+ return;
jkarlin 2014/10/30 19:19:24 Would be better to replace DCHECK(result) with DCH
gavinp 2014/10/31 13:55:54 That data isn't easily available here; it would re
if (app_on_background) {
SIMPLE_CACHE_UMA(TIMES,
« net/disk_cache/backend_unittest.cc ('K') | « net/disk_cache/backend_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698