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

Unified Diff: webkit/chromeos/fileapi/cros_mount_point_provider.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 | « content/browser/child_process_security_policy_impl.cc ('k') | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/chromeos/fileapi/cros_mount_point_provider.cc
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider.cc b/webkit/chromeos/fileapi/cros_mount_point_provider.cc
index d0b57827b615d6622e0fe690aab81652d27f13a7..9a6bcb751acd9a7eff159d0be0b353111c79f71c 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,
« no previous file with comments | « content/browser/child_process_security_policy_impl.cc ('k') | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698