diff options
author | tommycli@chromium.org <tommycli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 23:52:53 +0000 |
---|---|---|
committer | tommycli@chromium.org <tommycli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 23:52:53 +0000 |
commit | 0225095a83726fa4d6a942bf6330d0fe7e71e59c (patch) | |
tree | 60888d87d0ef93538793dfb02eebf716def191c4 | |
parent | 4b30e7d3c921e5ce0561fa2f4088c578d05f9bee (diff) | |
download | chromium_src-0225095a83726fa4d6a942bf6330d0fe7e71e59c.zip chromium_src-0225095a83726fa4d6a942bf6330d0fe7e71e59c.tar.gz chromium_src-0225095a83726fa4d6a942bf6330d0fe7e71e59c.tar.bz2 |
Move Media Galleries FileAPI code out of webkit.
BUG=175936
Review URL: https://chromiumcodereview.appspot.com/14247034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196265 0039d316-1c4b-4281-b951-d872f2087c98
50 files changed, 441 insertions, 395 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 39d0c49..af5a007 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -170,6 +170,10 @@ #include "chrome/browser/signin/signin_manager_factory.h" #endif +#if !defined(OS_ANDROID) +#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h" +#endif + using base::FileDescriptor; using content::AccessTokenStore; using content::BrowserChildProcessHostIterator; @@ -2108,6 +2112,15 @@ void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( additional_allowed_schemes->push_back(extensions::kExtensionScheme); } +void ChromeContentBrowserClient::GetAdditionalFileSystemMountPointProviders( + const base::FilePath& storage_partition_path, + ScopedVector<fileapi::FileSystemMountPointProvider>* additional_providers) { +#if !defined(OS_ANDROID) + additional_providers->push_back(new MediaFileSystemMountPointProvider( + storage_partition_path)); +#endif +} + #if defined(OS_POSIX) && !defined(OS_MACOSX) void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( const CommandLine& command_line, diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 9b899a6..4a5f5c6 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -224,6 +224,10 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { content::WebContents* web_contents) OVERRIDE; virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_schemes) OVERRIDE; + virtual void GetAdditionalFileSystemMountPointProviders( + const base::FilePath& storage_partition_path, + ScopedVector<fileapi::FileSystemMountPointProvider>* + additional_providers) OVERRIDE; #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual void GetAdditionalMappedFilesForChildProcess( diff --git a/webkit/fileapi/media/device_media_async_file_util.cc b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc index 2340a19..1c7046c 100644 --- a/webkit/fileapi/media/device_media_async_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc @@ -2,23 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/device_media_async_file_util.h" +#include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" #include "base/callback.h" #include "base/file_util.h" #include "base/single_thread_task_runner.h" +#include "chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h" +#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h" +#include "chrome/browser/media_galleries/fileapi/media_path_filter.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" #include "webkit/fileapi/file_system_context.h" #include "webkit/fileapi/file_system_operation_context.h" #include "webkit/fileapi/file_system_task_runners.h" #include "webkit/fileapi/file_system_url.h" #include "webkit/fileapi/isolated_context.h" -#include "webkit/fileapi/media/filtering_file_enumerator.h" -#include "webkit/fileapi/media/media_file_system_mount_point_provider.h" -#include "webkit/fileapi/media/media_path_filter.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" -#include "webkit/fileapi/media/mtp_device_map_service.h" -namespace fileapi { +using fileapi::FileSystemOperationContext; +using fileapi::FileSystemURL; + +namespace chrome { namespace { @@ -310,7 +313,7 @@ void DeviceMediaAsyncFileUtil::OnDidCreateSnapshotFile( const base::FilePath& platform_path) { if (!callback.is_null()) callback.Run(base::PLATFORM_FILE_OK, file_info, platform_path, - kSnapshotFileTemporary); + fileapi::kSnapshotFileTemporary); } void DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError( @@ -318,7 +321,7 @@ void DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError( base::PlatformFileError error) { if (!callback.is_null()) callback.Run(error, base::PlatformFileInfo(), base::FilePath(), - kSnapshotFileTemporary); + fileapi::kSnapshotFileTemporary); } void DeviceMediaAsyncFileUtil::OnSnapshotFileCreatedRunTask( @@ -347,4 +350,4 @@ void DeviceMediaAsyncFileUtil::OnSnapshotFileCreatedRunTask( callback)); } -} // namespace fileapi +} // namespace chrome diff --git a/webkit/fileapi/media/device_media_async_file_util.h b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h index 2b04329..dde43a8 100644 --- a/webkit/fileapi/media/device_media_async_file_util.h +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h @@ -2,26 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ -#define WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "base/platform_file.h" #include "webkit/fileapi/async_file_util.h" -#include "webkit/storage/webkit_storage_export.h" namespace base { class Time; } namespace fileapi { - class FileSystemOperationContext; class FileSystemURL; +} + +namespace chrome { -class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaAsyncFileUtil - : public AsyncFileUtil { +class DeviceMediaAsyncFileUtil : public fileapi::AsyncFileUtil { public: virtual ~DeviceMediaAsyncFileUtil(); @@ -32,65 +32,65 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaAsyncFileUtil // AsyncFileUtil overrides. virtual bool CreateOrOpen( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) OVERRIDE; virtual bool EnsureFileExists( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const EnsureFileExistsCallback& callback) OVERRIDE; virtual bool CreateDirectory( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; virtual bool GetFileInfo( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual bool ReadDirectory( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; virtual bool Touch( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) OVERRIDE; virtual bool Truncate( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, int64 length, const StatusCallback& callback) OVERRIDE; virtual bool CopyFileLocal( - FileSystemOperationContext* context, - const FileSystemURL& src_url, - const FileSystemURL& dest_url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& src_url, + const fileapi::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual bool MoveFileLocal( - FileSystemOperationContext* context, - const FileSystemURL& src_url, - const FileSystemURL& dest_url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& src_url, + const fileapi::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual bool CopyInForeignFile( - FileSystemOperationContext* context, + fileapi::FileSystemOperationContext* context, const base::FilePath& src_file_path, - const FileSystemURL& dest_url, + const fileapi::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual bool DeleteFile( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual bool DeleteDirectory( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual bool CreateSnapshotFile( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; private: @@ -158,7 +158,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaAsyncFileUtil // path. Forwards the CreateSnapshot request to the delegate to copy the // contents of |device_file_path| to |snapshot_file_path|. void OnSnapshotFileCreatedRunTask( - FileSystemOperationContext* context, + fileapi::FileSystemOperationContext* context, const AsyncFileUtil::CreateSnapshotFileCallback& callback, const base::FilePath& device_file_path, base::FilePath* snapshot_file_path); @@ -172,6 +172,6 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaAsyncFileUtil DISALLOW_COPY_AND_ASSIGN(DeviceMediaAsyncFileUtil); }; -} // namespace fileapi +} // namespace chrome -#endif // WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ diff --git a/webkit/fileapi/media/filtering_file_enumerator.cc b/chrome/browser/media_galleries/fileapi/filtering_file_enumerator.cc index 16ee725..cbb52b3 100644 --- a/webkit/fileapi/media/filtering_file_enumerator.cc +++ b/chrome/browser/media_galleries/fileapi/filtering_file_enumerator.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h" + #include "base/files/file_path.h" #include "base/logging.h" #include "build/build_config.h" -#include "webkit/fileapi/media/filtering_file_enumerator.h" #if defined(OS_WIN) #include <windows.h> @@ -15,7 +16,7 @@ #include "base/string_util.h" #endif -namespace fileapi { +namespace chrome { namespace { @@ -66,7 +67,8 @@ bool ShouldSkip(const base::FilePath& path) { } // namespace FilteringFileEnumerator::FilteringFileEnumerator( - scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> base_enumerator, + scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator> + base_enumerator, MediaPathFilter* filter) : base_enumerator_(base_enumerator.Pass()), filter_(filter) { @@ -102,4 +104,4 @@ bool FilteringFileEnumerator::IsDirectory() { return base_enumerator_->IsDirectory(); } -} // namespace fileapi +} // namespace chrome diff --git a/webkit/fileapi/media/filtering_file_enumerator.h b/chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h index accb2b0..7e17dae 100644 --- a/webkit/fileapi/media/filtering_file_enumerator.h +++ b/chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h @@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_FILTERING_FILE_ENUMERATOR_H_ -#define WEBKIT_FILEAPI_MEDIA_FILTERING_FILE_ENUMERATOR_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILTERING_FILE_ENUMERATOR_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILTERING_FILE_ENUMERATOR_H_ #include "base/memory/scoped_ptr.h" +#include "chrome/browser/media_galleries/fileapi/media_path_filter.h" #include "webkit/fileapi/file_system_file_util.h" -#include "webkit/fileapi/media/media_path_filter.h" -#include "webkit/storage/webkit_storage_export.h" -namespace fileapi { +namespace chrome { // This class wraps another file enumerator and filters out non-media files // from its result, refering given MediaPathFilter. -class WEBKIT_STORAGE_EXPORT FilteringFileEnumerator - : public NON_EXPORTED_BASE(FileSystemFileUtil::AbstractFileEnumerator) { +class FilteringFileEnumerator + : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { public: FilteringFileEnumerator( - scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> base_enumerator, + scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator> + base_enumerator, MediaPathFilter* filter); virtual ~FilteringFileEnumerator(); @@ -29,12 +29,13 @@ class WEBKIT_STORAGE_EXPORT FilteringFileEnumerator private: // The file enumerator to be wrapped. - scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> base_enumerator_; + scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator> + base_enumerator_; // Path filter to filter out non-Media files. MediaPathFilter* filter_; }; -} // namespace fileapi +} // namespace chrome -#endif // WEBKIT_FILEAPI_MEDIA_FILTERING_FILE_ENUMERATOR_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILTERING_FILE_ENUMERATOR_H_ diff --git a/webkit/fileapi/media/media_file_system_mount_point_provider.cc b/chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.cc index d968c0a..6fb69c6 100644 --- a/webkit/fileapi/media/media_file_system_mount_point_provider.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/media_file_system_mount_point_provider.h" +#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h" #include <string> @@ -12,6 +12,8 @@ #include "base/message_loop_proxy.h" #include "base/platform_file.h" #include "base/sequenced_task_runner.h" +#include "chrome/browser/media_galleries/fileapi/media_path_filter.h" +#include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" #include "webkit/blob/local_file_stream_reader.h" #include "webkit/fileapi/async_file_util_adapter.h" #include "webkit/fileapi/copy_or_move_file_validator.h" @@ -26,15 +28,17 @@ #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_path_filter.h" -#include "webkit/fileapi/media/native_media_file_util.h" #include "webkit/fileapi/native_file_util.h" #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) -#include "webkit/fileapi/media/device_media_async_file_util.h" +#include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" #endif -namespace fileapi { +using fileapi::FileSystemContext; +using fileapi::FileSystemType; +using fileapi::FileSystemURL; + +namespace chrome { const char MediaFileSystemMountPointProvider::kMediaPathFilterKey[] = "MediaPathFilterKey"; @@ -46,7 +50,7 @@ MediaFileSystemMountPointProvider::MediaFileSystemMountPointProvider( : profile_path_(profile_path), media_path_filter_(new MediaPathFilter()), native_media_file_util_( - new AsyncFileUtilAdapter(new NativeMediaFileUtil())) { + new fileapi::AsyncFileUtilAdapter(new NativeMediaFileUtil())) { #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) // TODO(kmadhusu): Initialize |device_media_file_util_| in // initialization list. @@ -61,8 +65,8 @@ MediaFileSystemMountPointProvider::~MediaFileSystemMountPointProvider() { bool MediaFileSystemMountPointProvider::CanHandleType( FileSystemType type) const { switch (type) { - case kFileSystemTypeNativeMedia: - case kFileSystemTypeDeviceMedia: + case fileapi::kFileSystemTypeNativeMedia: + case fileapi::kFileSystemTypeDeviceMedia: return true; default: return false; @@ -89,10 +93,10 @@ MediaFileSystemMountPointProvider::GetFileSystemRootPathOnFileThread( return base::FilePath(); } -FileSystemFileUtil* MediaFileSystemMountPointProvider::GetFileUtil( +fileapi::FileSystemFileUtil* MediaFileSystemMountPointProvider::GetFileUtil( FileSystemType type) { switch (type) { - case kFileSystemTypeNativeMedia: + case fileapi::kFileSystemTypeNativeMedia: return native_media_file_util_->sync_file_util(); default: NOTREACHED(); @@ -100,12 +104,12 @@ FileSystemFileUtil* MediaFileSystemMountPointProvider::GetFileUtil( return NULL; } -AsyncFileUtil* MediaFileSystemMountPointProvider::GetAsyncFileUtil( +fileapi::AsyncFileUtil* MediaFileSystemMountPointProvider::GetAsyncFileUtil( FileSystemType type) { switch (type) { - case kFileSystemTypeNativeMedia: + case fileapi::kFileSystemTypeNativeMedia: return native_media_file_util_.get(); - case kFileSystemTypeDeviceMedia: + case fileapi::kFileSystemTypeDeviceMedia: #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) return device_media_async_file_util_.get(); #endif @@ -115,14 +119,14 @@ AsyncFileUtil* MediaFileSystemMountPointProvider::GetAsyncFileUtil( return NULL; } -CopyOrMoveFileValidatorFactory* +fileapi::CopyOrMoveFileValidatorFactory* MediaFileSystemMountPointProvider::GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) { DCHECK(error_code); *error_code = base::PLATFORM_FILE_OK; switch (type) { - case kFileSystemTypeNativeMedia: - case kFileSystemTypeDeviceMedia: + case fileapi::kFileSystemTypeNativeMedia: + case fileapi::kFileSystemTypeDeviceMedia: if (!media_copy_or_move_file_validator_factory_) { *error_code = base::PLATFORM_FILE_ERROR_SECURITY; return NULL; @@ -137,10 +141,10 @@ MediaFileSystemMountPointProvider::GetCopyOrMoveFileValidatorFactory( void MediaFileSystemMountPointProvider::InitializeCopyOrMoveFileValidatorFactory( FileSystemType type, - scoped_ptr<CopyOrMoveFileValidatorFactory> factory) { + scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> factory) { switch (type) { - case kFileSystemTypeNativeMedia: - case kFileSystemTypeDeviceMedia: + case fileapi::kFileSystemTypeNativeMedia: + case fileapi::kFileSystemTypeDeviceMedia: if (!media_copy_or_move_file_validator_factory_) media_copy_or_move_file_validator_factory_.reset(factory.release()); break; @@ -149,32 +153,34 @@ MediaFileSystemMountPointProvider::InitializeCopyOrMoveFileValidatorFactory( } } -FilePermissionPolicy MediaFileSystemMountPointProvider::GetPermissionPolicy( +fileapi::FilePermissionPolicy +MediaFileSystemMountPointProvider::GetPermissionPolicy( const FileSystemURL& url, int permissions) const { // Access to media file systems should be checked using per-filesystem // access permission. - return FILE_PERMISSION_USE_FILESYSTEM_PERMISSION; + return fileapi::FILE_PERMISSION_USE_FILESYSTEM_PERMISSION; } -FileSystemOperation* +fileapi::FileSystemOperation* MediaFileSystemMountPointProvider::CreateFileSystemOperation( const FileSystemURL& url, FileSystemContext* context, base::PlatformFileError* error_code) const { - scoped_ptr<FileSystemOperationContext> operation_context( - new FileSystemOperationContext( + scoped_ptr<fileapi::FileSystemOperationContext> operation_context( + new fileapi::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) { + if (url.type() == fileapi::kFileSystemTypeDeviceMedia) { operation_context->SetUserValue(kMTPDeviceDelegateURLKey, url.filesystem_id()); } #endif - return new LocalFileSystemOperation(context, operation_context.Pass()); + return new fileapi::LocalFileSystemOperation(context, + operation_context.Pass()); } scoped_ptr<webkit_blob::FileStreamReader> @@ -189,16 +195,17 @@ MediaFileSystemMountPointProvider::CreateFileStreamReader( url.path(), offset, expected_modification_time)); } -scoped_ptr<FileStreamWriter> +scoped_ptr<fileapi::FileStreamWriter> MediaFileSystemMountPointProvider::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, FileSystemContext* context) const { - return scoped_ptr<FileStreamWriter>( - new LocalFileStreamWriter(url.path(), offset)); + return scoped_ptr<fileapi::FileStreamWriter>( + new fileapi::LocalFileStreamWriter(url.path(), offset)); } -FileSystemQuotaUtil* MediaFileSystemMountPointProvider::GetQuotaUtil() { +fileapi::FileSystemQuotaUtil* +MediaFileSystemMountPointProvider::GetQuotaUtil() { // No quota support. return NULL; } @@ -212,4 +219,4 @@ void MediaFileSystemMountPointProvider::DeleteFileSystem( callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); } -} // namespace fileapi +} // namespace chrome diff --git a/chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h b/chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h new file mode 100644 index 0000000..27c6004 --- /dev/null +++ b/chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h @@ -0,0 +1,95 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ + +#include "base/memory/scoped_ptr.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h" +#include "webkit/fileapi/file_system_mount_point_provider.h" + +namespace fileapi { +class AsyncFileUtilAdapter; +} + +namespace chrome { + +class MediaPathFilter; + +#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) +class DeviceMediaAsyncFileUtil; +#endif + +class MediaFileSystemMountPointProvider + : public fileapi::FileSystemMountPointProvider { + public: + static const char kMediaPathFilterKey[]; + static const char kMTPDeviceDelegateURLKey[]; + + explicit MediaFileSystemMountPointProvider( + const base::FilePath& profile_path); + virtual ~MediaFileSystemMountPointProvider(); + + // FileSystemMountPointProvider implementation. + virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; + virtual void ValidateFileSystemRoot( + const GURL& origin_url, + fileapi::FileSystemType type, + bool create, + const ValidateFileSystemCallback& callback) OVERRIDE; + virtual base::FilePath GetFileSystemRootPathOnFileThread( + const fileapi::FileSystemURL& url, + bool create) OVERRIDE; + virtual fileapi::FileSystemFileUtil* GetFileUtil( + fileapi::FileSystemType type) OVERRIDE; + virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( + fileapi::FileSystemType type) OVERRIDE; + virtual fileapi::CopyOrMoveFileValidatorFactory* + GetCopyOrMoveFileValidatorFactory( + fileapi::FileSystemType type, + base::PlatformFileError* error_code) OVERRIDE; + virtual void InitializeCopyOrMoveFileValidatorFactory( + fileapi::FileSystemType type, + scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> factory) OVERRIDE; + virtual fileapi::FilePermissionPolicy GetPermissionPolicy( + const fileapi::FileSystemURL& url, int permissions) const OVERRIDE; + virtual fileapi::FileSystemOperation* CreateFileSystemOperation( + const fileapi::FileSystemURL& url, + fileapi::FileSystemContext* context, + base::PlatformFileError* error_code) const OVERRIDE; + virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + const fileapi::FileSystemURL& url, + int64 offset, + const base::Time& expected_modification_time, + fileapi::FileSystemContext* context) const OVERRIDE; + virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( + const fileapi::FileSystemURL& url, + int64 offset, + fileapi::FileSystemContext* context) const OVERRIDE; + virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; + virtual void DeleteFileSystem( + const GURL& origin_url, + fileapi::FileSystemType type, + fileapi::FileSystemContext* context, + const DeleteFileSystemCallback& callback) OVERRIDE; + + private: + // Store the profile path. We need this to create temporary snapshot files. + const base::FilePath profile_path_; + + scoped_ptr<MediaPathFilter> media_path_filter_; + scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> + media_copy_or_move_file_validator_factory_; + + scoped_ptr<fileapi::AsyncFileUtilAdapter> native_media_file_util_; +#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) + scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_; +#endif + + DISALLOW_COPY_AND_ASSIGN(MediaFileSystemMountPointProvider); +}; + +} // namespace chrome + +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ diff --git a/webkit/fileapi/media/media_path_filter.cc b/chrome/browser/media_galleries/fileapi/media_path_filter.cc index c9a0a81..98f281b 100644 --- a/webkit/fileapi/media/media_path_filter.cc +++ b/chrome/browser/media_galleries/fileapi/media_path_filter.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/media_path_filter.h" +#include "chrome/browser/media_galleries/fileapi/media_path_filter.h" #include <algorithm> #include <string> @@ -10,7 +10,7 @@ #include "base/string_util.h" #include "net/base/mime_util.h" -namespace fileapi { +namespace chrome { namespace { @@ -79,4 +79,4 @@ void MediaPathFilter::EnsureInitialized() { initialized_ = true; } -} // namespace fileapi +} // namespace chrome diff --git a/webkit/fileapi/media/media_path_filter.h b/chrome/browser/media_galleries/fileapi/media_path_filter.h index c36a4fb..c74d4d3 100644 --- a/webkit/fileapi/media/media_path_filter.h +++ b/chrome/browser/media_galleries/fileapi/media_path_filter.h @@ -2,24 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_MEDIA_PATH_FILTER_H_ -#define WEBKIT_FILEAPI_MEDIA_MEDIA_PATH_FILTER_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_ #include <vector> #include "base/files/file_path.h" #include "base/synchronization/lock.h" -#include "webkit/storage/webkit_storage_export.h" namespace base { class FilePath; } -namespace fileapi { +namespace chrome { // This class holds the list of file path extensions that we should expose on // media filesystem. -class WEBKIT_STORAGE_EXPORT MediaPathFilter { +class MediaPathFilter { public: MediaPathFilter(); ~MediaPathFilter(); @@ -37,6 +36,6 @@ class WEBKIT_STORAGE_EXPORT MediaPathFilter { DISALLOW_COPY_AND_ASSIGN(MediaPathFilter); }; -} // namespace fileapi +} // namespace chrome -#endif // WEBKIT_FILEAPI_MEDIA_MEDIA_PATH_FILTER_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_ diff --git a/webkit/fileapi/media/mtp_device_async_delegate.h b/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h index 4140c37..ba07d37 100644 --- a/webkit/fileapi/media/mtp_device_async_delegate.h +++ b/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_ -#define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ #include "base/callback.h" #include "base/memory/ref_counted.h" @@ -14,7 +14,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace chrome { // Asynchronous delegate for media transfer protocol (MTP) device to perform // media device isolated file system operations. Class that implements this @@ -30,7 +30,7 @@ class MTPDeviceAsyncDelegate { // A callback to be called when ReadDirectory method call succeeds. typedef base::Callback< - void(const AsyncFileUtil::EntryList& file_list, + void(const fileapi::AsyncFileUtil::EntryList& file_list, bool has_more)> ReadDirectorySuccessCallback; // A callback to be called when GetFileInfo/ReadDirectory/CreateSnapshot @@ -80,6 +80,6 @@ class MTPDeviceAsyncDelegate { virtual ~MTPDeviceAsyncDelegate() {} }; -} // namespace fileapi +} // namespace chrome -#endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ diff --git a/webkit/fileapi/media/mtp_device_file_system_config.h b/chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h index 32d5103..1877de8 100644 --- a/webkit/fileapi/media/mtp_device_file_system_config.h +++ b/chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_FILE_SYSTEM_CONFIG_H_ -#define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_FILE_SYSTEM_CONFIG_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_FILE_SYSTEM_CONFIG_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_FILE_SYSTEM_CONFIG_H_ #include "build/build_config.h" @@ -14,4 +14,4 @@ #define SUPPORT_MTP_DEVICE_FILESYSTEM #endif -#endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_FILE_SYSTEM_CONFIG_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_FILE_SYSTEM_CONFIG_H_ diff --git a/webkit/fileapi/media/mtp_device_map_service.cc b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc index a4c4bea..96c5b85 100644 --- a/webkit/fileapi/media/mtp_device_map_service.cc +++ b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/mtp_device_map_service.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" #include <string> #include <utility> #include "base/stl_util.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" #include "webkit/fileapi/isolated_context.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" -namespace fileapi { +namespace chrome { namespace { @@ -52,8 +52,8 @@ MTPDeviceAsyncDelegate* MTPDeviceMapService::GetMTPDeviceAsyncDelegate( const std::string& filesystem_id) { DCHECK(thread_checker_.CalledOnValidThread()); base::FilePath device_path; - if (!IsolatedContext::GetInstance()->GetRegisteredPath(filesystem_id, - &device_path)) { + if (!fileapi::IsolatedContext::GetInstance()->GetRegisteredPath( + filesystem_id, &device_path)) { return NULL; } @@ -70,4 +70,4 @@ MTPDeviceMapService::MTPDeviceMapService() { MTPDeviceMapService::~MTPDeviceMapService() {} -} // namespace fileapi +} // namespace chrome diff --git a/webkit/fileapi/media/mtp_device_map_service.h b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.h index de24ee2..18b974f5 100644 --- a/webkit/fileapi/media/mtp_device_map_service.h +++ b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.h @@ -2,24 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_MAP_SERVICE_H_ -#define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_MAP_SERVICE_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ #include <map> #include "base/files/file_path.h" #include "base/lazy_instance.h" #include "base/threading/thread_checker.h" -#include "webkit/storage/webkit_storage_export.h" -namespace fileapi { +namespace chrome { class MTPDeviceAsyncDelegate; // This class provides media transfer protocol (MTP) device delegate to // complete media file system operations. ScopedMTPDeviceMapEntry class // manages the device map entries. -class WEBKIT_STORAGE_EXPORT MTPDeviceMapService { +class MTPDeviceMapService { public: static MTPDeviceMapService* GetInstance(); @@ -67,6 +66,6 @@ class WEBKIT_STORAGE_EXPORT MTPDeviceMapService { DISALLOW_COPY_AND_ASSIGN(MTPDeviceMapService); }; -} // namespace fileapi +} // namespace chrome -#endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_MAP_SERVICE_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ diff --git a/webkit/fileapi/media/native_media_file_util.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc index fa5087d..19724f9 100644 --- a/webkit/fileapi/media/native_media_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc @@ -2,19 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/native_media_file_util.h" +#include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" +#include "chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h" +#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h" +#include "chrome/browser/media_galleries/fileapi/media_path_filter.h" #include "webkit/fileapi/file_system_operation_context.h" -#include "webkit/fileapi/media/filtering_file_enumerator.h" -#include "webkit/fileapi/media/media_file_system_mount_point_provider.h" -#include "webkit/fileapi/media/media_path_filter.h" #include "webkit/fileapi/native_file_util.h" using base::PlatformFile; using base::PlatformFileError; using base::PlatformFileInfo; +using fileapi::FileSystemOperationContext; +using fileapi::FileSystemURL; +using fileapi::NativeFileUtil; -namespace fileapi { +namespace chrome { namespace { @@ -48,7 +51,7 @@ PlatformFileError NativeMediaFileUtil::EnsureFileExists( return NativeFileUtil::EnsureFileExists(file_path, created); } -scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> +scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator> NativeMediaFileUtil::CreateFileEnumerator( FileSystemOperationContext* context, const FileSystemURL& root_url) { @@ -223,4 +226,4 @@ NativeMediaFileUtil::GetFilteredLocalFilePathForExistingFileOrDirectory( return base::PLATFORM_FILE_OK; } -} // namespace fileapi +} // namespace chrome diff --git a/webkit/fileapi/media/native_media_file_util.h b/chrome/browser/media_galleries/fileapi/native_media_file_util.h index 0b957c3..aa4ee62 100644 --- a/webkit/fileapi/media/native_media_file_util.h +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.h @@ -2,59 +2,57 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ -#define WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_ #include "base/memory/scoped_ptr.h" #include "webkit/fileapi/isolated_file_util.h" -#include "webkit/storage/webkit_storage_export.h" -namespace fileapi { +namespace chrome { // This class handles native file system operations with media type filtering -// which is passed to each method via FileSystemOperationContext as +// which is passed to each method via fileapi::FileSystemOperationContext as // MediaPathFilter. -class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil - : public IsolatedFileUtil { +class NativeMediaFileUtil : public fileapi::IsolatedFileUtil { public: NativeMediaFileUtil(); virtual base::PlatformFileError CreateOrOpen( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, int file_flags, base::PlatformFile* file_handle, bool* created) OVERRIDE; virtual base::PlatformFileError EnsureFileExists( - FileSystemOperationContext* context, - const FileSystemURL& url, bool* created) OVERRIDE; + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, bool* created) OVERRIDE; virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( - FileSystemOperationContext* context, - const FileSystemURL& root_url) OVERRIDE; + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& root_url) OVERRIDE; virtual base::PlatformFileError Touch( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time) OVERRIDE; virtual base::PlatformFileError Truncate( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, int64 length) OVERRIDE; virtual base::PlatformFileError CopyOrMoveFile( - FileSystemOperationContext* context, - const FileSystemURL& src_url, - const FileSystemURL& dest_url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& src_url, + const fileapi::FileSystemURL& dest_url, bool copy) OVERRIDE; virtual base::PlatformFileError CopyInForeignFile( - FileSystemOperationContext* context, + fileapi::FileSystemOperationContext* context, const base::FilePath& src_file_path, - const FileSystemURL& dest_url) OVERRIDE; + const fileapi::FileSystemURL& dest_url) OVERRIDE; virtual base::PlatformFileError DeleteFile( - FileSystemOperationContext* context, - const FileSystemURL& url) OVERRIDE; + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url) OVERRIDE; virtual base::PlatformFileError GetFileInfo( - FileSystemOperationContext* context, - const FileSystemURL& url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& url, base::PlatformFileInfo* file_info, base::FilePath* platform_path) OVERRIDE; @@ -63,8 +61,8 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil // consideration. If the media_path_filter() check fails, return // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist. base::PlatformFileError GetFilteredLocalFilePath( - FileSystemOperationContext* context, - const FileSystemURL& file_system_url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& file_system_url, base::FilePath* local_file_path); // Like GetLocalFilePath(), but if the file does not exist, then return @@ -74,14 +72,14 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE NativeMediaFileUtil // If the media_path_filter() check fails, return |failure_error|. // If |local_file_path| is a directory, return PLATFORM_FILE_OK. base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory( - FileSystemOperationContext* context, - const FileSystemURL& file_system_url, + fileapi::FileSystemOperationContext* context, + const fileapi::FileSystemURL& file_system_url, base::PlatformFileError failure_error, base::FilePath* local_file_path); DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil); }; -} // namespace fileapi +} // namespace chrome -#endif // WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_ diff --git a/webkit/fileapi/media/native_media_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc index c6fcfc2..32de0e4 100644 --- a/webkit/fileapi/media/native_media_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc @@ -11,6 +11,8 @@ #include "base/message_loop.h" #include "base/stringprintf.h" #include "base/time.h" +#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h" +#include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/fileapi/external_mount_points.h" #include "webkit/fileapi/file_system_context.h" @@ -19,14 +21,16 @@ #include "webkit/fileapi/file_system_task_runners.h" #include "webkit/fileapi/file_system_url.h" #include "webkit/fileapi/isolated_context.h" -#include "webkit/fileapi/media/native_media_file_util.h" #include "webkit/fileapi/mock_file_system_options.h" #include "webkit/fileapi/native_file_util.h" #include "webkit/quota/mock_special_storage_policy.h" #define FPL(x) FILE_PATH_LITERAL(x) -namespace fileapi { +using fileapi::FileSystemOperation; +using fileapi::FileSystemURL; + +namespace chrome { namespace { @@ -91,7 +95,7 @@ void PopulateDirectoryWithTestCases(const base::FilePath& dir, } else { bool created = false; ASSERT_EQ(base::PLATFORM_FILE_OK, - NativeFileUtil::EnsureFileExists(path, &created)); + fileapi::NativeFileUtil::EnsureFileExists(path, &created)); ASSERT_TRUE(created); } } @@ -112,20 +116,25 @@ class NativeMediaFileUtilTest : public testing::Test { scoped_refptr<quota::SpecialStoragePolicy> storage_policy = new quota::MockSpecialStoragePolicy(); + ScopedVector<fileapi::FileSystemMountPointProvider> additional_providers; + additional_providers.push_back(new MediaFileSystemMountPointProvider( + data_dir_.path())); + file_system_context_ = - new FileSystemContext( - FileSystemTaskRunners::CreateMockTaskRunners(), - ExternalMountPoints::CreateRefCounted().get(), + new fileapi::FileSystemContext( + fileapi::FileSystemTaskRunners::CreateMockTaskRunners(), + fileapi::ExternalMountPoints::CreateRefCounted().get(), storage_policy, NULL, - ScopedVector<FileSystemMountPointProvider>(), + additional_providers.Pass(), data_dir_.path(), - CreateAllowFileAccessOptions()); + fileapi::CreateAllowFileAccessOptions()); - file_util_ = file_system_context_->GetFileUtil(kFileSystemTypeNativeMedia); + file_util_ = file_system_context_->GetFileUtil( + fileapi::kFileSystemTypeNativeMedia); filesystem_id_ = isolated_context()->RegisterFileSystemForPath( - kFileSystemTypeNativeMedia, root_path(), NULL); + fileapi::kFileSystemTypeNativeMedia, root_path(), NULL); isolated_context()->AddReference(filesystem_id_); } @@ -136,7 +145,7 @@ class NativeMediaFileUtilTest : public testing::Test { } protected: - FileSystemContext* file_system_context() { + fileapi::FileSystemContext* file_system_context() { return file_system_context_.get(); } @@ -147,21 +156,22 @@ class NativeMediaFileUtilTest : public testing::Test { GetVirtualPath(test_case_path)); } - IsolatedContext* isolated_context() { - return IsolatedContext::GetInstance(); + fileapi::IsolatedContext* isolated_context() { + return fileapi::IsolatedContext::GetInstance(); } base::FilePath root_path() { return data_dir_.path().Append(FPL("Media Directory")); } - base::FilePath GetVirtualPath(const base::FilePath::CharType* test_case_path) { + base::FilePath GetVirtualPath( + const base::FilePath::CharType* test_case_path) { return base::FilePath::FromUTF8Unsafe(filesystem_id_). Append(FPL("Media Directory")). Append(base::FilePath(test_case_path)); } - FileSystemFileUtil* file_util() { + fileapi::FileSystemFileUtil* file_util() { return file_util_; } @@ -170,7 +180,7 @@ class NativeMediaFileUtilTest : public testing::Test { } fileapi::FileSystemType type() { - return kFileSystemTypeNativeMedia; + return fileapi::kFileSystemTypeNativeMedia; } FileSystemOperation* NewOperation(const FileSystemURL& url) { @@ -181,9 +191,9 @@ class NativeMediaFileUtilTest : public testing::Test { MessageLoop message_loop_; base::ScopedTempDir data_dir_; - scoped_refptr<FileSystemContext> file_system_context_; + scoped_refptr<fileapi::FileSystemContext> file_system_context_; - FileSystemFileUtil* file_util_; + fileapi::FileSystemFileUtil* file_util_; std::string filesystem_id_; DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtilTest); @@ -233,7 +243,8 @@ TEST_F(NativeMediaFileUtilTest, ReadDirectoryFiltering) { for (size_t i = 0; i < arraysize(kFilteringTestCases); ++i) { base::FilePath::StringType name = base::FilePath(kFilteringTestCases[i].path).BaseName().value(); - std::set<base::FilePath::StringType>::const_iterator found = content.find(name); + std::set<base::FilePath::StringType>::const_iterator found = + content.find(name); EXPECT_EQ(kFilteringTestCases[i].visible, found != content.end()); } } @@ -600,4 +611,4 @@ TEST_F(NativeMediaFileUtilTest, TouchFileFiltering) { } } -} // namespace fileapi +} // namespace chrome diff --git a/webkit/fileapi/media/picasa/pmp_column_reader.cc b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.cc index 3f6bcc4..bdfea21 100644 --- a/webkit/fileapi/media/picasa/pmp_column_reader.cc +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/picasa/pmp_column_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h" #include <cstring> diff --git a/webkit/fileapi/media/picasa/pmp_column_reader.h b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h index 8594463..280b91c 100644 --- a/webkit/fileapi/media/picasa/pmp_column_reader.h +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h @@ -2,16 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_COLUMN_READER_H_ -#define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_COLUMN_READER_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_COLUMN_READER_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_COLUMN_READER_H_ #include <string> #include <vector> #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" -#include "webkit/fileapi/media/picasa/pmp_constants.h" -#include "webkit/storage/webkit_storage_export.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h" namespace base { class FilePath; @@ -20,7 +19,7 @@ class FilePath; namespace picasaimport { // Reads a single PMP column from a file. -class WEBKIT_STORAGE_EXPORT_PRIVATE PmpColumnReader { +class PmpColumnReader { public: PmpColumnReader(); virtual ~PmpColumnReader(); @@ -64,4 +63,4 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE PmpColumnReader { } // namespace picasaimport -#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_COLUMN_READER_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_COLUMN_READER_H_ diff --git a/webkit/fileapi/media/picasa/pmp_column_reader_unittest.cc b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader_unittest.cc index 556cc6b..3646113 100644 --- a/webkit/fileapi/media/picasa/pmp_column_reader_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader_unittest.cc @@ -6,10 +6,10 @@ #include <vector> #include "base/file_util.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/fileapi/media/picasa/pmp_column_reader.h" -#include "webkit/fileapi/media/picasa/pmp_constants.h" -#include "webkit/fileapi/media/picasa/pmp_test_helper.h" namespace { diff --git a/webkit/fileapi/media/picasa/pmp_constants.h b/chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h index 52013b3..521c31a 100644 --- a/webkit/fileapi/media/picasa/pmp_constants.h +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_CONSTANTS_H_ -#define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_CONSTANTS_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_CONSTANTS_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_CONSTANTS_H_ #include <string> @@ -43,4 +43,4 @@ enum PmpFieldType { } // namespace picasaimport -#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_CONSTANTS_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_CONSTANTS_H_ diff --git a/webkit/fileapi/media/picasa/pmp_table_reader.cc b/chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader.cc index c8f76d4..6a510b6 100644 --- a/webkit/fileapi/media/picasa/pmp_table_reader.cc +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/picasa/pmp_table_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader.h" #include <algorithm> @@ -10,8 +10,8 @@ #include "base/files/file_path.h" #include "base/logging.h" #include "base/utf_string_conversions.h" -#include "webkit/fileapi/media/picasa/pmp_column_reader.h" -#include "webkit/fileapi/media/picasa/pmp_constants.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h" namespace picasaimport { diff --git a/webkit/fileapi/media/picasa/pmp_table_reader.h b/chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader.h index de2627f..3cee4f7 100644 --- a/webkit/fileapi/media/picasa/pmp_table_reader.h +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader.h @@ -2,14 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ -#define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_TABLE_READER_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_TABLE_READER_H_ #include <string> #include "base/basictypes.h" #include "base/memory/scoped_vector.h" -#include "webkit/storage/webkit_storage_export.h" namespace base { class FilePath; @@ -19,7 +18,7 @@ namespace picasaimport { class PmpColumnReader; -class WEBKIT_STORAGE_EXPORT_PRIVATE PmpTableReader { +class PmpTableReader { public: PmpTableReader(); @@ -45,4 +44,4 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE PmpTableReader { } // namespace picasaimport -#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TABLE_READER_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_TABLE_READER_H_ diff --git a/webkit/fileapi/media/picasa/pmp_table_reader_unittest.cc b/chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader_unittest.cc index 66d3fa1..dd6ece7 100644 --- a/webkit/fileapi/media/picasa/pmp_table_reader_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader_unittest.cc @@ -7,11 +7,11 @@ #include "base/file_util.h" #include "base/utf_string_conversions.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_table_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/fileapi/media/picasa/pmp_column_reader.h" -#include "webkit/fileapi/media/picasa/pmp_constants.h" -#include "webkit/fileapi/media/picasa/pmp_table_reader.h" -#include "webkit/fileapi/media/picasa/pmp_test_helper.h" namespace { diff --git a/webkit/fileapi/media/picasa/pmp_test_helper.cc b/chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.cc index 69f92ee..f426d96 100644 --- a/webkit/fileapi/media/picasa/pmp_test_helper.cc +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/media/picasa/pmp_test_helper.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.h" #include <algorithm> #include <iterator> @@ -10,7 +10,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/utf_string_conversions.h" -#include "webkit/fileapi/media/picasa/pmp_column_reader.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_column_reader.h" namespace picasaimport { @@ -37,7 +37,7 @@ template<> std::vector<uint8> Flatten(const std::vector<std::string>& strings) { std::vector<uint8> totalchars; - for(std::vector<std::string>::const_iterator it = strings.begin(); + for (std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) { std::copy(it->begin(), it->end(), std::back_inserter(totalchars)); totalchars.push_back('\0'); // Add the null termination too. diff --git a/webkit/fileapi/media/picasa/pmp_test_helper.h b/chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.h index 2da2118..d675773 100644 --- a/webkit/fileapi/media/picasa/pmp_test_helper.h +++ b/chrome/browser/media_galleries/fileapi/picasa/pmp_test_helper.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ -#define WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ +#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_TEST_HELPER_H_ +#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_TEST_HELPER_H_ #include <vector> #include "base/basictypes.h" #include "base/files/scoped_temp_dir.h" -#include "webkit/fileapi/media/picasa/pmp_constants.h" +#include "chrome/browser/media_galleries/fileapi/picasa/pmp_constants.h" namespace base { class FilePath; @@ -52,4 +52,4 @@ class PmpTestHelper { } // namespace picasaimport -#endif // WEBKIT_FILEAPI_MEDIA_PICASA_PMP_TEST_HELPER_H_ +#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PMP_TEST_HELPER_H_ diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h index 01bc9d1..7483b17 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h +++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h @@ -12,9 +12,9 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/platform_file.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" #include "webkit/fileapi/async_file_util.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" namespace base { class FilePath; @@ -30,7 +30,7 @@ struct SnapshotRequestInfo; // MTPDeviceDelegateImplLinux lives on the IO thread. // MTPDeviceDelegateImplLinux does a call-and-reply to the UI thread // to dispatch the requests to MediaTransferProtocolManager. -class MTPDeviceDelegateImplLinux : public fileapi::MTPDeviceAsyncDelegate { +class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { private: friend void CreateMTPDeviceAsyncDelegate( const std::string&, diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h index d817212..f1389fe 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h @@ -12,9 +12,9 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/platform_file.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" #include "device/media_transfer_protocol/mtp_file_entry.pb.h" #include "webkit/fileapi/async_file_util.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" namespace chrome { @@ -31,13 +31,13 @@ class MTPDeviceTaskHelper { public: typedef base::Callback<void(bool succeeded)> OpenStorageCallback; - typedef fileapi::MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback + typedef MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback GetFileInfoSuccessCallback; typedef base::Callback<void(const fileapi::AsyncFileUtil::EntryList&)> ReadDirectorySuccessCallback; - typedef fileapi::MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; + typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; MTPDeviceTaskHelper(); ~MTPDeviceTaskHelper(); diff --git a/chrome/browser/media_galleries/linux/snapshot_file_details.cc b/chrome/browser/media_galleries/linux/snapshot_file_details.cc index 2d85ccb..8f2e709 100644 --- a/chrome/browser/media_galleries/linux/snapshot_file_details.cc +++ b/chrome/browser/media_galleries/linux/snapshot_file_details.cc @@ -15,9 +15,9 @@ namespace chrome { SnapshotRequestInfo::SnapshotRequestInfo( const std::string& device_file_path, const base::FilePath& snapshot_file_path, - const fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& + const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& success_callback, - const fileapi::MTPDeviceAsyncDelegate::ErrorCallback& error_callback) + const MTPDeviceAsyncDelegate::ErrorCallback& error_callback) : device_file_path(device_file_path), snapshot_file_path(snapshot_file_path), success_callback(success_callback), diff --git a/chrome/browser/media_galleries/linux/snapshot_file_details.h b/chrome/browser/media_galleries/linux/snapshot_file_details.h index c2157fc..e358b39 100644 --- a/chrome/browser/media_galleries/linux/snapshot_file_details.h +++ b/chrome/browser/media_galleries/linux/snapshot_file_details.h @@ -11,7 +11,7 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/platform_file.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" namespace chrome { @@ -20,9 +20,9 @@ struct SnapshotRequestInfo { SnapshotRequestInfo( const std::string& device_file_path, const base::FilePath& snapshot_file_path, - const fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& + const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& success_callback, - const fileapi::MTPDeviceAsyncDelegate::ErrorCallback& error_callback); + const MTPDeviceAsyncDelegate::ErrorCallback& error_callback); ~SnapshotRequestInfo(); // MTP device file path. @@ -32,11 +32,11 @@ struct SnapshotRequestInfo { const base::FilePath snapshot_file_path; // A callback to be called when CreateSnapshotFile() succeeds. - const fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback + const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback success_callback; // A callback to be called when CreateSnapshotFile() fails. - const fileapi::MTPDeviceAsyncDelegate::ErrorCallback error_callback; + const MTPDeviceAsyncDelegate::ErrorCallback error_callback; }; // SnapshotFileDetails tracks the current state of the snapshot file (e.g how @@ -65,12 +65,12 @@ class SnapshotFileDetails { return file_info_; } - const fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback + const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback success_callback() const { return request_info_.success_callback; } - const fileapi::MTPDeviceAsyncDelegate::ErrorCallback error_callback() const { + const MTPDeviceAsyncDelegate::ErrorCallback error_callback() const { return request_info_.error_callback; } diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h index 201b314..bc3ac6f 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h @@ -13,7 +13,7 @@ #include "base/hash_tables.h" #include "base/memory/weak_ptr.h" #include "base/platform_file.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" namespace chrome { @@ -26,7 +26,7 @@ namespace chrome { // on any thread, but then mutates all state on the UI thread. The async // delegate interface can be invoked on any thread, as it simply forwards calls // to the UI thread. -class MTPDeviceDelegateImplMac : public fileapi::MTPDeviceAsyncDelegate { +class MTPDeviceDelegateImplMac : public MTPDeviceAsyncDelegate { public: MTPDeviceDelegateImplMac(const std::string& device_id, const base::FilePath::StringType& synthetic_path); diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm index 5f9a719..4a1de47 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm @@ -19,7 +19,6 @@ namespace { int kReadDirectoryTimeLimitSeconds = 20; -using fileapi::MTPDeviceAsyncDelegate; typedef MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback CreateSnapshotFileSuccessCallback; typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; diff --git a/chrome/browser/media_galleries/media_file_system_context.h b/chrome/browser/media_galleries/media_file_system_context.h index ccc0371..eebcd2d 100644 --- a/chrome/browser/media_galleries/media_file_system_context.h +++ b/chrome/browser/media_galleries/media_file_system_context.h @@ -10,8 +10,8 @@ #include <string> #include "base/memory/ref_counted.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h" #include "chrome/browser/media_galleries/scoped_mtp_device_map_entry.h" -#include "webkit/fileapi/media/mtp_device_file_system_config.h" namespace base { class FilePath; diff --git a/chrome/browser/media_galleries/media_file_system_registry.h b/chrome/browser/media_galleries/media_file_system_registry.h index 7ce269a..6843c3a 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.h +++ b/chrome/browser/media_galleries/media_file_system_registry.h @@ -17,9 +17,9 @@ #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/prefs/pref_change_registrar.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/storage_monitor/removable_storage_observer.h" -#include "webkit/fileapi/media/mtp_device_file_system_config.h" #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" diff --git a/chrome/browser/media_galleries/mtp_device_delegate_impl.h b/chrome/browser/media_galleries/mtp_device_delegate_impl.h index 632c024..3490c6e 100644 --- a/chrome/browser/media_galleries/mtp_device_delegate_impl.h +++ b/chrome/browser/media_galleries/mtp_device_delegate_impl.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_H_ #define CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_H_ -#include "webkit/fileapi/media/mtp_device_file_system_config.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h" #if !defined(SUPPORT_MTP_DEVICE_FILESYSTEM) #error "Media file system is not supported for this platform." @@ -13,7 +13,7 @@ #include "base/callback_forward.h" #include "base/files/file_path.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" namespace base { class SequencedTaskRunner; @@ -21,7 +21,7 @@ class SequencedTaskRunner; namespace chrome { -typedef base::Callback<void(fileapi::MTPDeviceAsyncDelegate*)> +typedef base::Callback<void(MTPDeviceAsyncDelegate*)> CreateMTPDeviceAsyncDelegateCallback; void CreateMTPDeviceAsyncDelegate( diff --git a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc index b91d641..2444f0a 100644 --- a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc +++ b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.cc @@ -4,15 +4,16 @@ #include "chrome/browser/media_galleries/scoped_mtp_device_map_entry.h" -#include "webkit/fileapi/media/mtp_device_file_system_config.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_file_system_config.h" #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) #include "base/bind.h" #include "base/threading/sequenced_worker_pool.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" #include "content/public/browser/browser_thread.h" #include "webkit/fileapi/file_system_task_runners.h" -#include "webkit/fileapi/media/mtp_device_map_service.h" + #endif namespace chrome { @@ -37,7 +38,7 @@ scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() { void OnDeviceAsyncDelegateDestroyed( const base::FilePath::StringType& device_location) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); - fileapi::MTPDeviceMapService::GetInstance()->RemoveAsyncDelegate( + MTPDeviceMapService::GetInstance()->RemoveAsyncDelegate( device_location); } @@ -82,10 +83,10 @@ ScopedMTPDeviceMapEntry::~ScopedMTPDeviceMapEntry() { } void ScopedMTPDeviceMapEntry::OnMTPDeviceAsyncDelegateCreated( - fileapi::MTPDeviceAsyncDelegate* delegate) { + MTPDeviceAsyncDelegate* delegate) { #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); - fileapi::MTPDeviceMapService::GetInstance()->AddAsyncDelegate( + MTPDeviceMapService::GetInstance()->AddAsyncDelegate( device_location_, delegate); #endif } diff --git a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h index 8cf24a2..abcf042 100644 --- a/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h +++ b/chrome/browser/media_galleries/scoped_mtp_device_map_entry.h @@ -15,12 +15,10 @@ #include "base/sequenced_task_runner_helpers.h" #include "content/public/browser/browser_thread.h" -namespace fileapi { -class MTPDeviceAsyncDelegate; -} - namespace chrome { +class MTPDeviceAsyncDelegate; + class ScopedMTPDeviceMapEntry : public base::RefCountedThreadSafe< ScopedMTPDeviceMapEntry, content::BrowserThread::DeleteOnUIThread> { @@ -50,8 +48,7 @@ class ScopedMTPDeviceMapEntry // Callback to add the managed MTPDeviceAsyncDelegate to the // MTPDeviceMapService on the IO thread. - void OnMTPDeviceAsyncDelegateCreated( - fileapi::MTPDeviceAsyncDelegate* delegate); + void OnMTPDeviceAsyncDelegateCreated(MTPDeviceAsyncDelegate* delegate); // The MTP or PTP device location. const base::FilePath::StringType device_location_; diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h index cdd6bdf..afae427 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h @@ -14,9 +14,9 @@ #include "base/platform_file.h" #include "base/string16.h" #include "base/win/scoped_comptr.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" #include "webkit/fileapi/async_file_util.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" namespace base { class FilePath; @@ -36,7 +36,7 @@ struct SnapshotRequestInfo; // is instantiated per MTP device storage partition using // CreateMTPDeviceAsyncDelegate(). MTPDeviceDelegateImplWin lives on the IO // thread. -class MTPDeviceDelegateImplWin : public fileapi::MTPDeviceAsyncDelegate { +class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { public: // Structure used to represent MTP device storage partition details. struct StorageDeviceInfo { diff --git a/chrome/browser/media_galleries/win/snapshot_file_details.cc b/chrome/browser/media_galleries/win/snapshot_file_details.cc index 6b69418..073c97d 100644 --- a/chrome/browser/media_galleries/win/snapshot_file_details.cc +++ b/chrome/browser/media_galleries/win/snapshot_file_details.cc @@ -8,8 +8,6 @@ namespace chrome { -using fileapi::MTPDeviceAsyncDelegate; - /////////////////////////////////////////////////////////////////////////////// // SnapshotRequestInfo // /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/media_galleries/win/snapshot_file_details.h b/chrome/browser/media_galleries/win/snapshot_file_details.h index d6f00ea..7c39ea3 100644 --- a/chrome/browser/media_galleries/win/snapshot_file_details.h +++ b/chrome/browser/media_galleries/win/snapshot_file_details.h @@ -8,7 +8,7 @@ #include "base/files/file_path.h" #include "base/platform_file.h" #include "base/win/scoped_comptr.h" -#include "webkit/fileapi/media/mtp_device_async_delegate.h" +#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" namespace chrome { @@ -17,9 +17,9 @@ struct SnapshotRequestInfo { SnapshotRequestInfo( const base::FilePath& device_file_path, const base::FilePath& snapshot_file_path, - const fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& + const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& success_callback, - const fileapi::MTPDeviceAsyncDelegate::ErrorCallback& error_callback); + const MTPDeviceAsyncDelegate::ErrorCallback& error_callback); // Device file path. base::FilePath device_file_path; @@ -28,11 +28,11 @@ struct SnapshotRequestInfo { base::FilePath snapshot_file_path; // A callback to be called when CreateSnapshotFile() succeeds. - fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback + MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback success_callback; // A callback to be called when CreateSnapshotFile() fails. - fileapi::MTPDeviceAsyncDelegate::ErrorCallback error_callback; + MTPDeviceAsyncDelegate::ErrorCallback error_callback; }; // Provides the details for the the creation of snapshot file. diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index e06ec74..c53458a 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -924,6 +924,20 @@ 'browser/media/media_stream_devices_controller.h', 'browser/media/media_stream_infobar_delegate.cc', 'browser/media/media_stream_infobar_delegate.h', + 'browser/media_galleries/fileapi/filtering_file_enumerator.cc', + 'browser/media_galleries/fileapi/filtering_file_enumerator.h', + 'browser/media_galleries/fileapi/media_file_system_mount_point_provider.cc', + 'browser/media_galleries/fileapi/media_file_system_mount_point_provider.h', + 'browser/media_galleries/fileapi/media_path_filter.cc', + 'browser/media_galleries/fileapi/media_path_filter.h', + 'browser/media_galleries/fileapi/mtp_device_file_system_config.h', + 'browser/media_galleries/fileapi/native_media_file_util.cc', + 'browser/media_galleries/fileapi/native_media_file_util.h', + 'browser/media_galleries/fileapi/picasa/pmp_column_reader.cc', + 'browser/media_galleries/fileapi/picasa/pmp_column_reader.h', + 'browser/media_galleries/fileapi/picasa/pmp_constants.h', + 'browser/media_galleries/fileapi/picasa/pmp_table_reader.cc', + 'browser/media_galleries/fileapi/picasa/pmp_table_reader.h', 'browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc', 'browser/media_galleries/linux/mtp_device_delegate_impl_linux.h', 'browser/media_galleries/linux/mtp_device_object_enumerator.cc', @@ -2229,6 +2243,15 @@ 'xcode_settings': {'OTHER_LDFLAGS': ['-weak_framework CoreImage']}, }, }], + ['OS=="mac" or OS=="win" or OS=="linux" or chromeos==1', { + 'sources': [ + 'browser/media_galleries/fileapi/device_media_async_file_util.cc', + 'browser/media_galleries/fileapi/device_media_async_file_util.h', + 'browser/media_galleries/fileapi/mtp_device_async_delegate.h', + 'browser/media_galleries/fileapi/mtp_device_map_service.cc', + 'browser/media_galleries/fileapi/mtp_device_map_service.h', + ], + }], ['enable_extensions==1', { 'sources': [ # Only extension API implementations should go here. diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 07dcb1c..258de6b 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -133,6 +133,8 @@ 'browser/google_apis/test_server/http_server.h', 'browser/google_apis/test_util.cc', 'browser/google_apis/test_util.h', + 'browser/media_galleries/fileapi/picasa/pmp_test_helper.cc', + 'browser/media_galleries/fileapi/picasa/pmp_test_helper.h', 'browser/media_galleries/media_galleries_test_util.cc', 'browser/media_galleries/media_galleries_test_util.h', 'browser/net/url_request_mock_util.cc', @@ -527,8 +529,8 @@ 'browser/chrome_page_zoom_unittest.cc', 'browser/chrome_process_singleton_win_unittest.cc', 'browser/chromeos/accessibility/magnification_manager_unittest.cc', - 'browser/chromeos/attestation/attestation_ca_client_unittest.cc', - 'browser/chromeos/attestation/attestation_policy_observer_unittest.cc', + 'browser/chromeos/attestation/attestation_ca_client_unittest.cc', + 'browser/chromeos/attestation/attestation_policy_observer_unittest.cc', 'browser/chromeos/contacts/contact_database_unittest.cc', 'browser/chromeos/contacts/contact_manager_stub.cc', 'browser/chromeos/contacts/contact_manager_stub.h', @@ -881,6 +883,9 @@ 'browser/managed_mode/managed_mode_url_filter_unittest.cc', 'browser/managed_mode/managed_user_passphrase_unittest.cc', 'browser/managed_mode/managed_user_service_unittest.cc', + 'browser/media_galleries/fileapi/native_media_file_util_unittest.cc', + 'browser/media_galleries/fileapi/picasa/pmp_column_reader_unittest.cc', + 'browser/media_galleries/fileapi/picasa/pmp_table_reader_unittest.cc', 'browser/media_galleries/linux/mtp_device_object_enumerator_unittest.cc', 'browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm', 'browser/media_galleries/media_file_system_registry_unittest.cc', @@ -930,7 +935,7 @@ 'browser/password_manager/native_backend_gnome_x_unittest.cc', 'browser/password_manager/native_backend_kwallet_x_unittest.cc', 'browser/password_manager/password_form_manager_unittest.cc', - 'browser/password_manager/password_generation_manager_unittest.cc', + 'browser/password_manager/password_generation_manager_unittest.cc', 'browser/password_manager/password_manager_unittest.cc', 'browser/password_manager/password_store_unittest.cc', 'browser/password_manager/password_store_default_unittest.cc', @@ -1432,7 +1437,7 @@ 'browser/ui/search_engines/keyword_editor_controller_unittest.cc', 'browser/ui/search/search_delegate_unittest.cc', 'browser/ui/sync/one_click_signin_helper_unittest.cc', - 'browser/ui/sync/profile_signin_confirmation_helper_unittest.cc', + 'browser/ui/sync/profile_signin_confirmation_helper_unittest.cc', 'browser/ui/tab_contents/tab_contents_iterator_unittest.cc', 'browser/ui/tabs/dock_info_unittest.cc', 'browser/ui/tabs/pinned_tab_codec_unittest.cc', @@ -2077,8 +2082,8 @@ ], }], ['OS=="mac"', { - # The test fetches resources which means Mac need the app bundle to - # exist on disk so it can pull from it. + # The test fetches resources which means Mac need the app bundle to + # exist on disk so it can pull from it. 'dependencies': [ 'chrome', '../third_party/ocmock/ocmock.gyp:ocmock', diff --git a/content/browser/fileapi/browser_file_system_helper.cc b/content/browser/fileapi/browser_file_system_helper.cc index a273712..75a8aae7 100644 --- a/content/browser/fileapi/browser_file_system_helper.cc +++ b/content/browser/fileapi/browser_file_system_helper.cc @@ -64,12 +64,15 @@ scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext( // Setting up additional mount point providers. ScopedVector<fileapi::FileSystemMountPointProvider> additional_providers; + GetContentClient()->browser()->GetAdditionalFileSystemMountPointProviders( + profile_path, &additional_providers); + return new fileapi::FileSystemContext( task_runners.Pass(), external_mount_points, special_storage_policy, quota_manager_proxy, - ScopedVector<fileapi::FileSystemMountPointProvider>(), + additional_providers.Pass(), profile_path, CreateBrowserFileSystemOptions(is_incognito)); } diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 791c5d9..5a0ac24 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -476,11 +476,6 @@ '../webkit/fileapi/local_file_system_test_helper.h', '../webkit/fileapi/local_file_stream_writer_unittest.cc', '../webkit/fileapi/local_file_util_unittest.cc', - '../webkit/fileapi/media/native_media_file_util_unittest.cc', - '../webkit/fileapi/media/picasa/pmp_column_reader_unittest.cc', - '../webkit/fileapi/media/picasa/pmp_table_reader_unittest.cc', - '../webkit/fileapi/media/picasa/pmp_test_helper.cc', - '../webkit/fileapi/media/picasa/pmp_test_helper.h', '../webkit/fileapi/mock_file_change_observer.cc', '../webkit/fileapi/mock_file_change_observer.h', '../webkit/fileapi/native_file_util_unittest.cc', diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 0c417e9..5047f645 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -13,9 +13,10 @@ #include "base/callback_forward.h" #include "base/memory/linked_ptr.h" #include "base/memory/scoped_ptr.h" +#include "base/memory/scoped_vector.h" #include "content/public/browser/file_descriptor_info.h" -#include "content/public/common/socket_permission_request.h" #include "content/public/common/content_client.h" +#include "content/public/common/socket_permission_request.h" #include "content/public/common/window_container_type.h" #include "net/base/mime_util.h" #include "net/cookies/canonical_cookie.h" @@ -61,6 +62,10 @@ namespace ui { class SelectFilePolicy; } +namespace fileapi { +class FileSystemMountPointProvider; +} + namespace webkit_glue { struct WebPreferences; } @@ -496,6 +501,12 @@ class CONTENT_EXPORT ContentBrowserClient { virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_schemes) {} + // Returns additional MountPointProviders for FileSystem API. + virtual void GetAdditionalFileSystemMountPointProviders( + const base::FilePath& storage_partition_path, + ScopedVector<fileapi::FileSystemMountPointProvider>* + additional_providers) {} + #if defined(OS_POSIX) && !defined(OS_MACOSX) // Populates |mappings| with all files that need to be mapped before launching // a child process. diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc index d91cc16..14d20d2 100644 --- a/webkit/fileapi/file_system_context.cc +++ b/webkit/fileapi/file_system_context.cc @@ -21,7 +21,6 @@ #include "webkit/fileapi/file_system_util.h" #include "webkit/fileapi/isolated_context.h" #include "webkit/fileapi/isolated_mount_point_provider.h" -#include "webkit/fileapi/media/media_file_system_mount_point_provider.h" #include "webkit/fileapi/mount_points.h" #include "webkit/fileapi/sandbox_mount_point_provider.h" #include "webkit/fileapi/syncable/local_file_change_tracker.h" @@ -74,7 +73,6 @@ FileSystemContext::FileSystemContext( partition_path, options)), isolated_provider_(new IsolatedMountPointProvider()), - media_provider_(new MediaFileSystemMountPointProvider(partition_path)), additional_providers_(additional_providers.Pass()), external_mount_points_(external_mount_points), partition_path_(partition_path) { @@ -87,7 +85,6 @@ FileSystemContext::FileSystemContext( RegisterMountPointProvider(sandbox_provider_.get()); RegisterMountPointProvider(isolated_provider_.get()); - RegisterMountPointProvider(media_provider_.get()); #if defined(OS_CHROMEOS) // TODO(kinuko): Move this out of webkit/fileapi layer. diff --git a/webkit/fileapi/file_system_context.h b/webkit/fileapi/file_system_context.h index ff9460d..edc6ec5 100644 --- a/webkit/fileapi/file_system_context.h +++ b/webkit/fileapi/file_system_context.h @@ -24,6 +24,10 @@ namespace base { class FilePath; } +namespace chrome { +class NativeMediaFileUtilTest; +} + namespace quota { class QuotaManagerProxy; class SpecialStoragePolicy; @@ -55,7 +59,6 @@ class FileSystemTaskRunners; class FileSystemURL; class IsolatedMountPointProvider; class MountPoints; -class MediaFileSystemMountPointProvider; class SandboxMountPointProvider; struct DefaultContextDeleter; @@ -239,7 +242,7 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext friend class webkit_blob::BlobURLRequestJobTest; friend class FileSystemQuotaClientTest; friend class LocalFileSystemTestOriginHelper; - friend class NativeMediaFileUtilTest; + friend class chrome::NativeMediaFileUtilTest; friend class FileSystemURLRequestJobTest; friend class UploadFileSystemFileElementReaderTest; @@ -279,10 +282,6 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext scoped_ptr<IsolatedMountPointProvider> isolated_provider_; scoped_ptr<ExternalFileSystemMountPointProvider> external_provider_; - // TODO(kinuko,vandebo): Move this out of webkit/fileapi layer and - // give this provider as additional_providers. - scoped_ptr<MediaFileSystemMountPointProvider> media_provider_; - // Additional mount point providers. ScopedVector<FileSystemMountPointProvider> additional_providers_; diff --git a/webkit/fileapi/media/media_file_system_mount_point_provider.h b/webkit/fileapi/media/media_file_system_mount_point_provider.h deleted file mode 100644 index 03135dd..0000000 --- a/webkit/fileapi/media/media_file_system_mount_point_provider.h +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_FILEAPI_MEDIA_MEDIA_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ -#define WEBKIT_FILEAPI_MEDIA_MEDIA_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ - -#include "base/memory/scoped_ptr.h" -#include "webkit/fileapi/file_system_mount_point_provider.h" -#include "webkit/fileapi/media/mtp_device_file_system_config.h" - -namespace fileapi { - -class AsyncFileUtilAdapter; -class MediaPathFilter; - -#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) -class DeviceMediaAsyncFileUtil; -#endif - -class MediaFileSystemMountPointProvider : public FileSystemMountPointProvider { - public: - static const char kMediaPathFilterKey[]; - static const char kMTPDeviceDelegateURLKey[]; - - explicit MediaFileSystemMountPointProvider( - const base::FilePath& profile_path); - virtual ~MediaFileSystemMountPointProvider(); - - // FileSystemMountPointProvider implementation. - virtual bool CanHandleType(FileSystemType type) const OVERRIDE; - virtual void ValidateFileSystemRoot( - const GURL& origin_url, - FileSystemType type, - bool create, - const ValidateFileSystemCallback& callback) OVERRIDE; - virtual base::FilePath GetFileSystemRootPathOnFileThread( - const FileSystemURL& url, - bool create) OVERRIDE; - virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; - virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; - virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( - FileSystemType type, - base::PlatformFileError* error_code) OVERRIDE; - virtual void InitializeCopyOrMoveFileValidatorFactory( - FileSystemType type, - scoped_ptr<CopyOrMoveFileValidatorFactory> factory) OVERRIDE; - virtual FilePermissionPolicy GetPermissionPolicy( - const FileSystemURL& url, - int permissions) const OVERRIDE; - virtual FileSystemOperation* CreateFileSystemOperation( - const FileSystemURL& url, - FileSystemContext* context, - base::PlatformFileError* error_code) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const FileSystemURL& url, - int64 offset, - const base::Time& expected_modification_time, - FileSystemContext* context) const OVERRIDE; - virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( - const FileSystemURL& url, - int64 offset, - FileSystemContext* context) const OVERRIDE; - virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; - virtual void DeleteFileSystem( - const GURL& origin_url, - FileSystemType type, - FileSystemContext* context, - const DeleteFileSystemCallback& callback) OVERRIDE; - - private: - // Store the profile path. We need this to create temporary snapshot files. - const base::FilePath profile_path_; - - scoped_ptr<MediaPathFilter> media_path_filter_; - scoped_ptr<CopyOrMoveFileValidatorFactory> - media_copy_or_move_file_validator_factory_; - - scoped_ptr<AsyncFileUtilAdapter> native_media_file_util_; -#if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) - scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_; -#endif - - DISALLOW_COPY_AND_ASSIGN(MediaFileSystemMountPointProvider); -}; - -} // namespace fileapi - -#endif // WEBKIT_FILEAPI_MEDIA_MEDIA_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ diff --git a/webkit/fileapi/webkit_fileapi.gypi b/webkit/fileapi/webkit_fileapi.gypi index c65a844..ed363bf 100644 --- a/webkit/fileapi/webkit_fileapi.gypi +++ b/webkit/fileapi/webkit_fileapi.gypi @@ -67,20 +67,6 @@ '../fileapi/local_file_system_operation.h', '../fileapi/local_file_util.cc', '../fileapi/local_file_util.h', - '../fileapi/media/filtering_file_enumerator.cc', - '../fileapi/media/filtering_file_enumerator.h', - '../fileapi/media/media_file_system_mount_point_provider.cc', - '../fileapi/media/media_file_system_mount_point_provider.h', - '../fileapi/media/media_path_filter.cc', - '../fileapi/media/media_path_filter.h', - '../fileapi/media/mtp_device_file_system_config.h', - '../fileapi/media/native_media_file_util.cc', - '../fileapi/media/native_media_file_util.h', - '../fileapi/media/picasa/pmp_column_reader.cc', - '../fileapi/media/picasa/pmp_column_reader.h', - '../fileapi/media/picasa/pmp_constants.h', - '../fileapi/media/picasa/pmp_table_reader.cc', - '../fileapi/media/picasa/pmp_table_reader.h', '../fileapi/mount_points.cc', '../fileapi/mount_points.h', '../fileapi/native_file_util.cc', @@ -142,13 +128,6 @@ '../chromeos/fileapi/remote_file_stream_writer.cc', '../chromeos/fileapi/remote_file_stream_writer.h', ], - 'webkit_fileapi_media_sources': [ - '../fileapi/media/device_media_async_file_util.cc', - '../fileapi/media/device_media_async_file_util.h', - '../fileapi/media/mtp_device_async_delegate.h', - '../fileapi/media/mtp_device_map_service.cc', - '../fileapi/media/mtp_device_map_service.h', - ], }, 'targets': [ { diff --git a/webkit/storage/webkit_storage.gypi b/webkit/storage/webkit_storage.gypi index 0d809ae..f39de1d 100644 --- a/webkit/storage/webkit_storage.gypi +++ b/webkit/storage/webkit_storage.gypi @@ -58,11 +58,6 @@ '<@(webkit_fileapi_chromeos_sources)', ], }], - ['OS=="mac" or OS=="win" or OS=="linux" or chromeos==1', { - 'sources': [ - '<@(webkit_fileapi_media_sources)', - ], - }], ], # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], |