| 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 a8875a0b670ea2abc0ec462869e84ab36449890a..182203aeeff103235c613cd0fc7f1dc205e6703d 100644
|
| --- a/webkit/fileapi/isolated_mount_point_provider.cc
|
| +++ b/webkit/fileapi/isolated_mount_point_provider.cc
|
| @@ -21,8 +21,14 @@
|
| #include "webkit/fileapi/isolated_file_util.h"
|
| #include "webkit/fileapi/local_file_stream_writer.h"
|
| #include "webkit/fileapi/local_file_system_operation.h"
|
| +#include "webkit/fileapi/media/media_file_system_config.h"
|
| #include "webkit/fileapi/native_file_util.h"
|
|
|
| +#if defined(SUPPORT_MEDIA_FILESYSTEM)
|
| +#include "webkit/fileapi/media/device_media_file_util.h"
|
| +#include "webkit/fileapi/media/media_device_map_service.h"
|
| +#endif
|
| +
|
| namespace fileapi {
|
|
|
| namespace {
|
| @@ -31,11 +37,25 @@ IsolatedContext* isolated_context() {
|
| return IsolatedContext::GetInstance();
|
| }
|
|
|
| +#if defined(SUPPORT_MEDIA_FILESYSTEM)
|
| +MediaDeviceInterfaceImpl* GetDeviceForUrl(const FileSystemURL& url,
|
| + FileSystemContext* context) {
|
| + return MediaDeviceMapService::GetInstance()->CreateOrGetMediaDevice(
|
| + url.filesystem_id(), context->file_task_runner());
|
| +}
|
| +#endif
|
| +
|
| } // namespace
|
|
|
| -IsolatedMountPointProvider::IsolatedMountPointProvider()
|
| - : isolated_file_util_(new IsolatedFileUtil()),
|
| +IsolatedMountPointProvider::IsolatedMountPointProvider(
|
| + const FilePath& profile_path)
|
| + : profile_path_(profile_path),
|
| + isolated_file_util_(new IsolatedFileUtil()),
|
| dragged_file_util_(new DraggedFileUtil()) {
|
| + // TODO(kmadhusu): Initialize device_media_file_util_ in initialization list.
|
| +#if defined(SUPPORT_MEDIA_FILESYSTEM)
|
| + device_media_file_util_.reset(new DeviceMediaFileUtil(profile_path_));
|
| +#endif
|
| }
|
|
|
| IsolatedMountPointProvider::~IsolatedMountPointProvider() {
|
| @@ -78,6 +98,10 @@ FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil(
|
| FileSystemType type) {
|
| if (type == kFileSystemTypeDragged)
|
| return dragged_file_util_.get();
|
| +#if defined(SUPPORT_MEDIA_FILESYSTEM)
|
| + else if (type == kFileSystemTypeDeviceMedia)
|
| + return device_media_file_util_.get();
|
| +#endif
|
| else
|
| return isolated_file_util_.get();
|
| }
|
| @@ -95,6 +119,14 @@ IsolatedMountPointProvider::CreateFileSystemOperation(
|
| FileSystemContext* context) const {
|
| scoped_ptr<FileSystemOperationContext> operation_context(
|
| new FileSystemOperationContext(context));
|
| +
|
| +#if defined(SUPPORT_MEDIA_FILESYSTEM)
|
| + if (url.type() == kFileSystemTypeDeviceMedia) {
|
| + // GetDeviceForUrl can return NULL. We will handle in DeviceMediaFileUtil.
|
| + operation_context->set_media_device(GetDeviceForUrl(url, context));
|
| + }
|
| +#endif
|
| +
|
| return new LocalFileSystemOperation(context, operation_context.Pass());
|
| }
|
|
|
|
|