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 348614 adaed8be51ecbef8e73fac69097fbed33553df45
parent 348613 adfcc194af1c2f58b11271b57b3e676f8143c7d3
child 348615 eb60b1702ed9aa9dec06a0e6b7395aa373e88589
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [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;