Chromium Code Reviews| 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::OnSessionInactive(const std::string& channel_name, | |
| 213 bool inactive) { | |
| 214 if (channel_name == kVideoChannelName) | |
| 215 event_callback_->OnConnectionInactive(inactive); | |
|
Wez
2012/07/16 18:51:23
You're basing the connection's "active" state pure
Sergey Ulanov
2012/07/17 01:17:17
Changed it to set ready=false when any of the chan
| |
| 216 } | |
| 217 | |
| 212 ConnectionToHost::State ConnectionToHost::state() const { | 218 ConnectionToHost::State ConnectionToHost::state() const { |
| 213 return state_; | 219 return state_; |
| 214 } | 220 } |
| 215 | 221 |
| 216 void ConnectionToHost::OnChannelInitialized(bool successful) { | 222 void ConnectionToHost::OnChannelInitialized(bool successful) { |
| 217 if (!successful) { | 223 if (!successful) { |
| 218 LOG(ERROR) << "Failed to connect video channel"; | 224 LOG(ERROR) << "Failed to connect video channel"; |
| 219 CloseOnError(CHANNEL_CONNECTION_ERROR); | 225 CloseOnError(CHANNEL_CONNECTION_ERROR); |
| 220 return; | 226 return; |
| 221 } | 227 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 | 270 |
| 265 if (state != state_) { | 271 if (state != state_) { |
| 266 state_ = state; | 272 state_ = state; |
| 267 error_ = error; | 273 error_ = error; |
| 268 event_callback_->OnConnectionState(state_, error_); | 274 event_callback_->OnConnectionState(state_, error_); |
| 269 } | 275 } |
| 270 } | 276 } |
| 271 | 277 |
| 272 } // namespace protocol | 278 } // namespace protocol |
| 273 } // namespace remoting | 279 } // namespace remoting |
| OLD | NEW |