| 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 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 virtual void ValidateFileSystemRoot( | 49 virtual void ValidateFileSystemRoot( |
| 50 const GURL& origin_url, | 50 const GURL& origin_url, |
| 51 FileSystemType type, | 51 FileSystemType type, |
| 52 bool create, | 52 bool create, |
| 53 const ValidateFileSystemCallback& callback) = 0; | 53 const ValidateFileSystemCallback& callback) = 0; |
| 54 | 54 |
| 55 // Retrieves the root path of the filesystem specified by the given | 55 // Retrieves the root path of the filesystem specified by the given |
| 56 // file system url on the file thread. | 56 // file system url on the file thread. |
| 57 // If |create| is true this may also create the root directory for | 57 // If |create| is true this may also create the root directory for |
| 58 // the filesystem if it doesn't exist. | 58 // the filesystem if it doesn't exist. |
| 59 virtual FilePath GetFileSystemRootPathOnFileThread( | 59 virtual base::FilePath GetFileSystemRootPathOnFileThread( |
| 60 const FileSystemURL& url, | 60 const FileSystemURL& url, |
| 61 bool create) = 0; | 61 bool create) = 0; |
| 62 | 62 |
| 63 // Checks if access to |virtual_path| is allowed from |origin_url|. | 63 // Checks if access to |virtual_path| is allowed from |origin_url|. |
| 64 virtual bool IsAccessAllowed(const FileSystemURL& url) = 0; | 64 virtual bool IsAccessAllowed(const FileSystemURL& url) = 0; |
| 65 | 65 |
| 66 // Checks if a given |name| contains any restricted names/chars in it. | 66 // Checks if a given |name| contains any restricted names/chars in it. |
| 67 // Callable on any thread. | 67 // Callable on any thread. |
| 68 virtual bool IsRestrictedFileName(const FilePath& filename) const = 0; | 68 virtual bool IsRestrictedFileName(const base::FilePath& filename) const = 0; |
| 69 | 69 |
| 70 // Returns the specialized FileSystemFileUtil for this mount point. | 70 // Returns the specialized FileSystemFileUtil for this mount point. |
| 71 // It is ok to return NULL if the filesystem doesn't support synchronous | 71 // It is ok to return NULL if the filesystem doesn't support synchronous |
| 72 // version of FileUtil. | 72 // version of FileUtil. |
| 73 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; | 73 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; |
| 74 | 74 |
| 75 // Returns the specialized AsyncFileUtil for this mount point. | 75 // Returns the specialized AsyncFileUtil for this mount point. |
| 76 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; | 76 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; |
| 77 | 77 |
| 78 // Returns file permission policy we should apply for the given |url|. | 78 // Returns file permission policy we should apply for the given |url|. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const DeleteFileSystemCallback& callback) = 0; | 128 const DeleteFileSystemCallback& callback) = 0; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 // An interface to control external file system access permissions. | 131 // An interface to control external file system access permissions. |
| 132 class ExternalFileSystemMountPointProvider | 132 class ExternalFileSystemMountPointProvider |
| 133 : public FileSystemMountPointProvider { | 133 : public FileSystemMountPointProvider { |
| 134 public: | 134 public: |
| 135 // Returns the list of top level directories that are exposed by this | 135 // Returns the list of top level directories that are exposed by this |
| 136 // provider. This list is used to set appropriate child process file access | 136 // provider. This list is used to set appropriate child process file access |
| 137 // permissions. | 137 // permissions. |
| 138 virtual std::vector<FilePath> GetRootDirectories() const = 0; | 138 virtual std::vector<base::FilePath> GetRootDirectories() const = 0; |
| 139 // Grants access to all external file system from extension identified with | 139 // Grants access to all external file system from extension identified with |
| 140 // |extension_id|. | 140 // |extension_id|. |
| 141 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; | 141 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; |
| 142 // Grants access to |virtual_path| from |origin_url|. | 142 // Grants access to |virtual_path| from |origin_url|. |
| 143 virtual void GrantFileAccessToExtension( | 143 virtual void GrantFileAccessToExtension( |
| 144 const std::string& extension_id, | 144 const std::string& extension_id, |
| 145 const FilePath& virtual_path) = 0; | 145 const base::FilePath& virtual_path) = 0; |
| 146 // Revokes file access from extension identified with |extension_id|. | 146 // Revokes file access from extension identified with |extension_id|. |
| 147 virtual void RevokeAccessForExtension( | 147 virtual void RevokeAccessForExtension( |
| 148 const std::string& extension_id) = 0; | 148 const std::string& extension_id) = 0; |
| 149 // Gets virtual path by known filesystem path. Returns false when filesystem | 149 // Gets virtual path by known filesystem path. Returns false when filesystem |
| 150 // path is not exposed by this provider. | 150 // path is not exposed by this provider. |
| 151 virtual bool GetVirtualPath(const FilePath& file_system_path, | 151 virtual bool GetVirtualPath(const base::FilePath& file_system_path, |
| 152 FilePath* virtual_path) = 0; | 152 base::FilePath* virtual_path) = 0; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace fileapi | 155 } // namespace fileapi |
| 156 | 156 |
| 157 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 157 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
| OLD | NEW |