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

Unified Diff: webkit/fileapi/file_system_operation.cc

Issue 10532085: Retry: Make Isolated file system writable only if it is configured so (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « webkit/chromeos/fileapi/cros_mount_point_provider.cc ('k') | webkit/fileapi/isolated_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation.cc
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc
index 1084fd8a33b15587132aa9d02f48be59ed9a4a43..5c77024848a5d55852bc0472dd6ff94325012999 100644
--- a/webkit/fileapi/file_system_operation.cc
+++ b/webkit/fileapi/file_system_operation.cc
@@ -287,13 +287,25 @@ void FileSystemOperation::Write(
delete this;
return;
}
+
+ FileSystemMountPointProvider* provider = file_system_context()->
+ GetMountPointProvider(src_path_.type());
+ DCHECK(provider);
+ scoped_ptr<FileStreamWriter> writer(provider->CreateFileStreamWriter(
+ path_url, offset, file_system_context()));
+
+ if (!writer.get()) {
+ // Write is not supported.
+ callback.Run(base::PLATFORM_FILE_ERROR_SECURITY, 0, false);
+ delete this;
+ return;
+ }
+
DCHECK(blob_url.is_valid());
file_writer_delegate_.reset(new FileWriterDelegate(
base::Bind(&FileSystemOperation::DidWrite, weak_factory_.GetWeakPtr()),
- scoped_ptr<FileStreamWriter>(
- new SandboxFileStreamWriter(file_system_context(),
- path_url,
- offset))));
+ writer.Pass()));
+
set_write_callback(callback);
scoped_ptr<net::URLRequest> blob_request(
new net::URLRequest(blob_url, file_writer_delegate_.get()));
« no previous file with comments | « webkit/chromeos/fileapi/cros_mount_point_provider.cc ('k') | webkit/fileapi/isolated_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698