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

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 again 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') | webrtc/p2p/base/portallocator.h » ('J')
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 return ice_config; 1152 return ice_config;
1140 } 1153 }
1141 1154
1142 void WebRtcSession::SetIceConfig(const cricket::IceConfig& config) { 1155 void WebRtcSession::SetIceConfig(const cricket::IceConfig& config) {
1143 transport_controller_->SetIceConfig(config); 1156 transport_controller_->SetIceConfig(config);
1144 } 1157 }
1145 1158
1146 void WebRtcSession::MaybeStartGathering() { 1159 void WebRtcSession::MaybeStartGathering() {
1147 transport_controller_->MaybeStartGathering(); 1160 transport_controller_->MaybeStartGathering();
1148 } 1161 }
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 ssl_cipher_suite); 2000 ssl_cipher_suite);
1988 } 2001 }
1989 } 2002 }
1990 2003
1991 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { 2004 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) {
1992 RTC_DCHECK(worker_thread()->IsCurrent()); 2005 RTC_DCHECK(worker_thread()->IsCurrent());
1993 media_controller_->call_w()->OnSentPacket(sent_packet); 2006 media_controller_->call_w()->OnSentPacket(sent_packet);
1994 } 2007 }
1995 2008
1996 } // namespace webrtc 2009 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/webrtcsession_unittest.cc » ('j') | webrtc/p2p/base/portallocator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698