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

Unified Diff: webkit/browser/fileapi/local_file_stream_writer.cc

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fixes [builds, untested] Created 7 years, 3 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
Index: webkit/browser/fileapi/local_file_stream_writer.cc
diff --git a/webkit/browser/fileapi/local_file_stream_writer.cc b/webkit/browser/fileapi/local_file_stream_writer.cc
index 3f779c969ed0619ffe8c27c2b93789a7d68fe271..743baa630b7c4c2bceadc7cb0bfc5a11acd8fbf9 100644
--- a/webkit/browser/fileapi/local_file_stream_writer.cc
+++ b/webkit/browser/fileapi/local_file_stream_writer.cc
@@ -17,13 +17,18 @@ namespace {
const int kOpenFlagsForWrite = base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_WRITE |
base::PLATFORM_FILE_ASYNC;
+const int kCreateFlagsForWrite = base::PLATFORM_FILE_CREATE |
+ base::PLATFORM_FILE_WRITE |
+ base::PLATFORM_FILE_ASYNC;
} // namespace
LocalFileStreamWriter::LocalFileStreamWriter(base::TaskRunner* task_runner,
const base::FilePath& file_path,
- int64 initial_offset)
+ int64 initial_offset,
+ bool open_not_create)
: file_path_(file_path),
+ open_not_create_(open_not_create),
initial_offset_(initial_offset),
has_pending_operation_(false),
weak_factory_(this),
@@ -90,7 +95,8 @@ int LocalFileStreamWriter::InitiateOpen(
stream_impl_.reset(new net::FileStream(NULL, task_runner_));
return stream_impl_->Open(file_path_,
- kOpenFlagsForWrite,
+ open_not_create_ ? kOpenFlagsForWrite :
+ kCreateFlagsForWrite,
base::Bind(&LocalFileStreamWriter::DidOpen,
weak_factory_.GetWeakPtr(),
error_callback,

Powered by Google App Engine
This is Rietveld 408576698