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

Unified Diff: net/base/file_stream_context.cc

Issue 11440008: Add SHARED_DELETE flag to FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | net/base/file_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream_context.cc
diff --git a/net/base/file_stream_context.cc b/net/base/file_stream_context.cc
index 1ed7ef628ad0229f771d402ac526bfdfe7c8bdce..1e0c157ed8c43f653a93e0c95147ae4636f2bddf 100644
--- a/net/base/file_stream_context.cc
+++ b/net/base/file_stream_context.cc
@@ -151,6 +151,11 @@ void FileStream::Context::BeginOpenEvent(const FilePath& path) {
FileStream::Context::OpenResult FileStream::Context::OpenFileImpl(
const FilePath& path, int open_flags) {
+ // FileStream::Context actually closes the file asynchronously, independently
+ // from FileStream's destructor. It can cause problems for users wanting to
+ // delete the file right after FileStream deletion. Thus we are always
+ // adding SHARE_DELETE flag to accommodate such use case.
wtc 2012/12/12 20:05:17 I suggest clarifying this comment as follows. 1.
+ open_flags |= base::PLATFORM_FILE_SHARE_DELETE;
OpenResult result;
result.error_code = OK;
result.file = base::CreatePlatformFile(path, open_flags, NULL, NULL);
« no previous file with comments | « no previous file | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698