Bug 1280215 - Stop using the nsresult in OnProxyAvailable to determine whether the PCM is still interested. r=drno
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 15 Jun 2016 13:38:26 +0100
changeset 302560 50f2e8c8491eff303fe032a6df2a08a6df2511f3
parent 302559 063a3fe1aad1e47687474a66e6938ddfe044e37e
child 302561 9ed9514f571d2e3e8457641fce001a9da6181b65
push id19757
push userkwierso@gmail.com
push dateFri, 24 Jun 2016 20:41:59 +0000
treeherderfx-team@0cfc0fa7df03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1280215
milestone50.0a1
Bug 1280215 - Stop using the nsresult in OnProxyAvailable to determine whether the PCM is still interested. r=drno 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__);