Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1363573002: Wire up transport sequence number / send time callbacks to webrtc via libjingle. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698