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

Unified Diff: webkit/fileapi/isolated_mount_point_provider.cc

Issue 14341004: FileAPI code should not rely on or assume specific MountPointProvider types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/local_file_system_operation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_mount_point_provider.cc
diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc
index ddbff29ac1a65239f2d61ce81fa91bae9c16f829..926fb69d1712e160d89c8c36263fdb3ab0fd144a 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -36,6 +36,11 @@
namespace fileapi {
+const char IsolatedMountPointProvider::kMediaPathFilterKey[] =
+ "MediaPathFilterKey";
+const char IsolatedMountPointProvider::kMTPDeviceDelegateURLKey[] =
+ "MTPDeviceDelegateKey";
+
IsolatedMountPointProvider::IsolatedMountPointProvider(
const base::FilePath& profile_path)
: profile_path_(profile_path),
@@ -181,18 +186,25 @@ FileSystemOperation* IsolatedMountPointProvider::CreateFileSystemOperation(
const FileSystemURL& url,
FileSystemContext* context,
base::PlatformFileError* error_code) const {
- scoped_ptr<FileSystemOperationContext> operation_context(
- new FileSystemOperationContext(context));
- if (url.type() == kFileSystemTypeNativeMedia ||
- url.type() == kFileSystemTypeDeviceMedia) {
- operation_context->set_media_path_filter(media_path_filter_.get());
- operation_context->set_task_runner(
- context->task_runners()->media_task_runner());
+ if (url.type() != kFileSystemTypeNativeMedia &&
+ url.type() != kFileSystemTypeDeviceMedia) {
+ return new LocalFileSystemOperation(
+ context, make_scoped_ptr(new FileSystemOperationContext(context)));
}
+ // For media filesystems.
+ scoped_ptr<FileSystemOperationContext> operation_context(
+ new FileSystemOperationContext(
+ context, context->task_runners()->media_task_runner()));
+
+ operation_context->SetUserValue(kMediaPathFilterKey,
+ media_path_filter_.get());
+
#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
- if (url.type() == kFileSystemTypeDeviceMedia)
- operation_context->set_mtp_device_delegate_url(url.filesystem_id());
+ if (url.type() == kFileSystemTypeDeviceMedia) {
+ operation_context->SetUserValue(kMTPDeviceDelegateURLKey,
+ url.filesystem_id());
+ }
#endif
return new LocalFileSystemOperation(context, operation_context.Pass());
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/local_file_system_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698