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 321853 adaed8be51ecbef8e73fac69097fbed33553df45
parent 321852 adfcc194af1c2f58b11271b57b3e676f8143c7d3
child 321854 eb60b1702ed9aa9dec06a0e6b7395aa373e88589
push id83688
push useramarchesini@mozilla.com
push dateWed, 09 Nov 2016 17:21:42 +0000
treeherdermozilla-inbound@adaed8be51ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1316264
milestone52.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 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;