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_CONTEXT_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Creates a new FileSystemOperation instance by cracking | 140 // Creates a new FileSystemOperation instance by cracking |
141 // the given filesystem URL |url| to get an appropriate MountPointProvider | 141 // the given filesystem URL |url| to get an appropriate MountPointProvider |
142 // and calling the provider's corresponding CreateFileSystemOperation method. | 142 // and calling the provider's corresponding CreateFileSystemOperation method. |
143 // The resolved MountPointProvider could perform further specialization | 143 // The resolved MountPointProvider could perform further specialization |
144 // depending on the filesystem type pointed by the |url|. | 144 // depending on the filesystem type pointed by the |url|. |
145 FileSystemOperation* CreateFileSystemOperation( | 145 FileSystemOperation* CreateFileSystemOperation( |
146 const FileSystemURL& url, | 146 const FileSystemURL& url, |
147 base::PlatformFileError* error_code); | 147 base::PlatformFileError* error_code); |
148 | 148 |
149 // Creates new FileStreamReader instance to read a file pointed by the given | 149 // Creates new FileStreamReader instance to read a file pointed by the given |
150 // filesystem URL |url| starting from |offset|. | 150 // filesystem URL |url| starting from |offset|. |expected_modification_time| |
| 151 // specifies the expected last modification if the value is non-null, the |
| 152 // reader will check the underlying file's actual modification time to see if |
| 153 // the file has been modified, and if it does any succeeding read operations |
| 154 // should fail with ERR_UPLOAD_FILE_CHANGED error. |
151 // This method internally cracks the |url|, get an appropriate | 155 // This method internally cracks the |url|, get an appropriate |
152 // MountPointProvider for the URL and call the provider's CreateFileReader. | 156 // MountPointProvider for the URL and call the provider's CreateFileReader. |
153 // The resolved MountPointProvider could perform further specialization | 157 // The resolved MountPointProvider could perform further specialization |
154 // depending on the filesystem type pointed by the |url|. | 158 // depending on the filesystem type pointed by the |url|. |
155 webkit_blob::FileStreamReader* CreateFileStreamReader( | 159 webkit_blob::FileStreamReader* CreateFileStreamReader( |
156 const FileSystemURL& url, | 160 const FileSystemURL& url, |
157 int64 offset); | 161 int64 offset, |
| 162 const base::Time& expected_modification_time); |
158 | 163 |
159 // Register a filesystem provider. The ownership of |provider| is | 164 // Register a filesystem provider. The ownership of |provider| is |
160 // transferred to this instance. | 165 // transferred to this instance. |
161 void RegisterMountPointProvider(FileSystemType type, | 166 void RegisterMountPointProvider(FileSystemType type, |
162 FileSystemMountPointProvider* provider); | 167 FileSystemMountPointProvider* provider); |
163 | 168 |
164 FileSystemTaskRunners* task_runners() { return task_runners_.get(); } | 169 FileSystemTaskRunners* task_runners() { return task_runners_.get(); } |
165 | 170 |
166 LocalFileChangeTracker* change_tracker() { return change_tracker_.get(); } | 171 LocalFileChangeTracker* change_tracker() { return change_tracker_.get(); } |
167 void SetLocalFileChangeTracker(scoped_ptr<LocalFileChangeTracker> tracker); | 172 void SetLocalFileChangeTracker(scoped_ptr<LocalFileChangeTracker> tracker); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 209 |
205 struct DefaultContextDeleter { | 210 struct DefaultContextDeleter { |
206 static void Destruct(const FileSystemContext* context) { | 211 static void Destruct(const FileSystemContext* context) { |
207 context->DeleteOnCorrectThread(); | 212 context->DeleteOnCorrectThread(); |
208 } | 213 } |
209 }; | 214 }; |
210 | 215 |
211 } // namespace fileapi | 216 } // namespace fileapi |
212 | 217 |
213 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 218 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
OLD | NEW |