| 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_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "webkit/fileapi/file_system_types.h" | 15 #include "webkit/fileapi/file_system_types.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class MessageLoopProxy; | 20 class MessageLoopProxy; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace webkit_blob { |
| 24 class FileReader; |
| 25 } |
| 26 |
| 23 namespace fileapi { | 27 namespace fileapi { |
| 24 | 28 |
| 25 class FileSystemContext; | 29 class FileSystemContext; |
| 26 class FileSystemFileUtil; | 30 class FileSystemFileUtil; |
| 27 class FileSystemOperationInterface; | 31 class FileSystemOperationInterface; |
| 28 class RemoteFileSystemProxyInterface; | 32 class RemoteFileSystemProxyInterface; |
| 29 | 33 |
| 30 // An interface to provide mount-point-specific path-related utilities | 34 // An interface to provide mount-point-specific path-related utilities |
| 31 // and specialized FileSystemFileUtil instance. | 35 // and specialized FileSystemFileUtil instance. |
| 32 class FileSystemMountPointProvider { | 36 class FileSystemMountPointProvider { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // mount point based on the given triplet of |origin_url|, |file_system_type| | 87 // mount point based on the given triplet of |origin_url|, |file_system_type| |
| 84 // and |virtual_path|. | 88 // and |virtual_path|. |
| 85 // This method is usually dispatched by | 89 // This method is usually dispatched by |
| 86 // FileSystemContext::CreateFileSystemOperation. | 90 // FileSystemContext::CreateFileSystemOperation. |
| 87 virtual FileSystemOperationInterface* CreateFileSystemOperation( | 91 virtual FileSystemOperationInterface* CreateFileSystemOperation( |
| 88 const GURL& origin_url, | 92 const GURL& origin_url, |
| 89 FileSystemType file_system_type, | 93 FileSystemType file_system_type, |
| 90 const FilePath& virtual_path, | 94 const FilePath& virtual_path, |
| 91 base::MessageLoopProxy* file_proxy, | 95 base::MessageLoopProxy* file_proxy, |
| 92 FileSystemContext* context) const = 0; | 96 FileSystemContext* context) const = 0; |
| 97 |
| 98 // Creates a new file reader for a given filesystem URL |url| with a offset |
| 99 // |offset|. |
| 100 // The returned object must be owned and managed by the caller. |
| 101 // This method itself does *not* check if the given path exists and is a |
| 102 // regular file. |
| 103 virtual webkit_blob::FileReader* CreateFileReader( |
| 104 const GURL& url, |
| 105 int64 offset, |
| 106 base::MessageLoopProxy* file_proxy, |
| 107 FileSystemContext* context) const = 0; |
| 93 }; | 108 }; |
| 94 | 109 |
| 95 // An interface to control external file system access permissions. | 110 // An interface to control external file system access permissions. |
| 96 class ExternalFileSystemMountPointProvider | 111 class ExternalFileSystemMountPointProvider |
| 97 : public FileSystemMountPointProvider { | 112 : public FileSystemMountPointProvider { |
| 98 public: | 113 public: |
| 99 // Grant access to all external file system from extension identified with | 114 // Grant access to all external file system from extension identified with |
| 100 // |extension_id|. | 115 // |extension_id|. |
| 101 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; | 116 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; |
| 102 // Grants access to |virtual_path| from |origin_url|. | 117 // Grants access to |virtual_path| from |origin_url|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 118 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; | 133 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; |
| 119 // Gets virtual path by known filesystem path. Returns false when filesystem | 134 // Gets virtual path by known filesystem path. Returns false when filesystem |
| 120 // path is not exposed by this provider. | 135 // path is not exposed by this provider. |
| 121 virtual bool GetVirtualPath(const FilePath& file_system_path, | 136 virtual bool GetVirtualPath(const FilePath& file_system_path, |
| 122 FilePath* virtual_path) = 0; | 137 FilePath* virtual_path) = 0; |
| 123 }; | 138 }; |
| 124 | 139 |
| 125 } // namespace fileapi | 140 } // namespace fileapi |
| 126 | 141 |
| 127 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 142 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
| OLD | NEW |