| 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/platform_file.h" | 13 #include "base/platform_file.h" |
| 14 #include "webkit/fileapi/fileapi_export.h" | 14 #include "webkit/fileapi/fileapi_export.h" |
| 15 #include "webkit/fileapi/file_system_types.h" | 15 #include "webkit/fileapi/file_system_types.h" |
| 16 | 16 |
| 17 namespace webkit_blob { | 17 namespace webkit_blob { |
| 18 class FileStreamReader; | 18 class FileStreamReader; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace fileapi { | 21 namespace fileapi { |
| 22 | 22 |
| 23 class FileSystemURL; | 23 class FileSystemURL; |
| 24 class FileStreamWriter; | 24 class FileStreamWriter; |
| 25 class FileSystemContext; | 25 class FileSystemContext; |
| 26 class FileSystemFileUtil; | 26 class FileSystemFileUtil; |
| 27 class FileSystemOperationInterface; | 27 class FileSystemOperation; |
| 28 class FileSystemQuotaUtil; | 28 class FileSystemQuotaUtil; |
| 29 class RemoteFileSystemProxyInterface; | 29 class RemoteFileSystemProxyInterface; |
| 30 | 30 |
| 31 // An interface to provide mount-point-specific path-related utilities | 31 // An interface to provide mount-point-specific path-related utilities |
| 32 // and specialized FileSystemFileUtil instance. | 32 // and specialized FileSystemFileUtil instance. |
| 33 class FILEAPI_EXPORT FileSystemMountPointProvider { | 33 class FILEAPI_EXPORT FileSystemMountPointProvider { |
| 34 public: | 34 public: |
| 35 // Callback for ValidateFileSystemRoot. | 35 // Callback for ValidateFileSystemRoot. |
| 36 typedef base::Callback<void(base::PlatformFileError error)> | 36 typedef base::Callback<void(base::PlatformFileError error)> |
| 37 ValidateFileSystemCallback; | 37 ValidateFileSystemCallback; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Returns file path we should use to check access permissions for | 75 // Returns file path we should use to check access permissions for |
| 76 // |virtual_path|. | 76 // |virtual_path|. |
| 77 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) | 77 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) |
| 78 const = 0; | 78 const = 0; |
| 79 | 79 |
| 80 // Returns a new instance of the specialized FileSystemOperation for this | 80 // Returns a new instance of the specialized FileSystemOperation for this |
| 81 // mount point based on the given triplet of |origin_url|, |file_system_type| | 81 // mount point based on the given triplet of |origin_url|, |file_system_type| |
| 82 // and |virtual_path|. | 82 // and |virtual_path|. |
| 83 // This method is usually dispatched by | 83 // This method is usually dispatched by |
| 84 // FileSystemContext::CreateFileSystemOperation. | 84 // FileSystemContext::CreateFileSystemOperation. |
| 85 virtual FileSystemOperationInterface* CreateFileSystemOperation( | 85 virtual FileSystemOperation* CreateFileSystemOperation( |
| 86 const FileSystemURL& url, | 86 const FileSystemURL& url, |
| 87 FileSystemContext* context) const = 0; | 87 FileSystemContext* context) const = 0; |
| 88 | 88 |
| 89 // Creates a new file stream reader for a given filesystem URL |url| with an | 89 // Creates a new file stream reader for a given filesystem URL |url| with an |
| 90 // offset |offset|. | 90 // offset |offset|. |
| 91 // The returned object must be owned and managed by the caller. | 91 // The returned object must be owned and managed by the caller. |
| 92 // This method itself does *not* check if the given path exists and is a | 92 // This method itself does *not* check if the given path exists and is a |
| 93 // regular file. | 93 // regular file. |
| 94 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( | 94 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( |
| 95 const FileSystemURL& url, | 95 const FileSystemURL& url, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; | 148 virtual void RemoveMountPoint(const FilePath& mount_point) = 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 FilePath& file_system_path, |
| 152 FilePath* virtual_path) = 0; | 152 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 |