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

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

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/client_stub.h ('k') | remoting/protocol/connection_to_client_unittest.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/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 28 matching lines...) Expand all
39 39
40 ConnectionToClient::~ConnectionToClient() { 40 ConnectionToClient::~ConnectionToClient() {
41 // TODO(hclam): When we shut down the viewer we may have to close the 41 // TODO(hclam): When we shut down the viewer we may have to close the
42 // connection. 42 // connection.
43 } 43 }
44 44
45 void ConnectionToClient::Init(protocol::Session* session) { 45 void ConnectionToClient::Init(protocol::Session* session) {
46 DCHECK(message_loop_->BelongsToCurrentThread()); 46 DCHECK(message_loop_->BelongsToCurrentThread());
47 session_.reset(session); 47 session_.reset(session);
48 session_->SetStateChangeCallback( 48 session_->SetStateChangeCallback(
49 NewCallback(this, &ConnectionToClient::OnSessionStateChange)); 49 base::Bind(&ConnectionToClient::OnSessionStateChange,
50 base::Unretained(this)));
50 } 51 }
51 52
52 protocol::Session* ConnectionToClient::session() { 53 protocol::Session* ConnectionToClient::session() {
53 return session_.get(); 54 return session_.get();
54 } 55 }
55 56
56 void ConnectionToClient::Disconnect() { 57 void ConnectionToClient::Disconnect() {
57 // 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.
58 if (!message_loop_->BelongsToCurrentThread()) { 59 if (!message_loop_->BelongsToCurrentThread()) {
59 message_loop_->PostTask( 60 message_loop_->PostTask(
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 157
157 void ConnectionToClient::CloseChannels() { 158 void ConnectionToClient::CloseChannels() {
158 if (video_writer_.get()) 159 if (video_writer_.get())
159 video_writer_->Close(); 160 video_writer_->Close();
160 if (client_control_sender_.get()) 161 if (client_control_sender_.get())
161 client_control_sender_->Close(); 162 client_control_sender_->Close();
162 } 163 }
163 164
164 } // namespace protocol 165 } // namespace protocol
165 } // namespace remoting 166 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/client_stub.h ('k') | remoting/protocol/connection_to_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698