Bug 1348732 - Let EventSource correctly fallback to main thread when retargeting to worker thread failed. r=baku
authorStone Shih <sshih@mozilla.com>
Mon, 20 Mar 2017 16:53:41 +0800
changeset 348656 a8ef959f05f6741a8778959f7d1db6fa38082d40
parent 348583 644fb64d056bb9b544192b9af878804ba2420ff5
child 348657 61809db0f8287313e8fe036c0c0b49f4ff4212a8
push id31533
push userkwierso@gmail.com
push dateTue, 21 Mar 2017 23:08:53 +0000
treeherdermozilla-central@8744e9f8eb99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1348732
milestone55.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 1348732 - Let EventSource correctly fallback to main thread when retargeting to worker thread failed. r=baku MozReview-Commit-ID: EUqzAKfeRZA
dom/base/EventSource.cpp
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -684,17 +684,19 @@ EventSourceImpl::OnStartRequest(nsIReque
     return NS_ERROR_ABORT;
   }
 
   if (!mIsMainThread) {
     // Try to retarget to worker thread, otherwise fall back to main thread.
     nsCOMPtr<nsIThreadRetargetableRequest> rr = do_QueryInterface(httpChannel);
     if (rr) {
       rv = rr->RetargetDeliveryTo(this);
-      NS_ENSURE_SUCCESS(rv, rv);
+      if (NS_WARN_IF(NS_FAILED(rv))) {
+        NS_WARNING("Retargeting failed");
+      }
     }
   }
   rv = Dispatch(NewRunnableMethod(this, &EventSourceImpl::AnnounceConnection),
                 NS_DISPATCH_NORMAL);
   NS_ENSURE_SUCCESS(rv, rv);
   mStatus = PARSE_STATE_BEGIN_OF_STREAM;
   return NS_OK;
 }