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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // Creates new FileStreamReader instance to read a file pointed by the given | 245 // Creates new FileStreamReader instance to read a file pointed by the given |
246 // filesystem URL |url| starting from |offset|. |expected_modification_time| | 246 // filesystem URL |url| starting from |offset|. |expected_modification_time| |
247 // specifies the expected last modification if the value is non-null, the | 247 // specifies the expected last modification if the value is non-null, the |
248 // reader will check the underlying file's actual modification time to see if | 248 // reader will check the underlying file's actual modification time to see if |
249 // the file has been modified, and if it does any succeeding read operations | 249 // the file has been modified, and if it does any succeeding read operations |
250 // should fail with ERR_UPLOAD_FILE_CHANGED error. | 250 // should fail with ERR_UPLOAD_FILE_CHANGED error. |
251 // This method internally cracks the |url|, get an appropriate | 251 // This method internally cracks the |url|, get an appropriate |
252 // FileSystemBackend for the URL and call the backend's CreateFileReader. | 252 // FileSystemBackend for the URL and call the backend's CreateFileReader. |
253 // The resolved FileSystemBackend could perform further specialization | 253 // The resolved FileSystemBackend could perform further specialization |
254 // depending on the filesystem type pointed by the |url|. | 254 // depending on the filesystem type pointed by the |url|. |
| 255 // At most |max_bytes_to_read| can be fetched from the file stream reader. |
255 scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 256 scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( |
256 const FileSystemURL& url, | 257 const FileSystemURL& url, |
257 int64 offset, | 258 int64 offset, |
| 259 int64 max_bytes_to_read, |
258 const base::Time& expected_modification_time); | 260 const base::Time& expected_modification_time); |
259 | 261 |
260 // Creates new FileStreamWriter instance to write into a file pointed by | 262 // Creates new FileStreamWriter instance to write into a file pointed by |
261 // |url| from |offset|. | 263 // |url| from |offset|. |
262 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 264 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
263 const FileSystemURL& url, | 265 const FileSystemURL& url, |
264 int64 offset); | 266 int64 offset); |
265 | 267 |
266 // Creates a new FileSystemOperationRunner. | 268 // Creates a new FileSystemOperationRunner. |
267 scoped_ptr<FileSystemOperationRunner> CreateFileSystemOperationRunner(); | 269 scoped_ptr<FileSystemOperationRunner> CreateFileSystemOperationRunner(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 421 |
420 struct DefaultContextDeleter { | 422 struct DefaultContextDeleter { |
421 static void Destruct(const FileSystemContext* context) { | 423 static void Destruct(const FileSystemContext* context) { |
422 context->DeleteOnCorrectThread(); | 424 context->DeleteOnCorrectThread(); |
423 } | 425 } |
424 }; | 426 }; |
425 | 427 |
426 } // namespace storage | 428 } // namespace storage |
427 | 429 |
428 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 430 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
OLD | NEW |