mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
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:
parent
279f3b6a42
commit
8cdcee4307
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user