Bug 1644009 - P1. Revert "Bug 1592488 - P11. Ensure an AbstractThread exists for each WorkerThread." r=nika

DirectTask dispatching will now be directly handled by nsThread.

Differential Revision: https://phabricator.services.mozilla.com/D79085
This commit is contained in:
Jean-Yves Avenard 2020-06-12 05:09:26 +00:00
parent 279f3b6a42
commit 8cdcee4307
2 changed files with 0 additions and 19 deletions

View File

@ -95,8 +95,6 @@ SafeRefPtr<WorkerThread> WorkerThread::Create(
NS_WARNING("Failed to create new thread!");
return nullptr;
}
thread->mAbstractThread = AbstractThread::CreateXPCOMThreadWrapper(
thread.unsafeGetRawPtr(), false /* aRequireTailDispatch */);
return thread;
}
@ -334,14 +332,6 @@ PerformanceCounter* WorkerThread::GetPerformanceCounter(
return nullptr;
}
NS_IMETHODIMP
WorkerThread::Shutdown() {
MOZ_ALWAYS_SUCCEEDS(nsThread::Shutdown());
// We need to break the cycle.
mAbstractThread = nullptr;
return NS_OK;
}
NS_IMPL_ISUPPORTS(WorkerThread::Observer, nsIThreadObserver)
NS_IMETHODIMP

View File

@ -18,7 +18,6 @@
class nsIRunnable;
namespace mozilla {
class AbstractThread;
namespace dom {
class WorkerRunnable;
@ -57,12 +56,6 @@ class WorkerThread final : public nsThread {
// Protected by nsThread::mLock and waited on with mWorkerPrivateCondVar.
uint32_t mOtherThreadsDispatchingViaEventTarget;
// We create an AbstractThread for this current nsThread instance in order to
// support direct task dispatching. Direct tasks work in a similar fashion to
// microtasks and allow an IPDL MozPromise to behave like JS promise.
// An AbstractThread only need to exist on the current thread for Direct Task
// dispatch to be available.
RefPtr<AbstractThread> mAbstractThread;
#ifdef DEBUG
// Protected by nsThread::mLock.
bool mAcceptingNonWorkerRunnables;
@ -90,8 +83,6 @@ class WorkerThread final : public nsThread {
PerformanceCounter* GetPerformanceCounter(nsIRunnable* aEvent) const override;
NS_IMETHODIMP Shutdown() override;
NS_INLINE_DECL_REFCOUNTING_INHERITED(WorkerThread, nsThread)
private: