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

Unified Diff: webkit/fileapi/isolated_mount_point_provider.cc

Issue 10781014: Isolated FS for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 5 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/media/device_media_file_util.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 bca05fa9742f93e0be7b880b2749ec10f21979cf..cdd83c9dd53cd09e2c6e922bc7104ac8ded6eeaf 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -21,10 +21,16 @@
#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/media/media_path_filter.h"
#include "webkit/fileapi/media/native_media_file_util.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 {
@@ -33,13 +39,27 @@ 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()
- : media_path_filter_(new MediaPathFilter()),
+IsolatedMountPointProvider::IsolatedMountPointProvider(
+ const FilePath& profile_path)
+ : profile_path_(profile_path),
+ media_path_filter_(new MediaPathFilter()),
isolated_file_util_(new IsolatedFileUtil()),
dragged_file_util_(new DraggedFileUtil()),
native_media_file_util_(new NativeMediaFileUtil()) {
+ // 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() {
@@ -87,8 +107,11 @@ FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil(
return dragged_file_util_.get();
case kFileSystemTypeNativeMedia:
return native_media_file_util_.get();
-
case kFileSystemTypeDeviceMedia:
+#if defined(SUPPORT_MEDIA_FILESYSTEM)
+ return device_media_file_util_.get();
+#endif
+
case kFileSystemTypeTemporary:
case kFileSystemTypePersistent:
case kFileSystemTypeExternal:
@@ -115,6 +138,14 @@ IsolatedMountPointProvider::CreateFileSystemOperation(
if (url.type() == kFileSystemTypeNativeMedia ||
url.type() == kFileSystemTypeDeviceMedia)
operation_context->set_media_path_filter(media_path_filter_.get());
+
+#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());
}
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/media/device_media_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698