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 335433 fc07494213988e640e8d4958189abc9fee57dfa9
parent 335432 f7521f8f54ab8e2f44ee50f88c29c375cc985899
child 335434 b06bd6e4b88705bb2de4b2c999a50f8f3b59afb2
push id1146
push userCallek@gmail.com
push dateMon, 25 Jul 2016 16:35:44 +0000
treeherdermozilla-release@a55778f9cd5a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, sylvestre
bugs1280215
milestone48.0
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
@@ -168,28 +168,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)
@@ -955,16 +956,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__);