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

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1868353004: Update prflx candidates' generation when setting ICE credentials. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Only need to pass in the last ICE params and the generation. Created 4 years, 8 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 | « webrtc/p2p/base/candidate.h ('k') | webrtc/p2p/base/p2ptransportchannel_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 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // are prioritized over the older ones. 383 // are prioritized over the older ones.
384 remote_ice_parameters_.push_back(new_ice); 384 remote_ice_parameters_.push_back(new_ice);
385 } 385 }
386 386
387 // Update the pwd of remote candidate if needed. 387 // Update the pwd of remote candidate if needed.
388 for (RemoteCandidate& candidate : remote_candidates_) { 388 for (RemoteCandidate& candidate : remote_candidates_) {
389 if (candidate.username() == ice_ufrag && candidate.password().empty()) { 389 if (candidate.username() == ice_ufrag && candidate.password().empty()) {
390 candidate.set_password(ice_pwd); 390 candidate.set_password(ice_pwd);
391 } 391 }
392 } 392 }
393 // We need to update the credentials for any peer reflexive candidates. 393 // We need to update the credentials and generation for any peer reflexive
394 // candidates.
394 for (Connection* conn : connections_) { 395 for (Connection* conn : connections_) {
395 conn->MaybeSetRemoteIceCredentials(ice_ufrag, ice_pwd); 396 conn->MaybeSetRemoteIceCredentialsAndGeneration(
397 ice_ufrag, ice_pwd,
398 static_cast<int>(remote_ice_parameters_.size() - 1));
396 } 399 }
400 // Updating the remote ICE candidate generation could change the sort order.
401 RequestSort();
397 } 402 }
398 403
399 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { 404 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) {
400 remote_ice_mode_ = mode; 405 remote_ice_mode_ = mode;
401 } 406 }
402 407
403 void P2PTransportChannel::SetIceConfig(const IceConfig& config) { 408 void P2PTransportChannel::SetIceConfig(const IceConfig& config) {
404 config_.gather_continually = config.gather_continually; 409 config_.gather_continually = config.gather_continually;
405 LOG(LS_INFO) << "Set gather_continually to " << config_.gather_continually; 410 LOG(LS_INFO) << "Set gather_continually to " << config_.gather_continually;
406 411
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 1638
1634 // During the initial state when nothing has been pinged yet, return the first 1639 // During the initial state when nothing has been pinged yet, return the first
1635 // one in the ordered |connections_|. 1640 // one in the ordered |connections_|.
1636 return *(std::find_if(connections_.begin(), connections_.end(), 1641 return *(std::find_if(connections_.begin(), connections_.end(),
1637 [conn1, conn2](Connection* conn) { 1642 [conn1, conn2](Connection* conn) {
1638 return conn == conn1 || conn == conn2; 1643 return conn == conn1 || conn == conn2;
1639 })); 1644 }));
1640 } 1645 }
1641 1646
1642 } // namespace cricket 1647 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/candidate.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698