diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 12:16:38 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 12:16:38 +0000 |
commit | 7469890d06410b66a1bec630c8d67e11c22eb84a (patch) | |
tree | 5f6adc35e36ad9bcf1cba2402b8c4e4158e22984 /webkit/chromeos | |
parent | 6a1d56a0ef3b8a73a57c98c271acac66b8bffc5b (diff) | |
download | chromium_src-7469890d06410b66a1bec630c8d67e11c22eb84a.zip chromium_src-7469890d06410b66a1bec630c8d67e11c22eb84a.tar.gz chromium_src-7469890d06410b66a1bec630c8d67e11c22eb84a.tar.bz2 |
Retry: Make Isolated file system writable only if it is configured so
- CreateFileStreamWriter wiring in FSO
- Add yet another write-protection at IsolatedContext (in addition to ChildProcessSecurityPolicy, so that we can make each fs read-only or writable in DRT/testing)
BUG=none
TEST=existing tests should pass
Original review URL: https://chromiumcodereview.appspot.com/10540070
Review URL: https://chromiumcodereview.appspot.com/10532085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/chromeos')
-rw-r--r-- | webkit/chromeos/fileapi/cros_mount_point_provider.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider.cc b/webkit/chromeos/fileapi/cros_mount_point_provider.cc index d0b5782..9a6bcb7 100644 --- a/webkit/chromeos/fileapi/cros_mount_point_provider.cc +++ b/webkit/chromeos/fileapi/cros_mount_point_provider.cc @@ -20,6 +20,7 @@ #include "webkit/fileapi/file_system_file_stream_reader.h" #include "webkit/fileapi/file_system_operation.h" #include "webkit/fileapi/file_system_util.h" +#include "webkit/fileapi/local_file_stream_writer.h" #include "webkit/glue/webkit_glue.h" namespace { @@ -268,10 +269,19 @@ fileapi::FileStreamWriter* CrosMountPointProvider::CreateFileStreamWriter( const GURL& url, int64 offset, fileapi::FileSystemContext* context) const { - // TODO(kinaba,kinuko,benchan,satorux): return a writer for remote or local - // file system depending on the mount point location. - NOTIMPLEMENTED(); - return NULL; + FilePath virtual_path; + if (!fileapi::CrackFileSystemURL(url, NULL, NULL, &virtual_path)) + return NULL; + const MountPoint* mount_point = GetMountPoint(virtual_path); + if (!mount_point) + return NULL; + if (mount_point->location == REMOTE) { + // TODO(kinaba): return a gdata writer for remote file system. + return NULL; + } + FilePath root_path = mount_point->local_root_path; + return new fileapi::LocalFileStreamWriter( + root_path.Append(virtual_path), offset); } bool CrosMountPointProvider::GetVirtualPath(const FilePath& filesystem_path, |