1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_
6 #define WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "webkit/fileapi/file_system_mount_point_provider.h"
10 #include "webkit/fileapi/media/mtp_device_file_system_config.h"
14 class AsyncFileUtilAdapter
;
15 class IsolatedContext
;
16 class MediaPathFilter
;
18 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
19 class DeviceMediaAsyncFileUtil
;
22 class IsolatedMountPointProvider
: public FileSystemMountPointProvider
{
24 explicit IsolatedMountPointProvider(const base::FilePath
& profile_path
);
25 virtual ~IsolatedMountPointProvider();
27 // FileSystemMountPointProvider implementation.
28 virtual void ValidateFileSystemRoot(
29 const GURL
& origin_url
,
32 const ValidateFileSystemCallback
& callback
) OVERRIDE
;
33 virtual base::FilePath
GetFileSystemRootPathOnFileThread(
34 const FileSystemURL
& url
,
35 bool create
) OVERRIDE
;
36 virtual FileSystemFileUtil
* GetFileUtil(FileSystemType type
) OVERRIDE
;
37 virtual AsyncFileUtil
* GetAsyncFileUtil(FileSystemType type
) OVERRIDE
;
38 virtual CopyOrMoveFileValidatorFactory
* GetCopyOrMoveFileValidatorFactory(
40 base::PlatformFileError
* error_code
) OVERRIDE
;
41 virtual void InitializeCopyOrMoveFileValidatorFactory(
43 scoped_ptr
<CopyOrMoveFileValidatorFactory
> factory
) OVERRIDE
;
44 virtual FilePermissionPolicy
GetPermissionPolicy(
45 const FileSystemURL
& url
,
46 int permissions
) const OVERRIDE
;
47 virtual FileSystemOperation
* CreateFileSystemOperation(
48 const FileSystemURL
& url
,
49 FileSystemContext
* context
,
50 base::PlatformFileError
* error_code
) const OVERRIDE
;
51 virtual scoped_ptr
<webkit_blob::FileStreamReader
> CreateFileStreamReader(
52 const FileSystemURL
& url
,
54 const base::Time
& expected_modification_time
,
55 FileSystemContext
* context
) const OVERRIDE
;
56 virtual scoped_ptr
<FileStreamWriter
> CreateFileStreamWriter(
57 const FileSystemURL
& url
,
59 FileSystemContext
* context
) const OVERRIDE
;
60 virtual FileSystemQuotaUtil
* GetQuotaUtil() OVERRIDE
;
61 virtual void DeleteFileSystem(
62 const GURL
& origin_url
,
64 FileSystemContext
* context
,
65 const DeleteFileSystemCallback
& callback
) OVERRIDE
;
68 // Store the profile path. We need this to create temporary snapshot files.
69 const base::FilePath profile_path_
;
71 scoped_ptr
<MediaPathFilter
> media_path_filter_
;
72 scoped_ptr
<CopyOrMoveFileValidatorFactory
>
73 media_copy_or_move_file_validator_factory_
;
75 scoped_ptr
<AsyncFileUtilAdapter
> isolated_file_util_
;
76 scoped_ptr
<AsyncFileUtilAdapter
> dragged_file_util_
;
77 scoped_ptr
<AsyncFileUtilAdapter
> native_media_file_util_
;
79 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM)
80 scoped_ptr
<DeviceMediaAsyncFileUtil
> device_media_async_file_util_
;
84 } // namespace fileapi
86 #endif // WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_