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

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

Issue 1356103002: Revert of Replace readable with receiving where receiving means receiving anything (stun ping, response or da… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@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
« no previous file with comments | « webrtc/p2p/base/transport.h ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transport.cc
diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc
index d626ad3d65acf284a6022428cbfb43615a6d07e3..3322e3898ab35f58f625e702081ee98b70a9f1c0 100644
--- a/webrtc/p2p/base/transport.cc
+++ b/webrtc/p2p/base/transport.cc
@@ -25,6 +25,7 @@
enum {
MSG_ONSIGNALINGREADY = 1,
MSG_ONREMOTECANDIDATE,
+ MSG_READSTATE,
MSG_WRITESTATE,
MSG_REQUESTSIGNALING,
MSG_CANDIDATEREADY,
@@ -237,6 +238,7 @@
if (local_description_ && remote_description_)
ApplyNegotiatedTransportDescription_w(impl, NULL);
+ impl->SignalReadableState.connect(this, &Transport::OnChannelReadableState);
impl->SignalWritableState.connect(this, &Transport::OnChannelWritableState);
impl->SignalReceivingState.connect(this, &Transport::OnChannelReceivingState);
impl->SignalRequestSignaling.connect(
@@ -491,6 +493,20 @@
}
}
+void Transport::OnChannelReadableState(TransportChannel* channel) {
+ ASSERT(worker_thread()->IsCurrent());
+ signaling_thread()->Post(this, MSG_READSTATE, NULL);
+}
+
+void Transport::OnChannelReadableState_s() {
+ ASSERT(signaling_thread()->IsCurrent());
+ TransportState readable = GetTransportState_s(TRANSPORT_READABLE_STATE);
+ if (readable_ != readable) {
+ readable_ = readable;
+ SignalReadableState(this);
+ }
+}
+
void Transport::OnChannelWritableState(TransportChannel* channel) {
ASSERT(worker_thread()->IsCurrent());
signaling_thread()->Post(this, MSG_WRITESTATE, NULL);
@@ -531,6 +547,9 @@
for (const auto iter : channels_) {
bool b = false;
switch (state_type) {
+ case TRANSPORT_READABLE_STATE:
+ b = iter.second->readable();
+ break;
case TRANSPORT_WRITABLE_STATE:
b = iter.second->writable();
break;
@@ -851,6 +870,9 @@
case MSG_CONNECTING:
OnConnecting_s();
break;
+ case MSG_READSTATE:
+ OnChannelReadableState_s();
+ break;
case MSG_WRITESTATE:
OnChannelWritableState_s();
break;
« no previous file with comments | « webrtc/p2p/base/transport.h ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698