| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_
H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_
H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_
H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READER_
H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 FileStreamReader(storage::FileSystemContext* context, | 32 FileStreamReader(storage::FileSystemContext* context, |
| 33 const storage::FileSystemURL& url, | 33 const storage::FileSystemURL& url, |
| 34 int64 initial_offset, | 34 int64 initial_offset, |
| 35 const base::Time& expected_modification_time); | 35 const base::Time& expected_modification_time); |
| 36 | 36 |
| 37 virtual ~FileStreamReader(); | 37 virtual ~FileStreamReader(); |
| 38 | 38 |
| 39 // storage::FileStreamReader overrides. | 39 // storage::FileStreamReader overrides. |
| 40 virtual int Read(net::IOBuffer* buf, | 40 virtual int Read(net::IOBuffer* buf, |
| 41 int buf_len, | 41 int buf_len, |
| 42 const net::CompletionCallback& callback) OVERRIDE; | 42 const net::CompletionCallback& callback) override; |
| 43 virtual int64 GetLength( | 43 virtual int64 GetLength( |
| 44 const net::Int64CompletionCallback& callback) OVERRIDE; | 44 const net::Int64CompletionCallback& callback) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Helper class for executing operations on the provided file system. All | 47 // Helper class for executing operations on the provided file system. All |
| 48 // of its methods must be called on UI thread. Callbacks are called on IO | 48 // of its methods must be called on UI thread. Callbacks are called on IO |
| 49 // thread. | 49 // thread. |
| 50 class OperationRunner; | 50 class OperationRunner; |
| 51 | 51 |
| 52 // State of the file stream reader. | 52 // State of the file stream reader. |
| 53 enum State { NOT_INITIALIZED, INITIALIZING, INITIALIZED, FAILED }; | 53 enum State { NOT_INITIALIZED, INITIALIZING, INITIALIZED, FAILED }; |
| 54 | 54 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 State state_; | 105 State state_; |
| 106 | 106 |
| 107 base::WeakPtrFactory<FileStreamReader> weak_ptr_factory_; | 107 base::WeakPtrFactory<FileStreamReader> weak_ptr_factory_; |
| 108 DISALLOW_COPY_AND_ASSIGN(FileStreamReader); | 108 DISALLOW_COPY_AND_ASSIGN(FileStreamReader); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace file_system_provider | 111 } // namespace file_system_provider |
| 112 } // namespace chromeos | 112 } // namespace chromeos |
| 113 | 113 |
| 114 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READ
ER_H_ | 114 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_FILE_STREAM_READ
ER_H_ |
| OLD | NEW |