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

Side by Side Diff: remoting/protocol/connection_to_client.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/protocol/buffered_socket_writer.cc ('k') | remoting/protocol/connection_to_host.h » ('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/connection_to_client.h" 5 #include "remoting/protocol/connection_to_client.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 "google/protobuf/message.h" 10 #include "google/protobuf/message.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 protocol::Session* ConnectionToClient::session() { 53 protocol::Session* ConnectionToClient::session() {
54 return session_.get(); 54 return session_.get();
55 } 55 }
56 56
57 void ConnectionToClient::Disconnect() { 57 void ConnectionToClient::Disconnect() {
58 // This method can be called from main thread so perform threading switching. 58 // This method can be called from main thread so perform threading switching.
59 if (!message_loop_->BelongsToCurrentThread()) { 59 if (!message_loop_->BelongsToCurrentThread()) {
60 message_loop_->PostTask( 60 message_loop_->PostTask(
61 FROM_HERE, 61 FROM_HERE, base::Bind(&ConnectionToClient::Disconnect, this));
62 NewRunnableMethod(this, &ConnectionToClient::Disconnect));
63 return; 62 return;
64 } 63 }
65 64
66 CloseChannels(); 65 CloseChannels();
67 66
68 // If there is a session then release it, causing it to close. 67 // If there is a session then release it, causing it to close.
69 if (session_.get()) 68 if (session_.get())
70 session_.reset(); 69 session_.reset();
71 } 70 }
72 71
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 156
158 void ConnectionToClient::CloseChannels() { 157 void ConnectionToClient::CloseChannels() {
159 if (video_writer_.get()) 158 if (video_writer_.get())
160 video_writer_->Close(); 159 video_writer_->Close();
161 if (client_control_sender_.get()) 160 if (client_control_sender_.get())
162 client_control_sender_->Close(); 161 client_control_sender_->Close();
163 } 162 }
164 163
165 } // namespace protocol 164 } // namespace protocol
166 } // namespace remoting 165 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/buffered_socket_writer.cc ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698