Bug 1290049 - only process ice connection state change if new state differs from old state. r=bwc a=ritu
authorMichael Froman <mfroman@mozilla.com>
Tue, 11 Oct 2016 22:14:23 -0500
changeset 356215 1dff984fccd0a367905ebae5e3dbefdbef187034
parent 356214 709ef83b84468f64b5b35f62003ef5ebb407d3cb
child 356216 2224ee69d0ac680094edd158ef1cf96d11cb5deb
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc, ritu
bugs1290049
milestone51.0a2
Bug 1290049 - only process ice connection state change if new state differs from old state. r=bwc a=ritu MozReview-Commit-ID: KAM1XVIn4Qw
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -3277,16 +3277,21 @@ static bool isFailed(PCImplIceConnection
 void PeerConnectionImpl::IceConnectionStateChange(
     NrIceCtx* ctx,
     NrIceCtx::ConnectionState state) {
   PC_AUTO_ENTER_API_CALL_VOID_RETURN(false);
 
   CSFLogDebug(logTag, "%s", __FUNCTION__);
 
   auto domState = toDomIceConnectionState(state);
+  if (domState == mIceConnectionState) {
+    // no work to be done since the states are the same.
+    // this can happen during ICE rollback situations.
+    return;
+  }
 
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
   if (!isDone(mIceConnectionState) && isDone(domState)) {
     // mIceStartTime can be null if going directly from New to Closed, in which
     // case we don't count it as a success or a failure.
     if (!mIceStartTime.IsNull()){
       TimeDuration timeDelta = TimeStamp::Now() - mIceStartTime;
       if (isSucceeded(domState)) {