| 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/jingle_session.h" | 5 #include "remoting/protocol/jingle_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 this, &JingleSession::SendTransportInfo); | 247 this, &JingleSession::SendTransportInfo); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 void JingleSession::OnTransportRouteChange(Transport* transport, | 251 void JingleSession::OnTransportRouteChange(Transport* transport, |
| 252 const TransportRoute& route) { | 252 const TransportRoute& route) { |
| 253 if (event_handler_) | 253 if (event_handler_) |
| 254 event_handler_->OnSessionRouteChange(transport->name(), route); | 254 event_handler_->OnSessionRouteChange(transport->name(), route); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void JingleSession::OnTransportReady(Transport* transport, bool ready) { |
| 258 if (event_handler_) |
| 259 event_handler_->OnSessionChannelReady(transport->name(), ready); |
| 260 } |
| 261 |
| 257 void JingleSession::OnTransportDeleted(Transport* transport) { | 262 void JingleSession::OnTransportDeleted(Transport* transport) { |
| 258 ChannelsMap::iterator it = channels_.find(transport->name()); | 263 ChannelsMap::iterator it = channels_.find(transport->name()); |
| 259 DCHECK_EQ(it->second, transport); | 264 DCHECK_EQ(it->second, transport); |
| 260 channels_.erase(it); | 265 channels_.erase(it); |
| 261 } | 266 } |
| 262 | 267 |
| 263 void JingleSession::SendMessage(const JingleMessage& message) { | 268 void JingleSession::SendMessage(const JingleMessage& message) { |
| 264 scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq( | 269 scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq( |
| 265 message.ToXml(), | 270 message.ToXml(), |
| 266 base::Bind(&JingleSession::OnMessageResponse, | 271 base::Bind(&JingleSession::OnMessageResponse, |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 DCHECK_NE(state_, FAILED); | 577 DCHECK_NE(state_, FAILED); |
| 573 | 578 |
| 574 state_ = new_state; | 579 state_ = new_state; |
| 575 if (event_handler_) | 580 if (event_handler_) |
| 576 event_handler_->OnSessionStateChange(new_state); | 581 event_handler_->OnSessionStateChange(new_state); |
| 577 } | 582 } |
| 578 } | 583 } |
| 579 | 584 |
| 580 } // namespace protocol | 585 } // namespace protocol |
| 581 } // namespace remoting | 586 } // namespace remoting |
| OLD | NEW |