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); |