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

Side by Side Diff: webrtc/api/webrtcsession.cc

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/webrtcsession_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 std::string error; 1121 std::string error;
1122 bool res = transport_controller_->RemoveRemoteCandidates(candidates, &error); 1122 bool res = transport_controller_->RemoveRemoteCandidates(candidates, &error);
1123 if (!res && !error.empty()) { 1123 if (!res && !error.empty()) {
1124 LOG(LS_ERROR) << "Error when removing remote candidates: " << error; 1124 LOG(LS_ERROR) << "Error when removing remote candidates: " << error;
1125 } 1125 }
1126 return true; 1126 return true;
1127 } 1127 }
1128 1128
1129 cricket::IceConfig WebRtcSession::ParseIceConfig( 1129 cricket::IceConfig WebRtcSession::ParseIceConfig(
1130 const PeerConnectionInterface::RTCConfiguration& config) const { 1130 const PeerConnectionInterface::RTCConfiguration& config) const {
1131 cricket::ContinualGatheringPolicy gathering_policy;
1132 // TODO(honghaiz): Add the third continual gathering policy in
1133 // PeerConnectionInterface and map it to GATHER_CONTINUALLY_AND_RECOVER.
1134 switch (config.continual_gathering_policy) {
1135 case PeerConnectionInterface::GATHER_ONCE:
1136 gathering_policy = cricket::GATHER_ONCE;
1137 break;
1138 case PeerConnectionInterface::GATHER_CONTINUALLY:
1139 gathering_policy = cricket::GATHER_CONTINUALLY;
1140 break;
1141 default:
1142 RTC_DCHECK(false);
1143 gathering_policy = cricket::GATHER_ONCE;
1144 }
1131 cricket::IceConfig ice_config; 1145 cricket::IceConfig ice_config;
1132 ice_config.receiving_timeout = config.ice_connection_receiving_timeout; 1146 ice_config.receiving_timeout = config.ice_connection_receiving_timeout;
1133 ice_config.prioritize_most_likely_candidate_pairs = 1147 ice_config.prioritize_most_likely_candidate_pairs =
1134 config.prioritize_most_likely_ice_candidate_pairs; 1148 config.prioritize_most_likely_ice_candidate_pairs;
1135 ice_config.backup_connection_ping_interval = 1149 ice_config.backup_connection_ping_interval =
1136 config.ice_backup_candidate_pair_ping_interval; 1150 config.ice_backup_candidate_pair_ping_interval;
1137 ice_config.gather_continually = (config.continual_gathering_policy == 1151 ice_config.continual_gathering_policy = gathering_policy;
1138 PeerConnectionInterface::GATHER_CONTINUALLY);
1139 ice_config.presume_writable_when_fully_relayed = 1152 ice_config.presume_writable_when_fully_relayed =
1140 config.presume_writable_when_fully_relayed; 1153 config.presume_writable_when_fully_relayed;
1141 return ice_config; 1154 return ice_config;
1142 } 1155 }
1143 1156
1144 void WebRtcSession::SetIceConfig(const cricket::IceConfig& config) { 1157 void WebRtcSession::SetIceConfig(const cricket::IceConfig& config) {
1145 transport_controller_->SetIceConfig(config); 1158 transport_controller_->SetIceConfig(config);
1146 } 1159 }
1147 1160
1148 void WebRtcSession::MaybeStartGathering() { 1161 void WebRtcSession::MaybeStartGathering() {
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 ssl_cipher_suite); 2002 ssl_cipher_suite);
1990 } 2003 }
1991 } 2004 }
1992 2005
1993 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { 2006 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) {
1994 RTC_DCHECK(worker_thread()->IsCurrent()); 2007 RTC_DCHECK(worker_thread()->IsCurrent());
1995 media_controller_->call_w()->OnSentPacket(sent_packet); 2008 media_controller_->call_w()->OnSentPacket(sent_packet);
1996 } 2009 }
1997 2010
1998 } // namespace webrtc 2011 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698