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