| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DRIVE_DRIVE_FILE_STREAM_READER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_STREAM_READER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_STREAM_READER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_STREAM_READER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // The Read() method must not be called before the Initialize() is completed | 168 // The Read() method must not be called before the Initialize() is completed |
| 169 // successfully, or if there is pending read operation. | 169 // successfully, or if there is pending read operation. |
| 170 // Neither |buffer| nor |callback| must be null. | 170 // Neither |buffer| nor |callback| must be null. |
| 171 int Read(net::IOBuffer* buffer, int buffer_length, | 171 int Read(net::IOBuffer* buffer, int buffer_length, |
| 172 const net::CompletionCallback& callback); | 172 const net::CompletionCallback& callback); |
| 173 | 173 |
| 174 private: | 174 private: |
| 175 // Part of Initialize. Called after GetFileContent's initialization | 175 // Part of Initialize. Called after GetFileContent's initialization |
| 176 // is done. | 176 // is done. |
| 177 void InitializeAfterGetFileContentInitialized( | 177 void InitializeAfterGetFileContentInitialized( |
| 178 const net::HttpByteRange& in_byte_range, | 178 const net::HttpByteRange& byte_range, |
| 179 const InitializeCompletionCallback& callback, | 179 const InitializeCompletionCallback& callback, |
| 180 FileError error, | 180 FileError error, |
| 181 scoped_ptr<ResourceEntry> entry, | 181 scoped_ptr<ResourceEntry> entry, |
| 182 const base::FilePath& local_cache_file_path, | 182 const base::FilePath& local_cache_file_path, |
| 183 const base::Closure& cancel_download_closure); | 183 const base::Closure& cancel_download_closure); |
| 184 | 184 |
| 185 // Part of Initialize. Called when the local file open process is done. | 185 // Part of Initialize. Called when the local file open process is done. |
| 186 void InitializeAfterLocalFileOpen( | 186 void InitializeAfterLocalFileOpen( |
| 187 int64 length, | 187 int64 length, |
| 188 const InitializeCompletionCallback& callback, | 188 const InitializeCompletionCallback& callback, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 205 | 205 |
| 206 // This should remain the last member so it'll be destroyed first and | 206 // This should remain the last member so it'll be destroyed first and |
| 207 // invalidate its weak pointers before other members are destroyed. | 207 // invalidate its weak pointers before other members are destroyed. |
| 208 base::WeakPtrFactory<DriveFileStreamReader> weak_ptr_factory_; | 208 base::WeakPtrFactory<DriveFileStreamReader> weak_ptr_factory_; |
| 209 DISALLOW_COPY_AND_ASSIGN(DriveFileStreamReader); | 209 DISALLOW_COPY_AND_ASSIGN(DriveFileStreamReader); |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 } // namespace drive | 212 } // namespace drive |
| 213 | 213 |
| 214 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_STREAM_READER_H_ | 214 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_STREAM_READER_H_ |
| OLD | NEW |