Bug 1644009 - P3. Revert "Bug 1592488 - P8. Ensure AbstractThread exists with STS thread." r=valentin,necko-reviewers
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 12 Jun 2020 05:09:40 +0000
changeset 535241 12725e7040d6af4ca00341956e3b92a9c39da55f
parent 535240 70208fbe375552bd8b8db45655937c91e2b96964
child 535242 28097e44c058accdd125ce9a485bf1fee4f4cb5f
push id37500
push userncsoregi@mozilla.com
push dateFri, 12 Jun 2020 14:56:55 +0000
treeherdermozilla-central@9388507a8b1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, necko-reviewers
bugs1644009, 1592488
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
netwerk/base/nsSocketTransportService2.cpp
netwerk/base/nsSocketTransportService2.h
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/Preferences.h"
 #include "nsIOService.h"
 #include "nsASocketHandler.h"
 #include "nsError.h"
 #include "prnetdb.h"
 #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"
 #include "mozilla/PublicSSL.h"
 #include "mozilla/ChaosMode.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/ReverseIterator.h"
 #include "mozilla/Telemetry.h"
@@ -789,17 +788,16 @@ nsresult nsSocketTransportService::Shutd
   if (!mInitialized || !mShuttingDown) return NS_OK;
 
   // join with thread
   mThread->Shutdown();
   {
     MutexAutoLock lock(mLock);
     // Drop our reference to mThread and make sure that any concurrent
     // readers are excluded
-    mAbstractThread = nullptr;
     mThread = nullptr;
   }
 
   Preferences::UnregisterCallbacks(UpdatePrefs, gCallbackPrefs, this);
 
   nsCOMPtr<nsIObserverService> obsSvc = services::GetObserverService();
   if (obsSvc) {
     obsSvc->RemoveObserver(this, "profile-initial-state");
@@ -1039,18 +1037,16 @@ nsSocketTransportService::Run() {
     }
 
     mPollList[0].fd = mPollableEvent ? mPollableEvent->PollableFD() : nullptr;
     mPollList[0].in_flags = PR_POLL_READ | PR_POLL_EXCEPT;
     mPollList[0].out_flags = 0;
   }
 
   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);
   threadInt->SetObserver(this);
 
   // make sure the pseudo random number generator is seeded on this thread
   srand(static_cast<unsigned>(PR_Now()));
 
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -27,17 +27,16 @@
 
 class nsASocketHandler;
 struct PRPollDesc;
 class nsIPrefBranch;
 
 //-----------------------------------------------------------------------------
 
 namespace mozilla {
-class AbstractThread;
 namespace net {
 
 //
 // set MOZ_LOG=nsSocketTransport:5
 //
 extern LazyLogModule gSocketTransportLog;
 #define SOCKET_LOG(args) MOZ_LOG(gSocketTransportLog, LogLevel::Debug, args)
 #define SOCKET_LOG1(args) MOZ_LOG(gSocketTransportLog, LogLevel::Error, args)
@@ -139,20 +138,16 @@ class nsSocketTransportService final : p
   virtual ~nsSocketTransportService();
 
  private:
   //-------------------------------------------------------------------------
   // misc (any thread)
   //-------------------------------------------------------------------------
 
   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
   already_AddRefed<nsIThread> GetThreadSafely();
 
   //-------------------------------------------------------------------------
   // initialization and shutdown (any thread)
   //-------------------------------------------------------------------------