Bug 1414549: Correctly handle GetDeliveryTarget failure. r=mixedpuppy
authorKris Maglione <maglione.k@gmail.com>
Sun, 05 Nov 2017 19:22:38 -0800
changeset 444104 67462ac2d7142c01ffab6064738cdf7efbe2c01e
parent 444103 3acb30b37718b0abc626416b9554acbc880a0078
child 444105 e5b4f7ad5fc4e232dfdcf047c2a8d8f512911c10
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1414549
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1414549: Correctly handle GetDeliveryTarget failure. r=mixedpuppy getter_AddRefs nulls its parameter before passing it to the getter function, which means that on failure, we wind up with a null IO thread, rather than its original main thread value. MozReview-Commit-ID: 1SSIeNtiBq9
toolkit/components/extensions/webrequest/StreamFilterParent.cpp
--- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
+++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
@@ -413,18 +413,21 @@ StreamFilterParent::OnStartRequest(nsIRe
     });
   }
 
   nsresult rv = mOrigListener->OnStartRequest(aRequest, aContext);
 
   // Important: Do this only *after* running the next listener in the chain, so
   // that we get the final delivery target after any retargeting that it may do.
   if (nsCOMPtr<nsIThreadRetargetableRequest> req = do_QueryInterface(aRequest)) {
-    Unused << req->GetDeliveryTarget(getter_AddRefs(mIOThread));
-    MOZ_ASSERT(mIOThread);
+    nsCOMPtr<nsIEventTarget> thread;
+    Unused << req->GetDeliveryTarget(getter_AddRefs(thread));
+    if (thread) {
+      mIOThread = Move(thread);
+    }
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 StreamFilterParent::OnStopRequest(nsIRequest* aRequest,
                                   nsISupports* aContext,