summaryrefslogtreecommitdiffstats
path: root/dom/workers/WorkerRunnable.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-18 16:31:30 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-18 16:31:30 +0200
commitabb2a2a1d4fd755510d71b7a6985e5076ed8c2ce (patch)
tree15953e11c470eea03182a175f83d7e67062e0458 /dom/workers/WorkerRunnable.cpp
parent89f2f76274916083a1533e8ead8374e12ccfa4a3 (diff)
parent0384dc34be59a77d74cc9a1f8e754694b95dd13a (diff)
downloadUXP-abb2a2a1d4fd755510d71b7a6985e5076ed8c2ce.tar
UXP-abb2a2a1d4fd755510d71b7a6985e5076ed8c2ce.tar.gz
UXP-abb2a2a1d4fd755510d71b7a6985e5076ed8c2ce.tar.lz
UXP-abb2a2a1d4fd755510d71b7a6985e5076ed8c2ce.tar.xz
UXP-abb2a2a1d4fd755510d71b7a6985e5076ed8c2ce.zip
Merge branch 'worker-fix'
Diffstat (limited to 'dom/workers/WorkerRunnable.cpp')
-rw-r--r--dom/workers/WorkerRunnable.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/dom/workers/WorkerRunnable.cpp b/dom/workers/WorkerRunnable.cpp
index 9e6d4cfb8..60d69d4e4 100644
--- a/dom/workers/WorkerRunnable.cpp
+++ b/dom/workers/WorkerRunnable.cpp
@@ -117,7 +117,10 @@ WorkerRunnable::DispatchInternal()
return NS_SUCCEEDED(parent->Dispatch(runnable.forget()));
}
- return NS_SUCCEEDED(mWorkerPrivate->DispatchToMainThread(runnable.forget()));
+ nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
+ MOZ_ASSERT(mainThread);
+
+ return NS_SUCCEEDED(mainThread->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL));
}
void
@@ -553,7 +556,10 @@ WorkerControlRunnable::DispatchInternal()
return NS_SUCCEEDED(parent->DispatchControlRunnable(runnable.forget()));
}
- return NS_SUCCEEDED(mWorkerPrivate->DispatchToMainThread(runnable.forget()));
+ nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
+ MOZ_ASSERT(mainThread);
+
+ return NS_SUCCEEDED(mainThread->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL));
}
NS_IMPL_ISUPPORTS_INHERITED0(WorkerControlRunnable, WorkerRunnable)
@@ -580,7 +586,10 @@ WorkerMainThreadRunnable::Dispatch(Status aFailStatus, ErrorResult& aRv)
return;
}
- DebugOnly<nsresult> rv = mWorkerPrivate->DispatchToMainThread(this);
+ RefPtr<WorkerMainThreadRunnable> runnable(this);
+
+ DebugOnly<nsresult> rv =
+ NS_DispatchToMainThread(runnable.forget(), NS_DISPATCH_NORMAL);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Should only fail after xpcom-shutdown-threads and we're gone by then");
@@ -670,7 +679,7 @@ WorkerProxyToMainThreadRunnable::Dispatch()
return false;
}
- if (NS_WARN_IF(NS_FAILED(mWorkerPrivate->DispatchToMainThread(this)))) {
+ if (NS_WARN_IF(NS_FAILED(NS_DispatchToMainThread(this)))) {
ReleaseWorker();
RunBackOnWorkerThread();
return false;