Bug 1644009 - P3. Revert "Bug 1592488 - P8. Ensure AbstractThread exists with STS thread." r=valentin,necko-reviewers

DirectTask dispatching will now be directly handled by nsThread.

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

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

@ -15,7 +15,6 @@
#include "prerror.h"
#include "nsServiceManagerUtils.h"
#include "nsIObserverService.h"
#include "mozilla/AbstractThread.h"
#include "mozilla/Atomics.h"
#include "mozilla/Services.h"
#include "mozilla/Likely.h"
@ -794,7 +793,6 @@ nsresult nsSocketTransportService::ShutdownThread() {
MutexAutoLock lock(mLock);
// Drop our reference to mThread and make sure that any concurrent
// readers are excluded
mAbstractThread = nullptr;
mThread = nullptr;
}
@ -1044,8 +1042,6 @@ nsSocketTransportService::Run() {
}
mRawThread = NS_GetCurrentThread();
mAbstractThread = AbstractThread::CreateXPCOMThreadWrapper(
mRawThread, false /* require taildispatch */);
// hook ourselves up to observe event processing for this thread
nsCOMPtr<nsIThreadInternal> threadInt = do_QueryInterface(mRawThread);

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

@ -32,7 +32,6 @@ class nsIPrefBranch;
//-----------------------------------------------------------------------------
namespace mozilla {
class AbstractThread;
namespace net {
//
@ -144,10 +143,6 @@ class nsSocketTransportService final : public nsPISocketTransportService,
//-------------------------------------------------------------------------
nsCOMPtr<nsIThread> mThread; // protected by mLock
// 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;
UniquePtr<PollableEvent> mPollableEvent;
// Returns mThread, protecting the get-and-addref with mLock