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

Unified Diff: talk/app/webrtc/webrtcsession.cc

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address more comments Created 5 years, 5 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: talk/app/webrtc/webrtcsession.cc
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index c0898ff79f3696ddc3ed2b0129503c5ab616bb97..a3ff934dbc00c244dd4453922fe73dad68c9a431 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -490,6 +490,7 @@ WebRtcSession::WebRtcSession(
mediastream_signaling_(mediastream_signaling),
ice_observer_(NULL),
ice_connection_state_(PeerConnectionInterface::kIceConnectionNew),
+ ice_connection_receiving_(true),
older_version_remote_peer_(false),
dtls_enabled_(false),
data_channel_type_(cricket::DCT_NONE),
@@ -1406,6 +1407,31 @@ void WebRtcSession::OnTransportFailed(cricket::Transport* transport) {
SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed);
}
+void WebRtcSession::OnTransportReceiving(cricket::Transport* transport) {
+ ASSERT(signaling_thread()->IsCurrent());
+ // The ice connection is considered receiving if at least one transport is
+ // receiving on any channels.
+ bool receiving = false;
+ for (const auto& kv : transport_proxies()) {
+ cricket::Transport* transport = kv.second->impl();
+ if (transport && transport->any_channel_receiving()) {
+ receiving = true;
+ break;
+ }
+ }
+ SetIceConnectionReceiving(receiving);
+}
+
+void WebRtcSession::SetIceConnectionReceiving(bool receiving) {
+ if (ice_connection_receiving_ == receiving) {
+ return;
+ }
+ ice_connection_receiving_ = receiving;
+ if (ice_observer_) {
+ ice_observer_->OnIceConnectionReceivingChange(receiving);
+ }
+}
+
void WebRtcSession::OnTransportProxyCandidatesReady(
cricket::TransportProxy* proxy, const cricket::Candidates& candidates) {
ASSERT(signaling_thread()->IsCurrent());
« no previous file with comments | « talk/app/webrtc/webrtcsession.h ('k') | talk/examples/android/src/org/appspot/apprtc/PeerConnectionClient.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698