Bug 1644009 - P5. Revert "Bug 1592488 - P6. Ensure an AbstractThread exists with RemoteWorkerService thread." r=nika

DirectTask dispatching will now be directly handled by nsThread.

Differential Revision: https://phabricator.services.mozilla.com/D79089
This commit is contained in:
Jean-Yves Avenard 2020-06-12 05:09:55 +00:00
Родитель 8e4b7ba238
Коммит e8113eee35
2 изменённых файлов: 0 добавлений и 10 удалений

Просмотреть файл

@ -11,7 +11,6 @@
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/AbstractThread.h"
#include "mozilla/Services.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h"
@ -114,9 +113,6 @@ void RemoteWorkerService::InitializeOnTargetThread() {
MOZ_ASSERT(mThread);
MOZ_ASSERT(mThread->IsOnCurrentThread());
mAbstractThread = AbstractThread::CreateXPCOMThreadWrapper(
mThread, false /* aRequireTailDispatch */);
PBackgroundChild* actorChild = BackgroundChild::GetOrCreateForCurrentThread();
if (NS_WARN_IF(!actorChild)) {
return;
@ -146,7 +142,6 @@ void RemoteWorkerService::ShutdownOnTargetThread() {
nsCOMPtr<nsIRunnable> r =
NS_NewRunnableFunction("ShutdownOnMainThread", [self]() {
self->mThread->Shutdown();
self->mAbstractThread = nullptr;
self->mThread = nullptr;
});

Просмотреть файл

@ -13,7 +13,6 @@
class nsIThread;
namespace mozilla {
class AbstractThread;
namespace dom {
class RemoteWorkerServiceChild;
@ -39,10 +38,6 @@ class RemoteWorkerService final : public nsIObserver {
void ShutdownOnTargetThread();
nsCOMPtr<nsIThread> mThread;
// We create an AbstractThread for mThread thread so that we can use direct
// task dispatching with MozPromise, which is similar (but not identical to)
// the microtask semantics of JS promises.
RefPtr<AbstractThread> mAbstractThread;
RefPtr<RemoteWorkerServiceChild> mActor;
};