| 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_host.h" | 5 #include "remoting/protocol/connection_to_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "remoting/base/constants.h" | 10 #include "remoting/base/constants.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 CloseOnError(session_->error()); | 202 CloseOnError(session_->error()); |
| 203 } | 203 } |
| 204 break; | 204 break; |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 void ConnectionToHost::OnSessionRouteChange(const std::string& channel_name, | 208 void ConnectionToHost::OnSessionRouteChange(const std::string& channel_name, |
| 209 const TransportRoute& route) { | 209 const TransportRoute& route) { |
| 210 } | 210 } |
| 211 | 211 |
| 212 void ConnectionToHost::OnSessionChannelReady(const std::string& channel_name, |
| 213 bool ready) { |
| 214 if (ready) { |
| 215 not_ready_channels_.erase(channel_name); |
| 216 } else if (!ready) { |
| 217 not_ready_channels_.insert(channel_name); |
| 218 } |
| 219 |
| 220 event_callback_->OnConnectionReady(ready); |
| 221 } |
| 222 |
| 212 ConnectionToHost::State ConnectionToHost::state() const { | 223 ConnectionToHost::State ConnectionToHost::state() const { |
| 213 return state_; | 224 return state_; |
| 214 } | 225 } |
| 215 | 226 |
| 216 void ConnectionToHost::OnChannelInitialized(bool successful) { | 227 void ConnectionToHost::OnChannelInitialized(bool successful) { |
| 217 if (!successful) { | 228 if (!successful) { |
| 218 LOG(ERROR) << "Failed to connect video channel"; | 229 LOG(ERROR) << "Failed to connect video channel"; |
| 219 CloseOnError(CHANNEL_CONNECTION_ERROR); | 230 CloseOnError(CHANNEL_CONNECTION_ERROR); |
| 220 return; | 231 return; |
| 221 } | 232 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 275 |
| 265 if (state != state_) { | 276 if (state != state_) { |
| 266 state_ = state; | 277 state_ = state; |
| 267 error_ = error; | 278 error_ = error; |
| 268 event_callback_->OnConnectionState(state_, error_); | 279 event_callback_->OnConnectionState(state_, error_); |
| 269 } | 280 } |
| 270 } | 281 } |
| 271 | 282 |
| 272 } // namespace protocol | 283 } // namespace protocol |
| 273 } // namespace remoting | 284 } // namespace remoting |
| OLD | NEW |