Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: remoting/protocol/buffered_socket_writer.cc

Issue 8493020: Move code in src/remoting to the new callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: - Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/host/screen_recorder_unittest.cc ('k') | remoting/protocol/connection_to_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/screen_recorder_unittest.cc ('k') | remoting/protocol/connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698