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_FILE_STREAM_READER_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace storage { | 26 namespace storage { |
27 | 27 |
28 class FileSystemContext; | 28 class FileSystemContext; |
29 | 29 |
30 // Generic FileStreamReader implementation for FileSystem files. | 30 // Generic FileStreamReader implementation for FileSystem files. |
31 // Note: This generic implementation would work for any filesystems but | 31 // Note: This generic implementation would work for any filesystems but |
32 // remote filesystem should implement its own reader rather than relying | 32 // remote filesystem should implement its own reader rather than relying |
33 // on FileSystemOperation::GetSnapshotFile() which may force downloading | 33 // on FileSystemOperation::GetSnapshotFile() which may force downloading |
34 // the entire contents for remote files. | 34 // the entire contents for remote files. |
35 class STORAGE_EXPORT_PRIVATE FileSystemFileStreamReader | 35 class STORAGE_EXPORT FileSystemFileStreamReader |
36 : public NON_EXPORTED_BASE(storage::FileStreamReader) { | 36 : public NON_EXPORTED_BASE(storage::FileStreamReader) { |
37 public: | 37 public: |
38 ~FileSystemFileStreamReader() override; | 38 ~FileSystemFileStreamReader() override; |
39 | 39 |
40 // FileStreamReader overrides. | 40 // FileStreamReader overrides. |
41 int Read(net::IOBuffer* buf, | 41 int Read(net::IOBuffer* buf, |
42 int buf_len, | 42 int buf_len, |
43 const net::CompletionCallback& callback) override; | 43 const net::CompletionCallback& callback) override; |
44 int64 GetLength(const net::Int64CompletionCallback& callback) override; | 44 int64 GetLength(const net::Int64CompletionCallback& callback) override; |
45 | 45 |
(...skipping 24 matching lines...) Expand all Loading... |
70 scoped_refptr<storage::ShareableFileReference> snapshot_ref_; | 70 scoped_refptr<storage::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 storage | 77 } // namespace storage |
78 | 78 |
79 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ | 79 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ |
OLD | NEW |