| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // Delay sending the new candidates in case we get more candidates | 252 // Delay sending the new candidates in case we get more candidates |
| 253 // that we can send in one message. | 253 // that we can send in one message. |
| 254 transport_infos_timer_.Start( | 254 transport_infos_timer_.Start( |
| 255 FROM_HERE, base::TimeDelta::FromMilliseconds(kTransportInfoSendDelayMs), | 255 FROM_HERE, base::TimeDelta::FromMilliseconds(kTransportInfoSendDelayMs), |
| 256 this, &JingleSession::SendTransportInfo); | 256 this, &JingleSession::SendTransportInfo); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| 260 void JingleSession::OnTransportRouteChange(Transport* transport, | 260 void JingleSession::OnTransportRouteChange(Transport* transport, |
| 261 const TransportRoute& route) { | 261 const TransportRoute& route) { |
| 262 if (!route_change_callback_.is_null()) { | 262 if (!route_change_callback_.is_null()) |
| 263 route_change_callback_.Run(transport->name(), route.remote_address, | 263 route_change_callback_.Run(transport->name(), route); |
| 264 route.local_address); | |
| 265 } | |
| 266 } | 264 } |
| 267 | 265 |
| 268 void JingleSession::OnTransportDeleted(Transport* transport) { | 266 void JingleSession::OnTransportDeleted(Transport* transport) { |
| 269 ChannelsMap::iterator it = channels_.find(transport->name()); | 267 ChannelsMap::iterator it = channels_.find(transport->name()); |
| 270 DCHECK_EQ(it->second, transport); | 268 DCHECK_EQ(it->second, transport); |
| 271 channels_.erase(it); | 269 channels_.erase(it); |
| 272 } | 270 } |
| 273 | 271 |
| 274 void JingleSession::SendMessage(const JingleMessage& message) { | 272 void JingleSession::SendMessage(const JingleMessage& message) { |
| 275 scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq( | 273 scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq( |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 DCHECK_NE(state_, FAILED); | 575 DCHECK_NE(state_, FAILED); |
| 578 | 576 |
| 579 state_ = new_state; | 577 state_ = new_state; |
| 580 if (!state_change_callback_.is_null()) | 578 if (!state_change_callback_.is_null()) |
| 581 state_change_callback_.Run(new_state); | 579 state_change_callback_.Run(new_state); |
| 582 } | 580 } |
| 583 } | 581 } |
| 584 | 582 |
| 585 } // namespace protocol | 583 } // namespace protocol |
| 586 } // namespace remoting | 584 } // namespace remoting |
| OLD | NEW |