Chromium Code Reviews| Index: webrtc/p2p/base/p2ptransportchannel.cc |
| diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc |
| index 2a851f5c7259cf32c22d66b149b8e059249ed939..951292b22a8b601ab9ae60748dd2d2548afa0e44 100644 |
| --- a/webrtc/p2p/base/p2ptransportchannel.cc |
| +++ b/webrtc/p2p/base/p2ptransportchannel.cc |
| @@ -254,6 +254,8 @@ void P2PTransportChannel::AddConnection(Connection* connection) { |
| connection->set_receiving_timeout(receiving_timeout_); |
| connection->SignalReadPacket.connect( |
| this, &P2PTransportChannel::OnReadPacket); |
| + connection->SignalSentPacket.connect(this, |
| + &P2PTransportChannel::OnSentPacket); |
| connection->SignalReadyToSend.connect( |
| this, &P2PTransportChannel::OnReadyToSend); |
| connection->SignalStateChange.connect( |
| @@ -1342,6 +1344,17 @@ void P2PTransportChannel::OnReadPacket(Connection* connection, |
| } |
| } |
| +void P2PTransportChannel::OnSentPacket(Connection* connection, |
| + const rtc::SentPacket& packet_sent) { |
| + ASSERT(worker_thread_ == rtc::Thread::Current()); |
| + |
| + // Do not deliver if packet doesn't belong to the correct transport channel. |
| + if (!FindConnection(connection)) |
|
pthatcher1
2015/09/25 23:24:58
I don't think this check is necessary. And, do we
stefan-webrtc
2015/09/28 12:10:50
I mostly did this to follow the convention in OnRe
pthatcher1
2015/09/28 23:58:40
I don't really think the check in OnReadPacket is
stefan-webrtc
2015/10/02 13:29:12
No, that doesn't make a lot of sense. Fixing.
|
| + return; |
| + |
| + SignalSentPacket(this, packet_sent); |
| +} |
| + |
| void P2PTransportChannel::OnReadyToSend(Connection* connection) { |
| if (connection == best_connection_ && writable()) { |
| SignalReadyToSend(this); |