OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "remoting/protocol/buffered_socket_writer.h" | 5 #include "remoting/protocol/buffered_socket_writer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 { | 125 { |
126 base::AutoLock auto_lock(lock_); | 126 base::AutoLock auto_lock(lock_); |
127 AdvanceBufferPosition_Locked(result); | 127 AdvanceBufferPosition_Locked(result); |
128 } | 128 } |
129 | 129 |
130 // Schedule next write. | 130 // Schedule next write. |
131 message_loop_->PostTask( | 131 message_loop_->PostTask( |
132 FROM_HERE, NewRunnableMethod(this, &BufferedSocketWriterBase::DoWrite)); | 132 FROM_HERE, base::Bind(&BufferedSocketWriterBase::DoWrite, this)); |
133 } | 133 } |
134 | 134 |
135 void BufferedSocketWriterBase::HandleError(int result) { | 135 void BufferedSocketWriterBase::HandleError(int result) { |
136 DCHECK(message_loop_->BelongsToCurrentThread()); | 136 DCHECK(message_loop_->BelongsToCurrentThread()); |
137 | 137 |
138 closed_ = true; | 138 closed_ = true; |
139 | 139 |
140 base::AutoLock auto_lock(lock_); | 140 base::AutoLock auto_lock(lock_); |
141 STLDeleteElements(&queue_); | 141 STLDeleteElements(&queue_); |
142 | 142 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 buffer_size_ -= queue_.front()->data()->size(); | 224 buffer_size_ -= queue_.front()->data()->size(); |
225 PopQueue(); | 225 PopQueue(); |
226 } | 226 } |
227 | 227 |
228 void BufferedDatagramWriter::OnError_Locked(int result) { | 228 void BufferedDatagramWriter::OnError_Locked(int result) { |
229 // Nothing to do here. | 229 // Nothing to do here. |
230 } | 230 } |
231 | 231 |
232 } // namespace protocol | 232 } // namespace protocol |
233 } // namespace remoting | 233 } // namespace remoting |
OLD | NEW |