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 351966 adaed8be51ecbef8e73fac69097fbed33553df45
parent 351965 adfcc194af1c2f58b11271b57b3e676f8143c7d3
child 351967 eb60b1702ed9aa9dec06a0e6b7395aa373e88589
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;