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 "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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 control_dispatcher_->set_clipboard_stub(clipboard_stub_); | 109 control_dispatcher_->set_clipboard_stub(clipboard_stub_); |
110 control_dispatcher_->set_host_stub(host_stub_); | 110 control_dispatcher_->set_host_stub(host_stub_); |
111 | 111 |
112 event_dispatcher_.reset(new HostEventDispatcher()); | 112 event_dispatcher_.reset(new HostEventDispatcher()); |
113 event_dispatcher_->Init(session_.get(), base::Bind( | 113 event_dispatcher_->Init(session_.get(), base::Bind( |
114 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); | 114 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); |
115 event_dispatcher_->set_input_stub(input_stub_); | 115 event_dispatcher_->set_input_stub(input_stub_); |
116 event_dispatcher_->set_sequence_number_callback(base::Bind( | 116 event_dispatcher_->set_sequence_number_callback(base::Bind( |
117 &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this))); | 117 &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this))); |
118 | 118 |
119 video_writer_.reset(VideoWriter::Create(session_->config())); | 119 video_writer_ = VideoWriter::Create(session_->config()); |
120 video_writer_->Init(session_.get(), base::Bind( | 120 video_writer_->Init(session_.get(), base::Bind( |
121 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); | 121 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); |
122 | 122 |
123 // Notify the handler after initializing the channels, so that | 123 // Notify the handler after initializing the channels, so that |
124 // ClientSession can get a client clipboard stub. | 124 // ClientSession can get a client clipboard stub. |
125 handler_->OnConnectionAuthenticated(this); | 125 handler_->OnConnectionAuthenticated(this); |
126 break; | 126 break; |
127 | 127 |
128 case Session::CLOSED: | 128 case Session::CLOSED: |
129 Close(OK); | 129 Close(OK); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 void ConnectionToClient::CloseChannels() { | 171 void ConnectionToClient::CloseChannels() { |
172 control_dispatcher_.reset(); | 172 control_dispatcher_.reset(); |
173 event_dispatcher_.reset(); | 173 event_dispatcher_.reset(); |
174 video_writer_.reset(); | 174 video_writer_.reset(); |
175 } | 175 } |
176 | 176 |
177 } // namespace protocol | 177 } // namespace protocol |
178 } // namespace remoting | 178 } // namespace remoting |
OLD | NEW |