Chromium Code Reviews| Index: talk/app/webrtc/webrtcsession.cc | 
| diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc | 
| index 111a76cf23774081d00ee26e731e41403fc5ef32..33eea57928e865edf7602342ba774b1aeac26cbc 100644 | 
| --- a/talk/app/webrtc/webrtcsession.cc | 
| +++ b/talk/app/webrtc/webrtcsession.cc | 
| @@ -492,11 +492,16 @@ class IceRestartAnswerLatch { | 
| } | 
| } | 
| + // This method has two purposes: 1. Return whether |new_desc| requests | 
| + // an ICE restart (i.e., new ufrag/pwd). 2. If it requests an ICE restart | 
| + // and it is an OFFER, remember this in |ice_restart_| so that the next | 
| + // Local Answer will be created with new ufrag and pwd. | 
| bool CheckForRemoteIceRestart(const SessionDescriptionInterface* old_desc, | 
| const SessionDescriptionInterface* new_desc) { | 
| - if (!old_desc || new_desc->type() != SessionDescriptionInterface::kOffer) { | 
| + if (!old_desc) { | 
| return false; | 
| } | 
| + bool ice_restart = false; | 
| const SessionDescription* new_sd = new_desc->description(); | 
| const SessionDescription* old_sd = old_desc->description(); | 
| const ContentInfos& contents = new_sd->contents(); | 
| @@ -520,11 +525,15 @@ class IceRestartAnswerLatch { | 
| new_transport_desc->ice_ufrag, | 
| new_transport_desc->ice_pwd)) { | 
| LOG(LS_INFO) << "Remote peer request ice restart."; | 
| - ice_restart_ = true; | 
| - return true; | 
| + ice_restart = true; | 
| + break; | 
| 
 
pthatcher1
2015/12/11 01:49:00
I think it would be more clear to put this here:
 
honghaiz3
2015/12/11 18:46:10
Done.
 
 | 
| } | 
| } | 
| - return false; | 
| + if (ice_restart && | 
| + new_desc->type() == SessionDescriptionInterface::kOffer) { | 
| + ice_restart_ = true; | 
| + } | 
| + return ice_restart; | 
| } | 
| private: |