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 SequencedTaskRunner; |
21 } | 21 } |
22 | 22 |
23 namespace webkit_blob { | 23 namespace webkit_blob { |
24 class FileReader; | 24 class FileReader; |
25 } | 25 } |
26 | 26 |
27 namespace fileapi { | 27 namespace fileapi { |
28 | 28 |
29 class FileSystemContext; | 29 class FileSystemContext; |
30 class FileSystemFileUtil; | 30 class FileSystemFileUtil; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 | 85 |
86 // Returns a new instance of the specialized FileSystemOperation for this | 86 // Returns a new instance of the specialized FileSystemOperation for this |
87 // 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| |
88 // and |virtual_path|. | 88 // and |virtual_path|. |
89 // This method is usually dispatched by | 89 // This method is usually dispatched by |
90 // FileSystemContext::CreateFileSystemOperation. | 90 // FileSystemContext::CreateFileSystemOperation. |
91 virtual FileSystemOperationInterface* CreateFileSystemOperation( | 91 virtual FileSystemOperationInterface* CreateFileSystemOperation( |
92 const GURL& origin_url, | 92 const GURL& origin_url, |
93 FileSystemType file_system_type, | 93 FileSystemType file_system_type, |
94 const FilePath& virtual_path, | 94 const FilePath& virtual_path, |
95 base::MessageLoopProxy* file_proxy, | 95 base::SequencedTaskRunner* task_runner, |
michaeln
2012/04/27 22:31:08
if 'context' had an accessor for file_task_runner(
kinuko
2012/05/04 19:05:35
Done.
| |
96 FileSystemContext* context) const = 0; | 96 FileSystemContext* context) const = 0; |
97 | 97 |
98 // Creates a new file reader for a given filesystem URL |url| with a offset | 98 // Creates a new file reader for a given filesystem URL |url| with a offset |
99 // |offset|. | 99 // |offset|. |
100 // The returned object must be owned and managed by the caller. | 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 | 101 // This method itself does *not* check if the given path exists and is a |
102 // regular file. | 102 // regular file. |
103 virtual webkit_blob::FileReader* CreateFileReader( | 103 virtual webkit_blob::FileReader* CreateFileReader( |
104 const GURL& url, | 104 const GURL& url, |
105 int64 offset, | 105 int64 offset, |
106 base::MessageLoopProxy* file_proxy, | 106 base::SequencedTaskRunner* task_runner, |
107 FileSystemContext* context) const = 0; | 107 FileSystemContext* context) const = 0; |
108 }; | 108 }; |
109 | 109 |
110 // An interface to control external file system access permissions. | 110 // An interface to control external file system access permissions. |
111 class ExternalFileSystemMountPointProvider | 111 class ExternalFileSystemMountPointProvider |
112 : public FileSystemMountPointProvider { | 112 : public FileSystemMountPointProvider { |
113 public: | 113 public: |
114 // Grant access to all external file system from extension identified with | 114 // Grant access to all external file system from extension identified with |
115 // |extension_id|. | 115 // |extension_id|. |
116 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; | 116 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; |
(...skipping 16 matching lines...) Expand all Loading... | |
133 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; | 133 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; |
134 // Gets virtual path by known filesystem path. Returns false when filesystem | 134 // Gets virtual path by known filesystem path. Returns false when filesystem |
135 // path is not exposed by this provider. | 135 // path is not exposed by this provider. |
136 virtual bool GetVirtualPath(const FilePath& file_system_path, | 136 virtual bool GetVirtualPath(const FilePath& file_system_path, |
137 FilePath* virtual_path) = 0; | 137 FilePath* virtual_path) = 0; |
138 }; | 138 }; |
139 | 139 |
140 } // namespace fileapi | 140 } // namespace fileapi |
141 | 141 |
142 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 142 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |