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/pepper_session.h" | 5 #include "remoting/protocol/pepper_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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 if (!transport_infos_timer_.IsRunning()) { | 262 if (!transport_infos_timer_.IsRunning()) { |
263 // Delay sending the new candidates in case we get more candidates | 263 // Delay sending the new candidates in case we get more candidates |
264 // that we can send in one message. | 264 // that we can send in one message. |
265 transport_infos_timer_.Start( | 265 transport_infos_timer_.Start( |
266 FROM_HERE, base::TimeDelta::FromMilliseconds(kTransportInfoSendDelayMs), | 266 FROM_HERE, base::TimeDelta::FromMilliseconds(kTransportInfoSendDelayMs), |
267 this, &PepperSession::SendTransportInfo); | 267 this, &PepperSession::SendTransportInfo); |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
| 271 void PepperSession::OnTransportRouteChange(Transport* transport, |
| 272 const TransportRoute& route) { |
| 273 if (!route_change_callback_.is_null()) { |
| 274 route_change_callback_.Run(transport->name(), route.remote_address, |
| 275 route.local_address); |
| 276 } |
| 277 } |
| 278 |
271 void PepperSession::OnTransportDeleted(Transport* transport) { | 279 void PepperSession::OnTransportDeleted(Transport* transport) { |
272 ChannelsMap::iterator it = channels_.find(transport->name()); | 280 ChannelsMap::iterator it = channels_.find(transport->name()); |
273 DCHECK_EQ(it->second, transport); | 281 DCHECK_EQ(it->second, transport); |
274 channels_.erase(it); | 282 channels_.erase(it); |
275 } | 283 } |
276 | 284 |
277 void PepperSession::OnIncomingMessage(const JingleMessage& message, | 285 void PepperSession::OnIncomingMessage(const JingleMessage& message, |
278 const ReplyCallback& reply_callback) { | 286 const ReplyCallback& reply_callback) { |
279 DCHECK(CalledOnValidThread()); | 287 DCHECK(CalledOnValidThread()); |
280 | 288 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 DCHECK_NE(state_, FAILED); | 551 DCHECK_NE(state_, FAILED); |
544 | 552 |
545 state_ = new_state; | 553 state_ = new_state; |
546 if (!state_change_callback_.is_null()) | 554 if (!state_change_callback_.is_null()) |
547 state_change_callback_.Run(new_state); | 555 state_change_callback_.Run(new_state); |
548 } | 556 } |
549 } | 557 } |
550 | 558 |
551 } // namespace protocol | 559 } // namespace protocol |
552 } // namespace remoting | 560 } // namespace remoting |
OLD | NEW |