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_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "webkit/browser/blob/file_stream_reader.h" | 12 #include "webkit/browser/blob/file_stream_reader.h" |
13 #include "webkit/browser/fileapi/file_system_url.h" | 13 #include "webkit/browser/fileapi/file_system_url.h" |
| 14 #include "webkit/browser/webkit_storage_browser_export.h" |
14 #include "webkit/common/blob/shareable_file_reference.h" | 15 #include "webkit/common/blob/shareable_file_reference.h" |
15 #include "webkit/storage/webkit_storage_export.h" | |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class FilePath; | 18 class FilePath; |
19 class SequencedTaskRunner; | 19 class SequencedTaskRunner; |
20 } | 20 } |
21 | 21 |
22 namespace webkit_blob { | 22 namespace webkit_blob { |
23 class LocalFileStreamReader; | 23 class LocalFileStreamReader; |
24 } | 24 } |
25 | 25 |
26 namespace fileapi { | 26 namespace fileapi { |
27 | 27 |
28 class FileSystemContext; | 28 class FileSystemContext; |
29 | 29 |
30 // TODO(kinaba,satorux): This generic implementation would work for any | 30 // TODO(kinaba,satorux): This generic implementation would work for any |
31 // filesystems but remote filesystem should implement its own reader | 31 // filesystems but remote filesystem should implement its own reader |
32 // rather than relying on FileSystemOperation::GetSnapshotFile() which | 32 // rather than relying on FileSystemOperation::GetSnapshotFile() which |
33 // may force downloading the entire contents for remote files. | 33 // may force downloading the entire contents for remote files. |
34 class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemFileStreamReader | 34 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader |
35 : public webkit_blob::FileStreamReader { | 35 : public webkit_blob::FileStreamReader { |
36 public: | 36 public: |
37 // Creates a new FileReader for a filesystem URL |url| form |initial_offset|. | 37 // Creates a new FileReader for a filesystem URL |url| form |initial_offset|. |
38 // |expected_modification_time| specifies the expected last modification if | 38 // |expected_modification_time| specifies the expected last modification if |
39 // the value is non-null, the reader will check the underlying file's actual | 39 // the value is non-null, the reader will check the underlying file's actual |
40 // modification time to see if the file has been modified, and if it does any | 40 // modification time to see if the file has been modified, and if it does any |
41 // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. | 41 // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. |
42 FileSystemFileStreamReader(FileSystemContext* file_system_context, | 42 FileSystemFileStreamReader(FileSystemContext* file_system_context, |
43 const FileSystemURL& url, | 43 const FileSystemURL& url, |
44 int64 initial_offset, | 44 int64 initial_offset, |
(...skipping 25 matching lines...) Expand all Loading... |
70 scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; | 70 scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; |
71 bool has_pending_create_snapshot_; | 71 bool has_pending_create_snapshot_; |
72 base::WeakPtrFactory<FileSystemFileStreamReader> weak_factory_; | 72 base::WeakPtrFactory<FileSystemFileStreamReader> weak_factory_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(FileSystemFileStreamReader); | 74 DISALLOW_COPY_AND_ASSIGN(FileSystemFileStreamReader); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace fileapi | 77 } // namespace fileapi |
78 | 78 |
79 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ | 79 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ |
OLD | NEW |