Chromium Code Reviews

Side by Side 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: First-cut Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 471 matching lines...)
482 rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX), 482 rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX),
483 cricket::NS_JINGLE_RTP, 483 cricket::NS_JINGLE_RTP,
484 false), 484 false),
485 // RFC 3264: The numeric value of the session id and version in the 485 // RFC 3264: The numeric value of the session id and version in the
486 // o line MUST be representable with a "64 bit signed integer". 486 // o line MUST be representable with a "64 bit signed integer".
487 // Due to this constraint session id |sid_| is max limited to LLONG_MAX. 487 // Due to this constraint session id |sid_| is max limited to LLONG_MAX.
488 channel_manager_(channel_manager), 488 channel_manager_(channel_manager),
489 mediastream_signaling_(mediastream_signaling), 489 mediastream_signaling_(mediastream_signaling),
490 ice_observer_(NULL), 490 ice_observer_(NULL),
491 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), 491 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew),
492 ice_flaky_(false),
pthatcher1 2015/06/24 23:42:52 Same here: we need a better name than ice_flaky.
492 older_version_remote_peer_(false), 493 older_version_remote_peer_(false),
493 dtls_enabled_(false), 494 dtls_enabled_(false),
494 data_channel_type_(cricket::DCT_NONE), 495 data_channel_type_(cricket::DCT_NONE),
495 ice_restart_latch_(new IceRestartAnswerLatch), 496 ice_restart_latch_(new IceRestartAnswerLatch),
496 metrics_observer_(NULL) { 497 metrics_observer_(NULL) {
497 } 498 }
498 499
499 WebRtcSession::~WebRtcSession() { 500 WebRtcSession::~WebRtcSession() {
500 // Destroy video_channel_ first since it may have a pointer to the 501 // Destroy video_channel_ first since it may have a pointer to the
501 // voice_channel_. 502 // voice_channel_.
(...skipping 892 matching lines...)
1394 if (old_state != PeerConnectionInterface::kIceConnectionCompleted) { 1395 if (old_state != PeerConnectionInterface::kIceConnectionCompleted) {
1395 ReportBestConnectionState(transport); 1396 ReportBestConnectionState(transport);
1396 } 1397 }
1397 } 1398 }
1398 1399
1399 void WebRtcSession::OnTransportFailed(cricket::Transport* transport) { 1400 void WebRtcSession::OnTransportFailed(cricket::Transport* transport) {
1400 ASSERT(signaling_thread()->IsCurrent()); 1401 ASSERT(signaling_thread()->IsCurrent());
1401 SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed); 1402 SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed);
1402 } 1403 }
1403 1404
1405 void WebRtcSession::OnTransportFlaky(cricket::Transport* transport) {
1406 ASSERT(signaling_thread()->IsCurrent());
1407 if (transport->HasChannels()) {
1408 SetIceFlaky(transport->all_channels_flaky());
1409 }
1410 }
1411
1412 void WebRtcSession::SetIceFlaky(bool flaky) {
1413 if (ice_flaky_ != flaky) {
pthatcher1 2015/06/24 23:42:52 Please use an early return.
honghaiz3 2015/08/05 23:56:56 Done.
1414 ice_flaky_ = flaky;
1415 if (ice_observer_) {
1416 ice_observer_->OnIceFlakinessChange(flaky);
1417 }
1418 }
1419 }
1420
1404 void WebRtcSession::OnTransportProxyCandidatesReady( 1421 void WebRtcSession::OnTransportProxyCandidatesReady(
1405 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { 1422 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) {
1406 ASSERT(signaling_thread()->IsCurrent()); 1423 ASSERT(signaling_thread()->IsCurrent());
1407 ProcessNewLocalCandidate(proxy->content_name(), candidates); 1424 ProcessNewLocalCandidate(proxy->content_name(), candidates);
1408 } 1425 }
1409 1426
1410 void WebRtcSession::OnCandidatesAllocationDone() { 1427 void WebRtcSession::OnCandidatesAllocationDone() {
1411 ASSERT(signaling_thread()->IsCurrent()); 1428 ASSERT(signaling_thread()->IsCurrent());
1412 if (ice_observer_) { 1429 if (ice_observer_) {
1413 ice_observer_->OnIceGatheringChange( 1430 ice_observer_->OnIceGatheringChange(
(...skipping 484 matching lines...)
1898 metrics_observer_->IncrementCounter(kBestConnections_IPv6); 1915 metrics_observer_->IncrementCounter(kBestConnections_IPv6);
1899 } else { 1916 } else {
1900 ASSERT(false); 1917 ASSERT(false);
1901 } 1918 }
1902 return; 1919 return;
1903 } 1920 }
1904 } 1921 }
1905 } 1922 }
1906 1923
1907 } // namespace webrtc 1924 } // namespace webrtc
OLDNEW

Powered by Google App Engine