Bug 1316264 - Return value of nsIEventTarget::IsOnCurrentThread() must be checked correctly in RemoteBlob, r=bkelly
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 09 Nov 2016 18:21:16 +0100
changeset 321949 adaed8be51ecbef8e73fac69097fbed33553df45
parent 321948 adfcc194af1c2f58b11271b57b3e676f8143c7d3
child 321950 eb60b1702ed9aa9dec06a0e6b7395aa373e88589
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersbkelly
bugs1316264
milestone52.0a1
Bug 1316264 - Return value of nsIEventTarget::IsOnCurrentThread() must be checked correctly in RemoteBlob, r=bkelly
dom/ipc/Blob.cpp
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -204,17 +204,21 @@ ActorManagerIsSameProcess(PBackgroundPar
 bool
 EventTargetIsOnCurrentThread(nsIEventTarget* aEventTarget)
 {
   if (!aEventTarget) {
     return NS_IsMainThread();
   }
 
   bool current;
-  MOZ_ALWAYS_SUCCEEDS(aEventTarget->IsOnCurrentThread(&current));
+
+  // If this fails, we are probably shutting down.
+  if (NS_WARN_IF(NS_FAILED(aEventTarget->IsOnCurrentThread(&current)))) {
+    return true;
+  }
 
   return current;
 }
 
 class CancelableRunnableWrapper final
   : public CancelableRunnable
 {
   nsCOMPtr<nsIRunnable> mRunnable;