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 #include "webkit/chromeos/fileapi/remote_file_stream_writer.h" | 5 #include "webkit/chromeos/fileapi/remote_file_stream_writer.h" |
6 | 6 |
7 #include "net/base/io_buffer.h" | 7 #include "net/base/io_buffer.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 #include "webkit/blob/local_file_stream_reader.h" | 9 #include "webkit/blob/local_file_stream_reader.h" |
10 #include "webkit/blob/shareable_file_reference.h" | 10 #include "webkit/blob/shareable_file_reference.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 pending_cancel_callback_ = callback; | 97 pending_cancel_callback_ = callback; |
98 return local_file_writer_->Cancel( | 98 return local_file_writer_->Cancel( |
99 base::Bind(&RemoteFileStreamWriter::InvokePendingCancelCallback, | 99 base::Bind(&RemoteFileStreamWriter::InvokePendingCancelCallback, |
100 weak_factory_.GetWeakPtr())); | 100 weak_factory_.GetWeakPtr())); |
101 } | 101 } |
102 | 102 |
103 // Write() is not called yet. | 103 // Write() is not called yet. |
104 return net::ERR_UNEXPECTED; | 104 return net::ERR_UNEXPECTED; |
105 } | 105 } |
106 | 106 |
| 107 int RemoteFileStreamWriter::Flush(const net::CompletionCallback& callback) { |
| 108 // For remote file writer, Flush() is a no-op. Synchronization to the remote |
| 109 // server is not done until the file is closed. |
| 110 return net::OK; |
| 111 } |
| 112 |
107 void RemoteFileStreamWriter::InvokePendingCancelCallback(int result) { | 113 void RemoteFileStreamWriter::InvokePendingCancelCallback(int result) { |
108 net::CompletionCallback callback = pending_cancel_callback_; | 114 net::CompletionCallback callback = pending_cancel_callback_; |
109 pending_cancel_callback_.Reset(); | 115 pending_cancel_callback_.Reset(); |
110 callback.Run(result); | 116 callback.Run(result); |
111 } | 117 } |
112 | 118 |
113 } // namespace gdata | 119 } // namespace gdata |
OLD | NEW |