OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 // if one is pending. | 428 // if one is pending. |
429 | 429 |
430 port->SetIceRole(ice_role_); | 430 port->SetIceRole(ice_role_); |
431 port->SetIceTiebreaker(tiebreaker_); | 431 port->SetIceTiebreaker(tiebreaker_); |
432 ports_.push_back(port); | 432 ports_.push_back(port); |
433 port->SignalUnknownAddress.connect( | 433 port->SignalUnknownAddress.connect( |
434 this, &P2PTransportChannel::OnUnknownAddress); | 434 this, &P2PTransportChannel::OnUnknownAddress); |
435 port->SignalDestroyed.connect(this, &P2PTransportChannel::OnPortDestroyed); | 435 port->SignalDestroyed.connect(this, &P2PTransportChannel::OnPortDestroyed); |
436 port->SignalRoleConflict.connect( | 436 port->SignalRoleConflict.connect( |
437 this, &P2PTransportChannel::OnRoleConflict); | 437 this, &P2PTransportChannel::OnRoleConflict); |
| 438 port->SignalSentPacket.connect(this, &P2PTransportChannel::OnSentPacket); |
438 | 439 |
439 // Attempt to create a connection from this new port to all of the remote | 440 // Attempt to create a connection from this new port to all of the remote |
440 // candidates that we were given so far. | 441 // candidates that we were given so far. |
441 | 442 |
442 std::vector<RemoteCandidate>::iterator iter; | 443 std::vector<RemoteCandidate>::iterator iter; |
443 for (iter = remote_candidates_.begin(); iter != remote_candidates_.end(); | 444 for (iter = remote_candidates_.begin(); iter != remote_candidates_.end(); |
444 ++iter) { | 445 ++iter) { |
445 CreateConnection(port, *iter, iter->origin_port()); | 446 CreateConnection(port, *iter, iter->origin_port()); |
446 } | 447 } |
447 | 448 |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 SignalReadPacket(this, data, len, packet_time, 0); | 1350 SignalReadPacket(this, data, len, packet_time, 0); |
1350 | 1351 |
1351 // May need to switch the sending connection based on the receiving media path | 1352 // May need to switch the sending connection based on the receiving media path |
1352 // if this is the controlled side. | 1353 // if this is the controlled side. |
1353 if (ice_role_ == ICEROLE_CONTROLLED && !best_nominated_connection() && | 1354 if (ice_role_ == ICEROLE_CONTROLLED && !best_nominated_connection() && |
1354 connection->writable() && best_connection_ != connection) { | 1355 connection->writable() && best_connection_ != connection) { |
1355 SwitchBestConnectionTo(connection); | 1356 SwitchBestConnectionTo(connection); |
1356 } | 1357 } |
1357 } | 1358 } |
1358 | 1359 |
| 1360 void P2PTransportChannel::OnSentPacket(PortInterface* port, |
| 1361 const rtc::SentPacket& sent_packet) { |
| 1362 ASSERT(worker_thread_ == rtc::Thread::Current()); |
| 1363 |
| 1364 SignalSentPacket(this, sent_packet); |
| 1365 } |
| 1366 |
1359 void P2PTransportChannel::OnReadyToSend(Connection* connection) { | 1367 void P2PTransportChannel::OnReadyToSend(Connection* connection) { |
1360 if (connection == best_connection_ && writable()) { | 1368 if (connection == best_connection_ && writable()) { |
1361 SignalReadyToSend(this); | 1369 SignalReadyToSend(this); |
1362 } | 1370 } |
1363 } | 1371 } |
1364 | 1372 |
1365 } // namespace cricket | 1373 } // namespace cricket |
OLD | NEW |