Chromium Code Reviews| Index: webrtc/p2p/base/port.cc |
| diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc |
| index d26a9302a8af7ba55bc98b3a979a331a6337ec71..c66c02b966fa2f006abf8b9a61aa315f495bd72a 100644 |
| --- a/webrtc/p2p/base/port.cc |
| +++ b/webrtc/p2p/base/port.cc |
| @@ -1298,11 +1298,19 @@ void Connection::HandleRoleConflictFromPeer() { |
| port_->SignalRoleConflict(port_); |
| } |
| -void Connection::MaybeSetRemoteIceCredentials(const std::string& ice_ufrag, |
| - const std::string& ice_pwd) { |
| - if (remote_candidate_.username() == ice_ufrag && |
| - remote_candidate_.password().empty()) { |
| - remote_candidate_.set_password(ice_pwd); |
| +void Connection::MaybeSetRemoteIceCredentialsAndGeneration( |
| + const std::vector<IceParameters>& remote_ice_parameters) { |
| + int generation = 0; |
| + for (const IceParameters& params : remote_ice_parameters) { |
| + if (remote_candidate_.username() == params.ufrag && |
| + remote_candidate_.password().empty()) { |
| + remote_candidate_.set_password(params.pwd); |
|
pthatcher1
2016/04/12 18:47:39
Should we also set_generation() here?
Taylor Brandstetter
2016/04/12 21:33:46
I guess it would be a small optimization. Or do we
pthatcher1
2016/04/12 22:39:53
Oh, I see. In the first case, you end up doing th
|
| + } |
| + if (remote_candidate_.username() == params.ufrag && |
| + remote_candidate_.password() == params.pwd) { |
| + remote_candidate_.set_generation(generation); |
| + } |
| + ++generation; |
| } |
| } |