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_BLOB_LOCAL_FILE_STREAM_READER_H_ | 5 #ifndef WEBKIT_BROWSER_BLOB_LOCAL_FILE_STREAM_READER_H_ |
6 #define WEBKIT_BROWSER_BLOB_LOCAL_FILE_STREAM_READER_H_ | 6 #define WEBKIT_BROWSER_BLOB_LOCAL_FILE_STREAM_READER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "webkit/browser/blob/file_stream_reader.h" | 14 #include "webkit/browser/blob/file_stream_reader.h" |
15 #include "webkit/storage/webkit_storage_export.h" | 15 #include "webkit/browser/webkit_storage_browser_export.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class TaskRunner; | 18 class TaskRunner; |
19 } | 19 } |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 class FileStream; | 22 class FileStream; |
23 } | 23 } |
24 | 24 |
25 namespace webkit_blob { | 25 namespace webkit_blob { |
26 | 26 |
27 // A thin wrapper of net::FileStream with range support for sliced file | 27 // A thin wrapper of net::FileStream with range support for sliced file |
28 // handling. | 28 // handling. |
29 class WEBKIT_STORAGE_EXPORT LocalFileStreamReader : public FileStreamReader { | 29 class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamReader |
| 30 : public FileStreamReader { |
30 public: | 31 public: |
31 // Creates a new FileReader for a local file |file_path|. | 32 // Creates a new FileReader for a local file |file_path|. |
32 // |initial_offset| specifies the offset in the file where the first read | 33 // |initial_offset| specifies the offset in the file where the first read |
33 // should start. If the given offset is out of the file range any | 34 // should start. If the given offset is out of the file range any |
34 // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. | 35 // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. |
35 // | 36 // |
36 // |expected_modification_time| specifies the expected last modification | 37 // |expected_modification_time| specifies the expected last modification |
37 // If the value is non-null, the reader will check the underlying file's | 38 // If the value is non-null, the reader will check the underlying file's |
38 // actual modification time to see if the file has been modified, and if | 39 // actual modification time to see if the file has been modified, and if |
39 // it does any succeeding read operations should fail with | 40 // it does any succeeding read operations should fail with |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const base::FilePath file_path_; | 75 const base::FilePath file_path_; |
75 const int64 initial_offset_; | 76 const int64 initial_offset_; |
76 const base::Time expected_modification_time_; | 77 const base::Time expected_modification_time_; |
77 bool has_pending_open_; | 78 bool has_pending_open_; |
78 base::WeakPtrFactory<LocalFileStreamReader> weak_factory_; | 79 base::WeakPtrFactory<LocalFileStreamReader> weak_factory_; |
79 }; | 80 }; |
80 | 81 |
81 } // namespace webkit_blob | 82 } // namespace webkit_blob |
82 | 83 |
83 #endif // WEBKIT_BROWSER_BLOB_LOCAL_FILE_STREAM_READER_H_ | 84 #endif // WEBKIT_BROWSER_BLOB_LOCAL_FILE_STREAM_READER_H_ |
OLD | NEW |