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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 const FileSystemURL& url, | 97 const FileSystemURL& url, |
98 FileSystemContext* context, | 98 FileSystemContext* context, |
99 base::PlatformFileError* error_code) const = 0; | 99 base::PlatformFileError* error_code) const = 0; |
100 | 100 |
101 // Creates a new file stream reader for a given filesystem URL |url| with an | 101 // Creates a new file stream reader for a given filesystem URL |url| with an |
102 // offset |offset|. |expected_modification_time| specifies the expected last | 102 // offset |offset|. |expected_modification_time| specifies the expected last |
103 // modification if the value is non-null, the reader will check the underlying | 103 // modification if the value is non-null, the reader will check the underlying |
104 // file's actual modification time to see if the file has been modified, and | 104 // file's actual modification time to see if the file has been modified, and |
105 // if it does any succeeding read operations should fail with | 105 // if it does any succeeding read operations should fail with |
106 // ERR_UPLOAD_FILE_CHANGED error. | 106 // ERR_UPLOAD_FILE_CHANGED error. |
107 // The returned object must be owned and managed by the caller. | |
108 // This method itself does *not* check if the given path exists and is a | 107 // This method itself does *not* check if the given path exists and is a |
109 // regular file. | 108 // regular file. |
110 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( | 109 virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( |
111 const FileSystemURL& url, | 110 const FileSystemURL& url, |
112 int64 offset, | 111 int64 offset, |
113 const base::Time& expected_modification_time, | 112 const base::Time& expected_modification_time, |
114 FileSystemContext* context) const = 0; | 113 FileSystemContext* context) const = 0; |
115 | 114 |
116 // Creates a new file stream writer for a given filesystem URL |url| with an | 115 // Creates a new file stream writer for a given filesystem URL |url| with an |
117 // offset |offset|. | 116 // offset |offset|. |
118 // The returned object must be owned and managed by the caller. | |
119 // This method itself does *not* check if the given path exists and is a | 117 // This method itself does *not* check if the given path exists and is a |
120 // regular file. | 118 // regular file. |
121 virtual FileStreamWriter* CreateFileStreamWriter( | 119 virtual scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
122 const FileSystemURL& url, | 120 const FileSystemURL& url, |
123 int64 offset, | 121 int64 offset, |
124 FileSystemContext* context) const = 0; | 122 FileSystemContext* context) const = 0; |
125 | 123 |
126 // Returns the specialized FileSystemQuotaUtil for this mount point. | 124 // Returns the specialized FileSystemQuotaUtil for this mount point. |
127 // This could return NULL if this mount point does not support quota. | 125 // This could return NULL if this mount point does not support quota. |
128 virtual FileSystemQuotaUtil* GetQuotaUtil() = 0; | 126 virtual FileSystemQuotaUtil* GetQuotaUtil() = 0; |
129 | 127 |
130 // Deletes the filesystem for the given |origin_url| and |type|. | 128 // Deletes the filesystem for the given |origin_url| and |type|. |
131 virtual void DeleteFileSystem( | 129 virtual void DeleteFileSystem( |
(...skipping 30 matching lines...) Expand all Loading... |
162 const std::string& extension_id) = 0; | 160 const std::string& extension_id) = 0; |
163 // Gets virtual path by known filesystem path. Returns false when filesystem | 161 // Gets virtual path by known filesystem path. Returns false when filesystem |
164 // path is not exposed by this provider. | 162 // path is not exposed by this provider. |
165 virtual bool GetVirtualPath(const base::FilePath& file_system_path, | 163 virtual bool GetVirtualPath(const base::FilePath& file_system_path, |
166 base::FilePath* virtual_path) = 0; | 164 base::FilePath* virtual_path) = 0; |
167 }; | 165 }; |
168 | 166 |
169 } // namespace fileapi | 167 } // namespace fileapi |
170 | 168 |
171 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 169 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |