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_host.h" | 5 #include "remoting/protocol/ice_connection_to_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 void IceConnectionToHost::OnIceTransportError(ErrorCode error) { | 162 void IceConnectionToHost::OnIceTransportError(ErrorCode error) { |
163 session_->Close(error); | 163 session_->Close(error); |
164 } | 164 } |
165 | 165 |
166 void IceConnectionToHost::OnChannelInitialized( | 166 void IceConnectionToHost::OnChannelInitialized( |
167 ChannelDispatcherBase* channel_dispatcher) { | 167 ChannelDispatcherBase* channel_dispatcher) { |
168 NotifyIfChannelsReady(); | 168 NotifyIfChannelsReady(); |
169 } | 169 } |
170 | 170 |
| 171 void IceConnectionToHost::OnChannelClosed( |
| 172 ChannelDispatcherBase* channel_dispatcher) { |
| 173 // ICE transport doesn't close channels dynamically. |
| 174 NOTREACHED(); |
| 175 } |
| 176 |
171 void IceConnectionToHost::OnVideoChannelStatus(bool active) { | 177 void IceConnectionToHost::OnVideoChannelStatus(bool active) { |
172 event_callback_->OnConnectionReady(active); | 178 event_callback_->OnConnectionReady(active); |
173 } | 179 } |
174 | 180 |
175 ConnectionToHost::State IceConnectionToHost::state() const { | 181 ConnectionToHost::State IceConnectionToHost::state() const { |
176 return state_; | 182 return state_; |
177 } | 183 } |
178 | 184 |
179 void IceConnectionToHost::NotifyIfChannelsReady() { | 185 void IceConnectionToHost::NotifyIfChannelsReady() { |
180 if (!control_dispatcher_.get() || !control_dispatcher_->is_connected()) | 186 if (!control_dispatcher_.get() || !control_dispatcher_->is_connected()) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 218 |
213 if (state != state_) { | 219 if (state != state_) { |
214 state_ = state; | 220 state_ = state; |
215 error_ = error; | 221 error_ = error; |
216 event_callback_->OnConnectionState(state_, error_); | 222 event_callback_->OnConnectionState(state_, error_); |
217 } | 223 } |
218 } | 224 } |
219 | 225 |
220 } // namespace protocol | 226 } // namespace protocol |
221 } // namespace remoting | 227 } // namespace remoting |
OLD | NEW |