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

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 comments and add tests 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..3277779e53beea89fc84e97f70231849898ea6fc 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,30 @@ void WebRtcSession::OnTransportFailed(cricket::Transport* transport) {
SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed);
}
+void WebRtcSession::OnTransportReceiving(cricket::Transport* transp) {
pthatcher1 2015/07/07 20:49:55 transp?
honghaiz3 2015/08/05 23:56:57 The parameter is not used and I wanted to avoid th
+ ASSERT(signaling_thread()->IsCurrent());
+ // The ice connection is considered not_receiving if every transport is
+ // not receiving on any channels.
+ bool not_receiving = true;
+ for (const auto& kv : transport_proxies()) {
+ cricket::Transport* transport = kv.second->impl();
+ if (transport && transport->HasChannels()) {
+ not_receiving &= transport->no_channel_receiving();
+ }
+ }
+ SetIceConnectionReceiving(!not_receiving);
pthatcher1 2015/07/07 20:49:55 Actually, now that I see it, I think it would be m
honghaiz3 2015/08/05 23:56:57 Done. This is better. Thanks!
+}
+
+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());

Powered by Google App Engine
This is Rietveld 408576698