OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ |
6 #define WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "webkit/fileapi/file_system_mount_point_provider.h" | 9 #include "webkit/fileapi/file_system_mount_point_provider.h" |
10 #include "webkit/fileapi/media/mtp_device_file_system_config.h" | 10 #include "webkit/fileapi/media/mtp_device_file_system_config.h" |
11 | 11 |
12 namespace fileapi { | 12 namespace fileapi { |
13 | 13 |
14 class AsyncFileUtilAdapter; | 14 class AsyncFileUtilAdapter; |
15 class IsolatedContext; | 15 class IsolatedContext; |
16 class MediaPathFilter; | 16 class MediaPathFilter; |
17 | 17 |
18 class IsolatedMountPointProvider : public FileSystemMountPointProvider { | 18 class IsolatedMountPointProvider : public FileSystemMountPointProvider { |
19 public: | 19 public: |
20 explicit IsolatedMountPointProvider(const FilePath& profile_path); | 20 explicit IsolatedMountPointProvider(const base::FilePath& profile_path); |
21 virtual ~IsolatedMountPointProvider(); | 21 virtual ~IsolatedMountPointProvider(); |
22 | 22 |
23 // FileSystemMountPointProvider implementation. | 23 // FileSystemMountPointProvider implementation. |
24 virtual void ValidateFileSystemRoot( | 24 virtual void ValidateFileSystemRoot( |
25 const GURL& origin_url, | 25 const GURL& origin_url, |
26 FileSystemType type, | 26 FileSystemType type, |
27 bool create, | 27 bool create, |
28 const ValidateFileSystemCallback& callback) OVERRIDE; | 28 const ValidateFileSystemCallback& callback) OVERRIDE; |
29 virtual FilePath GetFileSystemRootPathOnFileThread( | 29 virtual base::FilePath GetFileSystemRootPathOnFileThread( |
30 const FileSystemURL& url, | 30 const FileSystemURL& url, |
31 bool create) OVERRIDE; | 31 bool create) OVERRIDE; |
32 virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE; | 32 virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE; |
33 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; | 33 virtual bool IsRestrictedFileName(const base::FilePath& filename) const OVERRI
DE; |
34 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; | 34 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; |
35 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; | 35 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; |
36 virtual FilePermissionPolicy GetPermissionPolicy( | 36 virtual FilePermissionPolicy GetPermissionPolicy( |
37 const FileSystemURL& url, | 37 const FileSystemURL& url, |
38 int permissions) const OVERRIDE; | 38 int permissions) const OVERRIDE; |
39 virtual FileSystemOperation* CreateFileSystemOperation( | 39 virtual FileSystemOperation* CreateFileSystemOperation( |
40 const FileSystemURL& url, | 40 const FileSystemURL& url, |
41 FileSystemContext* context, | 41 FileSystemContext* context, |
42 base::PlatformFileError* error_code) const OVERRIDE; | 42 base::PlatformFileError* error_code) const OVERRIDE; |
43 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( | 43 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( |
44 const FileSystemURL& url, | 44 const FileSystemURL& url, |
45 int64 offset, | 45 int64 offset, |
46 const base::Time& expected_modification_time, | 46 const base::Time& expected_modification_time, |
47 FileSystemContext* context) const OVERRIDE; | 47 FileSystemContext* context) const OVERRIDE; |
48 virtual FileStreamWriter* CreateFileStreamWriter( | 48 virtual FileStreamWriter* CreateFileStreamWriter( |
49 const FileSystemURL& url, | 49 const FileSystemURL& url, |
50 int64 offset, | 50 int64 offset, |
51 FileSystemContext* context) const OVERRIDE; | 51 FileSystemContext* context) const OVERRIDE; |
52 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 52 virtual FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
53 virtual void DeleteFileSystem( | 53 virtual void DeleteFileSystem( |
54 const GURL& origin_url, | 54 const GURL& origin_url, |
55 FileSystemType type, | 55 FileSystemType type, |
56 FileSystemContext* context, | 56 FileSystemContext* context, |
57 const DeleteFileSystemCallback& callback) OVERRIDE; | 57 const DeleteFileSystemCallback& callback) OVERRIDE; |
58 | 58 |
59 private: | 59 private: |
60 // Store the profile path. We need this to create temporary snapshot files. | 60 // Store the profile path. We need this to create temporary snapshot files. |
61 const FilePath profile_path_; | 61 const base::FilePath profile_path_; |
62 | 62 |
63 scoped_ptr<MediaPathFilter> media_path_filter_; | 63 scoped_ptr<MediaPathFilter> media_path_filter_; |
64 | 64 |
65 scoped_ptr<AsyncFileUtilAdapter> isolated_file_util_; | 65 scoped_ptr<AsyncFileUtilAdapter> isolated_file_util_; |
66 scoped_ptr<AsyncFileUtilAdapter> dragged_file_util_; | 66 scoped_ptr<AsyncFileUtilAdapter> dragged_file_util_; |
67 scoped_ptr<AsyncFileUtilAdapter> native_media_file_util_; | 67 scoped_ptr<AsyncFileUtilAdapter> native_media_file_util_; |
68 | 68 |
69 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) | 69 #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) |
70 scoped_ptr<AsyncFileUtilAdapter> device_media_file_util_; | 70 scoped_ptr<AsyncFileUtilAdapter> device_media_file_util_; |
71 #endif | 71 #endif |
72 }; | 72 }; |
73 | 73 |
74 } // namespace fileapi | 74 } // namespace fileapi |
75 | 75 |
76 #endif // WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ | 76 #endif // WEBKIT_FILEAPI_ISOLATED_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |