Bug 1437640 - Implement nsIThreadRetargetableStreamListener in MutableBlobStreamListener, r=smaug

This commit is contained in:
Andrea Marchesini
2018-02-14 13:23:01 +01:00
parent 6f761d6f48
commit ac387512d8
6 changed files with 76 additions and 33 deletions

View File

@@ -13,6 +13,7 @@
#include "mozilla/dom/WorkerScope.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "nsIInputStreamPump.h"
#include "nsIThreadRetargetableRequest.h"
#include "nsProxyRelease.h"
namespace mozilla {
@@ -584,9 +585,7 @@ FetchBodyConsumer<Derived>::BeginConsumeBodyMainThread()
// Try to retarget, otherwise fall back to main thread.
nsCOMPtr<nsIThreadRetargetableRequest> rr = do_QueryInterface(pump);
nsCOMPtr<nsIThreadRetargetableStreamListener> rl =
do_QueryInterface(listener);
if (rr && rl) {
if (rr) {
nsCOMPtr<nsIEventTarget> sts = do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
rv = rr->RetargetDeliveryTo(sts);
if (NS_FAILED(rv)) {