Chromium Code Reviews| 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, |