Bug 1280215 - Stop using the nsresult in OnProxyAvailable to determine whether the PCM is still interested. r=drno, a=sylvestre
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 15 Jun 2016 13:38:26 +0100
changeset 341725 b6b52e21758a5ac9855ee5c2938df5cfc1415cb2
parent 341724 fd8d4ad885aa3adcc5d620d2a03aab15577664fc
child 341726 852f817ca2c4a23f0736c4407305341adbc99904
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, sylvestre
bugs1280215
milestone49.0a2
Bug 1280215 - Stop using the nsresult in OnProxyAvailable to determine whether the PCM is still interested. r=drno, a=sylvestre MozReview-Commit-ID: AIZm4VNZJtV
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -200,28 +200,29 @@ PeerConnectionImpl* PeerConnectionImpl::
 }
 
 NS_IMETHODIMP PeerConnectionMedia::ProtocolProxyQueryHandler::
 OnProxyAvailable(nsICancelable *request,
                  nsIChannel *aChannel,
                  nsIProxyInfo *proxyinfo,
                  nsresult result) {
 
-  if (result == NS_ERROR_ABORT) {
-    // NS_ERROR_ABORT means that the PeerConnectionMedia is no longer waiting
+  if (!pcm_->mProxyRequest) {
+    // PeerConnectionMedia is no longer waiting
     return NS_OK;
   }
 
   CSFLogInfo(logTag, "%s: Proxy Available: %d", __FUNCTION__, (int)result);
 
   if (NS_SUCCEEDED(result) && proxyinfo) {
     SetProxyOnPcm(*proxyinfo);
   }
 
   pcm_->mProxyResolveCompleted = true;
+  pcm_->mProxyRequest = nullptr;
   pcm_->FlushIceCtxOperationQueueIfReady();
 
   return NS_OK;
 }
 
 void
 PeerConnectionMedia::ProtocolProxyQueryHandler::SetProxyOnPcm(
     nsIProxyInfo& proxyinfo)
@@ -990,16 +991,17 @@ PeerConnectionMedia::SelfDestruct()
   }
 
   for (uint32_t i=0; i < mRemoteSourceStreams.Length(); ++i) {
     mRemoteSourceStreams[i]->DetachMedia_m();
   }
 
   if (mProxyRequest) {
     mProxyRequest->Cancel(NS_ERROR_ABORT);
+    mProxyRequest = nullptr;
   }
 
   // Shutdown the transport (async)
   RUN_ON_THREAD(mSTSThread, WrapRunnable(
       this, &PeerConnectionMedia::ShutdownMediaTransport_s),
                 NS_DISPATCH_NORMAL);
 
   CSFLogDebug(logTag, "%s: Media shut down", __FUNCTION__);