OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 | 127 |
128 event_dispatcher_.reset(new HostEventDispatcher()); | 128 event_dispatcher_.reset(new HostEventDispatcher()); |
129 event_dispatcher_->Init( | 129 event_dispatcher_->Init( |
130 session_.get(), session_->config().event_config(), | 130 session_.get(), session_->config().event_config(), |
131 base::Bind(&ConnectionToClient::OnChannelInitialized, | 131 base::Bind(&ConnectionToClient::OnChannelInitialized, |
132 base::Unretained(this))); | 132 base::Unretained(this))); |
133 event_dispatcher_->set_input_stub(input_stub_); | 133 event_dispatcher_->set_input_stub(input_stub_); |
134 event_dispatcher_->set_sequence_number_callback(base::Bind( | 134 event_dispatcher_->set_sequence_number_callback(base::Bind( |
135 &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this))); | 135 &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this))); |
136 | 136 |
137 video_writer_ = VideoWriter::Create(session_->config()); | 137 video_writer_.reset(new VideoWriter()); |
138 video_writer_->Init(session_.get(), base::Bind( | 138 video_writer_->Init(session_.get(), |
Wez
2014/09/16 23:10:06
nit: Does Init() need to be separate from construc
Sergey Ulanov
2014/09/17 21:52:06
Yes. It's implemented in the ChannelDispatcherBase
Wez
2014/09/18 00:23:54
Acknowledged.
| |
139 &ConnectionToClient::OnChannelInitialized, base::Unretained(this))); | 139 session_->config().video_config(), |
140 base::Bind(&ConnectionToClient::OnChannelInitialized, | |
141 base::Unretained(this))); | |
140 | 142 |
141 audio_writer_ = AudioWriter::Create(session_->config()); | 143 audio_writer_ = AudioWriter::Create(session_->config()); |
142 if (audio_writer_.get()) { | 144 if (audio_writer_.get()) { |
143 audio_writer_->Init( | 145 audio_writer_->Init( |
144 session_.get(), session_->config().audio_config(), | 146 session_.get(), session_->config().audio_config(), |
145 base::Bind(&ConnectionToClient::OnChannelInitialized, | 147 base::Bind(&ConnectionToClient::OnChannelInitialized, |
146 base::Unretained(this))); | 148 base::Unretained(this))); |
147 } | 149 } |
148 | 150 |
149 // Notify the handler after initializing the channels, so that | 151 // Notify the handler after initializing the channels, so that |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 | 204 |
203 void ConnectionToClient::CloseChannels() { | 205 void ConnectionToClient::CloseChannels() { |
204 control_dispatcher_.reset(); | 206 control_dispatcher_.reset(); |
205 event_dispatcher_.reset(); | 207 event_dispatcher_.reset(); |
206 video_writer_.reset(); | 208 video_writer_.reset(); |
207 audio_writer_.reset(); | 209 audio_writer_.reset(); |
208 } | 210 } |
209 | 211 |
210 } // namespace protocol | 212 } // namespace protocol |
211 } // namespace remoting | 213 } // namespace remoting |
OLD | NEW |