OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ice_connection_to_client.h" | 5 #include "remoting/protocol/ice_connection_to_client.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 Disconnect(error); | 163 Disconnect(error); |
164 } | 164 } |
165 | 165 |
166 void IceConnectionToClient::OnChannelInitialized( | 166 void IceConnectionToClient::OnChannelInitialized( |
167 ChannelDispatcherBase* channel_dispatcher) { | 167 ChannelDispatcherBase* channel_dispatcher) { |
168 DCHECK(thread_checker_.CalledOnValidThread()); | 168 DCHECK(thread_checker_.CalledOnValidThread()); |
169 | 169 |
170 NotifyIfChannelsReady(); | 170 NotifyIfChannelsReady(); |
171 } | 171 } |
172 | 172 |
| 173 void IceConnectionToClient::OnChannelClosed( |
| 174 ChannelDispatcherBase* channel_dispatcher) { |
| 175 // ICE transport doesn't close channels dynamically. |
| 176 NOTREACHED(); |
| 177 } |
| 178 |
173 void IceConnectionToClient::NotifyIfChannelsReady() { | 179 void IceConnectionToClient::NotifyIfChannelsReady() { |
174 DCHECK(thread_checker_.CalledOnValidThread()); | 180 DCHECK(thread_checker_.CalledOnValidThread()); |
175 | 181 |
176 if (!control_dispatcher_ || !control_dispatcher_->is_connected()) | 182 if (!control_dispatcher_ || !control_dispatcher_->is_connected()) |
177 return; | 183 return; |
178 if (!event_dispatcher_ || !event_dispatcher_->is_connected()) | 184 if (!event_dispatcher_ || !event_dispatcher_->is_connected()) |
179 return; | 185 return; |
180 if (!video_dispatcher_ || !video_dispatcher_->is_connected()) | 186 if (!video_dispatcher_ || !video_dispatcher_->is_connected()) |
181 return; | 187 return; |
182 if ((!audio_writer_ || !audio_writer_->is_connected()) && | 188 if ((!audio_writer_ || !audio_writer_->is_connected()) && |
183 session_->config().is_audio_enabled()) { | 189 session_->config().is_audio_enabled()) { |
184 return; | 190 return; |
185 } | 191 } |
186 event_handler_->OnConnectionChannelsConnected(this); | 192 event_handler_->OnConnectionChannelsConnected(this); |
187 event_handler_->CreateVideoStreams(this); | 193 event_handler_->CreateVideoStreams(this); |
188 } | 194 } |
189 | 195 |
190 void IceConnectionToClient::CloseChannels() { | 196 void IceConnectionToClient::CloseChannels() { |
191 control_dispatcher_.reset(); | 197 control_dispatcher_.reset(); |
192 event_dispatcher_.reset(); | 198 event_dispatcher_.reset(); |
193 video_dispatcher_.reset(); | 199 video_dispatcher_.reset(); |
194 audio_writer_.reset(); | 200 audio_writer_.reset(); |
195 } | 201 } |
196 | 202 |
197 } // namespace protocol | 203 } // namespace protocol |
198 } // namespace remoting | 204 } // namespace remoting |
OLD | NEW |