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_CHROMEOS_FILEAPI_REMOTE_FILE_STREAM_WRITER_H_ | 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_STREAM_WRITER_H_ |
6 #define WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_STREAM_WRITER_H_ | 6 #define WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_STREAM_WRITER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 RemoteFileStreamWriter( | 35 RemoteFileStreamWriter( |
36 const scoped_refptr<RemoteFileSystemProxyInterface>& remote_filesystem, | 36 const scoped_refptr<RemoteFileSystemProxyInterface>& remote_filesystem, |
37 const FileSystemURL& url, | 37 const FileSystemURL& url, |
38 int64 offset); | 38 int64 offset); |
39 virtual ~RemoteFileStreamWriter(); | 39 virtual ~RemoteFileStreamWriter(); |
40 | 40 |
41 // FileWriter override. | 41 // FileWriter override. |
42 virtual int Write(net::IOBuffer* buf, int buf_len, | 42 virtual int Write(net::IOBuffer* buf, int buf_len, |
43 const net::CompletionCallback& callback) OVERRIDE; | 43 const net::CompletionCallback& callback) OVERRIDE; |
44 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; | 44 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; |
| 45 virtual int Flush(const net::CompletionCallback& callback) OVERRIDE; |
45 | 46 |
46 private: | 47 private: |
47 // Callback function to do the continuation of the work of the first Write() | 48 // Callback function to do the continuation of the work of the first Write() |
48 // call, which tries to open the local copy of the file before writing. | 49 // call, which tries to open the local copy of the file before writing. |
49 void OnFileOpened( | 50 void OnFileOpened( |
50 net::IOBuffer* buf, | 51 net::IOBuffer* buf, |
51 int buf_len, | 52 int buf_len, |
52 const net::CompletionCallback& callback, | 53 const net::CompletionCallback& callback, |
53 base::PlatformFileError open_result, | 54 base::PlatformFileError open_result, |
54 const FilePath& local_path, | 55 const FilePath& local_path, |
(...skipping 10 matching lines...) Expand all Loading... |
65 net::CompletionCallback pending_cancel_callback_; | 66 net::CompletionCallback pending_cancel_callback_; |
66 | 67 |
67 base::WeakPtrFactory<RemoteFileStreamWriter> weak_factory_; | 68 base::WeakPtrFactory<RemoteFileStreamWriter> weak_factory_; |
68 | 69 |
69 DISALLOW_COPY_AND_ASSIGN(RemoteFileStreamWriter); | 70 DISALLOW_COPY_AND_ASSIGN(RemoteFileStreamWriter); |
70 }; | 71 }; |
71 | 72 |
72 } // namespace fileapi | 73 } // namespace fileapi |
73 | 74 |
74 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_STREAM_WRITER_H_ | 75 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_STREAM_WRITER_H_ |
OLD | NEW |