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

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

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/disk_cache/simple/simple_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_synchronous_entry.cc
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index c50c9a350ec5e2f73ec5d27fd393812cf39b2ed1..52f8f08c35e1d04b43302f61282543ec4554542f 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -719,7 +719,8 @@ bool SimpleSynchronousEntry::MaybeOpenFile(
DCHECK(out_error);
FilePath filename = GetFilenameFromFileIndex(file_index);
- int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE;
+ int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE |
+ File::FLAG_SHARE_DELETE;
files_[file_index].Initialize(filename, flags);
*out_error = files_[file_index].error_details();
@@ -744,7 +745,8 @@ bool SimpleSynchronousEntry::MaybeCreateFile(
}
FilePath filename = GetFilenameFromFileIndex(file_index);
- int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE;
+ int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE |
+ File::FLAG_SHARE_DELETE;
files_[file_index].Initialize(filename, flags);
*out_error = files_[file_index].error_details();
@@ -1136,7 +1138,7 @@ bool SimpleSynchronousEntry::DeleteFileForEntryHash(
const int file_index) {
FilePath to_delete = path.AppendASCII(
GetFilenameFromEntryHashAndFileIndex(entry_hash, file_index));
- return base::DeleteFile(to_delete, false);
+ return simple_util::SimpleCacheDeleteFile(to_delete);
}
// static
@@ -1150,7 +1152,7 @@ bool SimpleSynchronousEntry::DeleteFilesForEntryHash(
}
FilePath to_delete = path.AppendASCII(
GetSparseFilenameFromEntryHash(entry_hash));
- base::DeleteFile(to_delete, false);
+ simple_util::SimpleCacheDeleteFile(to_delete);
return result;
}
@@ -1181,7 +1183,8 @@ bool SimpleSynchronousEntry::OpenSparseFileIfExists(
FilePath filename = path_.AppendASCII(
GetSparseFilenameFromEntryHash(entry_hash_));
- int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE;
+ int flags = File::FLAG_OPEN | File::FLAG_READ | File::FLAG_WRITE |
+ File::FLAG_SHARE_DELETE;
sparse_file_.Initialize(filename, flags);
if (sparse_file_.IsValid())
return ScanSparseFile(out_sparse_data_size);
@@ -1194,7 +1197,8 @@ bool SimpleSynchronousEntry::CreateSparseFile() {
FilePath filename = path_.AppendASCII(
GetSparseFilenameFromEntryHash(entry_hash_));
- int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE;
+ int flags = File::FLAG_CREATE | File::FLAG_READ | File::FLAG_WRITE |
+ File::FLAG_SHARE_DELETE;
sparse_file_.Initialize(filename, flags);
if (!sparse_file_.IsValid())
return false;
« no previous file with comments | « net/disk_cache/simple/simple_index_file.cc ('k') | net/disk_cache/simple/simple_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698