Backed out 6 changesets (bug 1809752, bug 1809753) for causing perma failures in browser/components/firefoxview/tests/browser/browser_feature_callout_position.js

Backed out changeset ea05784d74c4 (bug 1809753)
Backed out changeset 7c9b20eebcc8 (bug 1809753)
Backed out changeset d0267ac2256d (bug 1809753)
Backed out changeset aa9f2971bd6f (bug 1809753)
Backed out changeset f0d9fcfaa6f8 (bug 1809752)
Backed out changeset 6d58c799cffe (bug 1809752)
This commit is contained in:
Sandor Molnar 2023-01-17 03:19:24 +02:00
Родитель 469df50089
Коммит 41b78439d0
126 изменённых файлов: 271 добавлений и 242 удалений

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

@ -683,7 +683,7 @@ void CCGCScheduler::EnsureCCRunner(TimeDuration aDelay, TimeDuration aBudget) {
minimumBudget, true, [this] { return mDidShutdown; });
} else {
mCCRunner->SetMinimumUsefulBudget(minimumBudget.ToMilliseconds());
nsIEventTarget* target = mozilla::GetCurrentSerialEventTarget();
nsIEventTarget* target = mozilla::GetCurrentEventTarget();
if (target) {
mCCRunner->SetTimer(aDelay, target);
}

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

@ -52,7 +52,7 @@ class SurfaceHelper : public Runnable {
}
already_AddRefed<gfx::DataSourceSurface> GetDataSurfaceSafe() {
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
MOZ_ASSERT(mainTarget);
SyncRunnable::DispatchToThread(mainTarget, this, false);
@ -88,9 +88,9 @@ class EncodingCompleteEvent final : public DiscardableRunnable {
mEncodeCompleteCallback(aEncodeCompleteCallback),
mFailed(false) {
if (!NS_IsMainThread() && IsCurrentThreadRunningWorker()) {
mCreationEventTarget = GetCurrentSerialEventTarget();
mCreationEventTarget = GetCurrentEventTarget();
} else {
mCreationEventTarget = GetMainThreadSerialEventTarget();
mCreationEventTarget = GetMainThreadEventTarget();
}
}

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

@ -183,7 +183,7 @@ Nullable<WindowProxyHolder> InProcessBrowserChildMessageManager::GetContent(
already_AddRefed<nsIEventTarget>
InProcessBrowserChildMessageManager::GetTabEventTarget() {
nsCOMPtr<nsIEventTarget> target = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> target = GetMainThreadEventTarget();
return target.forget();
}

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

@ -341,7 +341,7 @@ StructuredCloneHolder::StructuredCloneHolder(
mGlobal(nullptr)
#ifdef DEBUG
,
mCreationEventTarget(GetCurrentSerialEventTarget())
mCreationEventTarget(GetCurrentEventTarget())
#endif
{
}

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

@ -1977,7 +1977,7 @@ static bool DispatchToEventLoop(void* closure,
// simply NS_DispatchToMainThread. Failure during shutdown is expected and
// properly handled by the JS engine.
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
if (!mainTarget) {
return false;
}

2
dom/cache/Context.cpp поставляемый
Просмотреть файл

@ -475,7 +475,7 @@ class Context::ActionRunnable final : public nsIRunnable,
mTarget(aTarget),
mAction(std::move(aAction)),
mDirectoryMetadata(aDirectoryMetadata),
mInitiatingThread(GetCurrentSerialEventTarget()),
mInitiatingThread(GetCurrentEventTarget()),
mState(STATE_INIT),
mResult(NS_OK),
mExecutingRunOnTarget(false) {

3
dom/cache/Manager.cpp поставляемый
Просмотреть файл

@ -1959,7 +1959,8 @@ void Manager::Init(Maybe<Manager&> aOldManager) {
// per Manager now, this lets us cleanly call Factory::Remove() once the
// Context goes away.
SafeRefPtr<Context> ref = Context::Create(
SafeRefPtrFromThis(), mIOThread, MakeSafeRefPtr<SetupAction>(),
SafeRefPtrFromThis(), mIOThread->SerialEventTarget(),
MakeSafeRefPtr<SetupAction>(),
aOldManager ? SomeRef(*aOldManager->mContext) : Nothing());
mContext = ref.unsafeGetRawPtr();
}

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

@ -161,13 +161,13 @@ RefPtr<FetchServicePromises> FetchService::FetchInstance::Fetch() {
// Create a FetchDriver instance
mFetchDriver = MakeRefPtr<FetchDriver>(
mRequest.clonePtr(), // Fetch Request
mPrincipal, // Principal
mLoadGroup, // LoadGroup
GetMainThreadSerialEventTarget(), // MainThreadEventTarget
mCookieJarSettings, // CookieJarSettings
mPerformanceStorage, // PerformanceStorage
false // IsTrackingFetch
mRequest.clonePtr(), // Fetch Request
mPrincipal, // Principal
mLoadGroup, // LoadGroup
GetMainThreadEventTarget(), // MainThreadEventTarget
mCookieJarSettings, // CookieJarSettings
mPerformanceStorage, // PerformanceStorage
false // IsTrackingFetch
);
// Call FetchDriver::Fetch to start fetching.

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

@ -288,7 +288,7 @@ MutableBlobStorage::MutableBlobStorage(MutableBlobStorageType aType,
MOZ_ASSERT(NS_IsMainThread());
if (!mEventTarget) {
mEventTarget = GetMainThreadSerialEventTarget();
mEventTarget = GetMainThreadEventTarget();
}
if (aMaxMemory == 0 && aType == eCouldBeInTemporaryFile) {

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

@ -23,7 +23,7 @@ MutableBlobStreamListener::MutableBlobStreamListener(
MOZ_ASSERT(aCallback);
if (!mEventTarget) {
mEventTarget = GetMainThreadSerialEventTarget();
mEventTarget = GetMainThreadEventTarget();
}
MOZ_ASSERT(mEventTarget);

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

@ -13,7 +13,7 @@
namespace mozilla::dom {
FileCreatorParent::FileCreatorParent()
: mBackgroundEventTarget(GetCurrentSerialEventTarget()), mIPCActive(true) {}
: mBackgroundEventTarget(GetCurrentEventTarget()), mIPCActive(true) {}
FileCreatorParent::~FileCreatorParent() = default;

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

@ -84,7 +84,7 @@ class CheckPermissionRunnable final : public Runnable {
mActor(aActor),
mTask(aTask),
mPath(aPath),
mBackgroundEventTarget(GetCurrentSerialEventTarget()) {
mBackgroundEventTarget(GetCurrentEventTarget()) {
AssertIsInMainProcess();
AssertIsOnBackgroundThread();

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

@ -156,7 +156,7 @@ FileSystemTaskParentBase::FileSystemTaskParentBase(
mErrorValue(NS_OK),
mFileSystem(aFileSystem),
mRequestParent(aParent),
mBackgroundEventTarget(GetCurrentSerialEventTarget()) {
mBackgroundEventTarget(GetCurrentEventTarget()) {
MOZ_ASSERT(XRE_IsParentProcess(), "Only call from parent process!");
MOZ_ASSERT(aFileSystem, "aFileSystem should not be null.");
MOZ_ASSERT(aParent);

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

@ -47,7 +47,7 @@ GamepadEventChannelParent::Create() {
GamepadEventChannelParent::GamepadEventChannelParent() : mIsShutdown{false} {
MOZ_DIAGNOSTIC_ASSERT(IsOnBackgroundThread());
mBackgroundEventTarget = GetCurrentSerialEventTarget();
mBackgroundEventTarget = GetCurrentEventTarget();
RefPtr<GamepadPlatformService> service =
GamepadPlatformService::GetParentService();

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

@ -1017,7 +1017,7 @@ void Geolocation::GetCurrentPosition(PositionCallback& aCallback,
static nsIEventTarget* MainThreadTarget(Geolocation* geo) {
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryReferent(geo->GetOwner());
if (!window) {
return GetMainThreadSerialEventTarget();
return GetMainThreadEventTarget();
}
return nsGlobalWindowInner::Cast(window)->EventTargetFor(
mozilla::TaskCategory::Other);

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

@ -1885,7 +1885,7 @@ class DatabaseOperationBase : public Runnable,
DatabaseOperationBase(const nsID& aBackgroundChildLoggingId,
uint64_t aLoggingSerialNumber)
: Runnable("dom::indexedDB::DatabaseOperationBase"),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mBackgroundChildLoggingId(aBackgroundChildLoggingId),
mLoggingSerialNumber(aLoggingSerialNumber),
mOperationMayProceed(true) {
@ -8729,7 +8729,7 @@ ConnectionPool::ConnectionRunnable::ConnectionRunnable(
DatabaseInfo& aDatabaseInfo)
: Runnable("dom::indexedDB::ConnectionPool::ConnectionRunnable"),
mDatabaseInfo(aDatabaseInfo),
mOwningEventTarget(GetCurrentSerialEventTarget()) {
mOwningEventTarget(GetCurrentEventTarget()) {
AssertIsOnBackgroundThread();
MOZ_ASSERT(aDatabaseInfo.mConnectionPool);
aDatabaseInfo.mConnectionPool->AssertIsOnOwningThread();
@ -8866,7 +8866,7 @@ ConnectionPool::FinishCallbackWrapper::FinishCallbackWrapper(
: Runnable("dom::indexedDB::ConnectionPool::FinishCallbackWrapper"),
mConnectionPool(aConnectionPool),
mCallback(aCallback),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mTransactionId(aTransactionId),
mHasRunOnce(false) {
AssertIsOnBackgroundThread();
@ -9531,7 +9531,7 @@ Database::Database(SafeRefPtr<Factory> aFactory,
mFileHandleDisabled(aFileHandleDisabled),
mChromeWriteAccessAllowed(aChromeWriteAccessAllowed),
mInPrivateBrowsing(aInPrivateBrowsing),
mBackgroundThread(GetCurrentSerialEventTarget())
mBackgroundThread(GetCurrentEventTarget())
#ifdef DEBUG
,
mAllBlobsUnmapped(false)
@ -12932,7 +12932,7 @@ void QuotaClient::StartIdleMaintenance() {
return;
}
mBackgroundThread = GetCurrentSerialEventTarget();
mBackgroundThread = GetCurrentEventTarget();
mMaintenanceQueue.EmplaceBack(MakeRefPtr<Maintenance>(this));
ProcessMaintenanceQueue();
@ -13193,7 +13193,7 @@ void QuotaClient::ProcessMaintenanceQueue() {
DeleteFilesRunnable::DeleteFilesRunnable(
SafeRefPtr<DatabaseFileManager> aFileManager, nsTArray<int64_t>&& aFileIds)
: Runnable("dom::indexeddb::DeleteFilesRunnable"),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mFileManager(std::move(aFileManager)),
mFileIds(std::move(aFileIds)),
mState(State_Initial) {}

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

@ -1187,7 +1187,7 @@ class DatastoreOperationBase : public Runnable {
protected:
DatastoreOperationBase()
: Runnable("dom::DatastoreOperationBase"),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mResultCode(NS_OK),
mMayProceedOnNonOwningThread(true),
mMayProceed(true) {}

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

@ -153,7 +153,7 @@ class RequestHelper final : public Runnable, public LSRequestChildCallback {
RequestHelper(LSObject* aObject, const LSRequestParams& aParams)
: Runnable("dom::RequestHelper"),
mObject(aObject),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mActor(nullptr),
mParams(aParams),
mMonitor("dom::RequestHelper::mMonitor"),

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

@ -96,7 +96,7 @@ class AsyncRequestHelper final : public Runnable,
const LSRequestParams& aParams)
: Runnable("dom::LocalStorageManager2::AsyncRequestHelper"),
mManager(aManager),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mActor(nullptr),
mPromise(aPromise),
mParams(aParams),

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

@ -142,7 +142,7 @@ void ThreadedDriver::Start() {
// See AudioInitTask
nsresult rv = NS_NewNamedThread("MediaTrackGrph", getter_AddRefs(mThread));
if (NS_SUCCEEDED(rv)) {
mThread->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
mThread->EventTarget()->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
}
}

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

@ -445,7 +445,7 @@ class ThreadedDriver : public GraphDriver {
nsIThread* Thread() const { return mThread; }
bool OnThread() const override {
return !mThread || mThread->IsOnCurrentThread();
return !mThread || mThread->EventTarget()->IsOnCurrentThread();
}
bool ThreadRunning() const override { return mThreadRunning; }

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

@ -153,7 +153,9 @@ NS_IMETHODIMP GraphRunner::Run() {
return NS_OK;
}
bool GraphRunner::OnThread() const { return mThread->IsOnCurrentThread(); }
bool GraphRunner::OnThread() const {
return mThread->EventTarget()->IsOnCurrentThread();
}
#ifdef DEBUG
bool GraphRunner::InDriverIteration(const GraphDriver* aDriver) const {

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

@ -827,7 +827,7 @@ nsresult SimpleTimer::Init(nsIRunnable* aTask, uint32_t aTimeoutMs,
if (aTarget) {
target = aTarget;
} else {
target = GetMainThreadSerialEventTarget();
target = GetMainThreadEventTarget();
if (!target) {
return NS_ERROR_NOT_AVAILABLE;
}

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

@ -158,7 +158,7 @@ void MediaKeys::OnInnerWindowDestroy() {
// Don't call shutdown directly because (at time of writing) mProxy can
// spin the event loop when it's shutdown. This can change the world state
// in the middle of window destruction, which we do not want.
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NewRunnableMethod("MediaKeys::Shutdown", this, &MediaKeys::Shutdown));
}

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

@ -142,7 +142,7 @@ nsCOMPtr<nsISerialEventTarget> GMPContentParent::GMPEventTarget() {
mps->GetThread(getter_AddRefs(gmpThread));
MOZ_ASSERT(gmpThread);
mGMPEventTarget = gmpThread;
mGMPEventTarget = gmpThread->SerialEventTarget();
}
return mGMPEventTarget;

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

@ -563,7 +563,7 @@ nsCOMPtr<nsISerialEventTarget> GMPParent::GMPEventTarget() {
// nullptr if the GeckoMediaPluginService has started shutdown.
nsCOMPtr<nsIThread> gmpThread;
mps->GetThread(getter_AddRefs(gmpThread));
return gmpThread;
return gmpThread ? gmpThread->SerialEventTarget() : nullptr;
}
/* static */

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

@ -406,7 +406,7 @@ class CDMStorageTest {
nsCString failureReason;
self->mCDM
->Init(self->mCallback.get(), false, true,
GetMainThreadSerialEventTarget())
GetMainThreadEventTarget())
->Then(
thread, __func__,
[self, updates = std::move(updates)] {

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

@ -18,8 +18,7 @@ class DriftCompensatorTest : public ::testing::Test {
DriftCompensatorTest()
: mStart(TimeStamp::Now()),
mComp(MakeRefPtr<DriftCompensator>(GetCurrentSerialEventTarget(),
mRate)) {
mComp(MakeRefPtr<DriftCompensator>(GetCurrentEventTarget(), mRate)) {
mComp->NotifyAudioStart(mStart);
// NotifyAudioStart dispatched a runnable to update the audio mStart time on
// the video thread. Because this is a test, the video thread is the current

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

@ -36,7 +36,7 @@ struct InitParam {
class MockDriftCompensator : public DriftCompensator {
public:
MockDriftCompensator()
: DriftCompensator(GetCurrentSerialEventTarget(), VIDEO_TRACK_RATE) {
: DriftCompensator(GetCurrentEventTarget(), VIDEO_TRACK_RATE) {
ON_CALL(*this, GetVideoTime(_, _))
.WillByDefault(Invoke([](TimeStamp, TimeStamp t) { return t; }));
}

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

@ -233,7 +233,7 @@ void DecoderBenchmark::CheckVersion(const nsACString& aDecoderName) {
}
DebugOnly<nsresult> rv =
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
"DecoderBenchmark::CheckVersion", [name, version]() {
BenchmarkStorageChild::Instance()->SendCheckVersion(name, version);
}));

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

@ -334,7 +334,7 @@ void PDMFactory::EnsureInit() {
initalization();
return;
}
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction(
"PDMFactory::EnsureInit", std::move(initalization));
SyncRunnable::DispatchToThread(mainTarget, runnable);

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

@ -253,8 +253,7 @@ bool WMFDecoderModule::CanCreateMFTDecoder(const WMFStreamType& aType) {
} else {
nsCOMPtr<nsIRunnable> runnable =
NS_NewRunnableFunction("WMFDecoderModule::Init", [&]() { Init(); });
SyncRunnable::DispatchToThread(GetMainThreadSerialEventTarget(),
runnable);
SyncRunnable::DispatchToThread(GetMainThreadEventTarget(), runnable);
}
}

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

@ -123,7 +123,7 @@ class HRTFDatabaseLoader::ProxyReleaseEvent final : public Runnable {
};
void HRTFDatabaseLoader::ProxyRelease() {
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
if (MOZ_LIKELY(mainTarget)) {
RefPtr<ProxyReleaseEvent> event = new ProxyReleaseEvent(this);
DebugOnly<nsresult> rv = mainTarget->Dispatch(event, NS_DISPATCH_NORMAL);

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

@ -695,7 +695,7 @@ void MediaTransportHandlerSTS::Destroy() {
CSFLogDebug(LOGTAG, "%s %p", __func__, this);
// Our "destruction tour" starts on main, because we need to deregister.
if (!NS_IsMainThread()) {
GetMainThreadSerialEventTarget()->Dispatch(NewNonOwningRunnableMethod(
GetMainThreadEventTarget()->Dispatch(NewNonOwningRunnableMethod(
__func__, this, &MediaTransportHandlerSTS::Destroy));
return;
}

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

@ -532,8 +532,8 @@ static void GMPReady_m() {
};
static void GMPReady() {
GetMainThreadSerialEventTarget()->Dispatch(WrapRunnableNM(&GMPReady_m),
NS_DISPATCH_NORMAL);
GetMainThreadEventTarget()->Dispatch(WrapRunnableNM(&GMPReady_m),
NS_DISPATCH_NORMAL);
};
void PeerConnectionCtx::initGMP() {

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

@ -1406,7 +1406,7 @@ void PeerConnectionImpl::UpdateNegotiationNeeded() {
}
// Queue a task to run the following steps:
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, self = RefPtr<PeerConnectionImpl>(this)] {
// If connection.[[IsClosed]] is true, abort these steps.
if (IsClosed()) {
@ -1530,7 +1530,7 @@ PeerConnectionImpl::CreateOffer(const JsepOfferOptions& aOptions) {
STAMP_TIMECARD(mTimeCard, "Create Offer");
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, self = RefPtr<PeerConnectionImpl>(this), aOptions] {
std::string offer;
@ -1570,7 +1570,7 @@ PeerConnectionImpl::CreateAnswer() {
// add it as a param to CreateAnswer, and convert it here.
JsepAnswerOptions options;
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, self = RefPtr<PeerConnectionImpl>(this), options] {
std::string answer;
SyncToJsep();
@ -1889,7 +1889,7 @@ PeerConnectionImpl::AddIceCandidate(
mRawTrickledCandidates.push_back(aCandidate);
}
// Spec says we queue a task for these updates
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, self = RefPtr<PeerConnectionImpl>(this)] {
if (IsClosed()) {
return;
@ -1910,7 +1910,7 @@ PeerConnectionImpl::AddIceCandidate(
static_cast<unsigned>(*result.mError), aCandidate,
level.valueOr(-1), errorString.c_str());
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__,
[this, self = RefPtr<PeerConnectionImpl>(this), errorString, result] {
if (IsClosed()) {
@ -2577,7 +2577,7 @@ already_AddRefed<dom::Promise> PeerConnectionImpl::OnSetDescriptionSuccess(
void PeerConnectionImpl::DoSetDescriptionSuccessPostProcessing(
dom::RTCSdpType aSdpType, bool aRemote, const RefPtr<dom::Promise>& aP) {
// Spec says we queue a task for all the stuff that ends up back in JS
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__,
[this, self = RefPtr<PeerConnectionImpl>(this), aSdpType, aRemote, aP] {
if (IsClosed()) {
@ -3829,7 +3829,7 @@ void PeerConnectionImpl::AddIceCandidate(const std::string& aCandidate,
cand.mUfrag = aUfrag;
mQueriedMDNSHostnames[addr].push_back(cand);
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
"PeerConnectionImpl::SendQueryMDNSHostname",
[self = RefPtr<PeerConnectionImpl>(this), addr]() mutable {
if (self->mStunAddrsRequest) {
@ -4033,7 +4033,7 @@ void PeerConnectionImpl::SignalHandler::IceGatheringStateChange_s(
dom::RTCIceGatheringState aState) {
ASSERT_ON_THREAD(mSTSThread);
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NS_NewRunnableFunction(__func__,
[handle = mHandle, aState] {
PeerConnectionWrapper wrapper(handle);
@ -4049,7 +4049,7 @@ void PeerConnectionImpl::SignalHandler::IceConnectionStateChange_s(
dom::RTCIceConnectionState aState) {
ASSERT_ON_THREAD(mSTSThread);
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NS_NewRunnableFunction(__func__,
[handle = mHandle, aState] {
PeerConnectionWrapper wrapper(handle);
@ -4068,7 +4068,7 @@ void PeerConnectionImpl::SignalHandler::OnCandidateFound_s(
MOZ_ASSERT(!aCandidateInfo.mUfrag.empty());
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NS_NewRunnableFunction(__func__,
[handle = mHandle, aTransportId, aCandidateInfo] {
PeerConnectionWrapper wrapper(handle);
@ -4083,7 +4083,7 @@ void PeerConnectionImpl::SignalHandler::OnCandidateFound_s(
void PeerConnectionImpl::SignalHandler::AlpnNegotiated_s(
const std::string& aAlpn, bool aPrivacyRequested) {
MOZ_DIAGNOSTIC_ASSERT((aAlpn == "c-webrtc") == aPrivacyRequested);
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NS_NewRunnableFunction(__func__,
[handle = mHandle, aPrivacyRequested] {
PeerConnectionWrapper wrapper(handle);

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

@ -686,7 +686,7 @@ already_AddRefed<Promise> RTCRtpSender::SetParameters(
// If the media stack is successfully configured with parameters,
// queue a task to run the following steps:
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__,
[this, self = RefPtr<RTCRtpSender>(this), p, paramsCopy, serialNumber] {
// Set sender.[[LastReturnedParameters]] to null.
@ -853,7 +853,7 @@ void RTCRtpSender::GetParameters(RTCRtpSendParameters& aParameters) {
mLastReturnedParameters = Some(aParameters);
// Queue a task that sets sender.[[LastReturnedParameters]] to null.
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, self = RefPtr<RTCRtpSender>(this)] {
mLastReturnedParameters = Nothing();
}));
@ -1068,7 +1068,7 @@ RefPtr<dom::Promise> ReplaceTrackOperation::CallImpl(ErrorResult& aError) {
}
// Queue a task that runs the following steps:
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [p, sender, track = mNewTrack]() MOZ_CAN_RUN_SCRIPT_BOUNDARY {
// If connection.[[IsClosed]] is true, abort these steps.
// Set sender.[[SenderTrack]] to withTrack.

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

@ -254,8 +254,8 @@ void RTCRtpTransceiver::RollbackToStableDtlsTransport() {
void RTCRtpTransceiver::UpdateDtlsTransportState(
const std::string& aTransportId, TransportLayer::State aState) {
if (!GetMainThreadSerialEventTarget()->IsOnCurrentThread()) {
GetMainThreadSerialEventTarget()->Dispatch(
if (!GetMainThreadEventTarget()->IsOnCurrentThread()) {
GetMainThreadEventTarget()->Dispatch(
WrapRunnable(this, &RTCRtpTransceiver::UpdateDtlsTransportState,
aTransportId, aState),
NS_DISPATCH_NORMAL);

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

@ -24,7 +24,7 @@ WebrtcTCPSocketWrapper::WebrtcTCPSocketWrapper(
mWebrtcTCPSocket(nullptr),
mMainThread(nullptr),
mSocketThread(nullptr) {
mMainThread = GetMainThreadSerialEventTarget();
mMainThread = GetMainThreadEventTarget();
mSocketThread = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
MOZ_RELEASE_ASSERT(mMainThread, "no main thread");
MOZ_RELEASE_ASSERT(mSocketThread, "no socket thread");

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

@ -58,7 +58,7 @@ WebrtcTCPSocket::WebrtcTCPSocket(WebrtcTCPSocketCallback* aCallbacks)
mSocketIn(nullptr),
mSocketOut(nullptr) {
LOG(("WebrtcTCPSocket::WebrtcTCPSocket %p\n", this));
mMainThread = GetMainThreadSerialEventTarget();
mMainThread = GetMainThreadEventTarget();
mSocketThread = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
MOZ_RELEASE_ASSERT(mMainThread, "no main thread");
MOZ_RELEASE_ASSERT(mSocketThread, "no socket thread");

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

@ -1201,7 +1201,7 @@ class GenericReceiveListener : public MediaTrackListener {
void OnRtpReceived() {
if (mMaybeTrackNeedsUnmute) {
mMaybeTrackNeedsUnmute = false;
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NewRunnableMethod("GenericReceiveListener::OnRtpReceived_m", this,
&GenericReceiveListener::OnRtpReceived_m));
}
@ -1224,7 +1224,7 @@ class GenericReceiveListener : public MediaTrackListener {
mSource->Destroy();
}
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NewRunnableMethod("RemoteTrackSource::ForceEnded", mTrackSource.get(),
&RemoteTrackSource::ForceEnded));
}
@ -1288,7 +1288,7 @@ class MediaPipelineReceiveAudio::PipelineListener
void MakePrincipalPrivate_s() {
mForceSilence = true;
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
"MediaPipelineReceiveAudio::PipelineListener::MakePrincipalPrivate_s",
[self = RefPtr<PipelineListener>(this), this] {
class Message : public ControlMessage {
@ -1494,7 +1494,7 @@ class MediaPipelineReceiveVideo::PipelineListener
mForceDropFrames = true;
}
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [self = RefPtr<PipelineListener>(this), this] {
RefPtr<nsIPrincipal> privatePrincipal =
NullPrincipal::CreateWithInheritedAttributes(

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

@ -139,7 +139,7 @@ void TextTrackList::CreateAndDispatchChangeEvent() {
void TextTrackList::CreateAndDispatchTrackEventRunner(
TextTrack* aTrack, const nsAString& aEventName) {
DebugOnly<nsresult> rv;
nsCOMPtr<nsIEventTarget> target = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> target = GetMainThreadEventTarget();
if (!target) {
// If we are not able to get the main-thread object we are shutting down.
return;

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

@ -217,7 +217,7 @@ static void CheckSTSThread() {
// should be done there.
mozilla::ipc::IPCResult UDPSocketParent::RecvConnect(
const UDPAddressInfo& aAddressInfo) {
nsCOMPtr<nsIEventTarget> target = GetCurrentSerialEventTarget();
nsCOMPtr<nsIEventTarget> target = GetCurrentEventTarget();
Unused << NS_WARN_IF(NS_FAILED(GetSTSThread()->Dispatch(
WrapRunnable(RefPtr<UDPSocketParent>(this), &UDPSocketParent::DoConnect,
mSocket, target, aAddressInfo),

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

@ -2322,7 +2322,7 @@ nsresult Notification::DispatchToMainThread(
nsIEventTarget::DISPATCH_NORMAL);
}
}
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
MOZ_ASSERT(mainTarget);
return mainTarget->Dispatch(std::move(aRunnable),
nsIEventTarget::DISPATCH_NORMAL);

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

@ -37,7 +37,7 @@ QuotaChild::QuotaChild(QuotaManagerService* aService)
: mService(aService)
#ifdef DEBUG
,
mOwningThread(GetCurrentSerialEventTarget())
mOwningThread(GetCurrentEventTarget())
#endif
{
AssertIsOnOwningThread();

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

@ -971,7 +971,7 @@ class ServiceWorkerRegistrarSaveDataRunnable final : public Runnable {
ServiceWorkerRegistrarSaveDataRunnable(
nsTArray<ServiceWorkerRegistrationData>&& aData, uint32_t aGeneration)
: Runnable("dom::ServiceWorkerRegistrarSaveDataRunnable"),
mEventTarget(GetCurrentSerialEventTarget()),
mEventTarget(GetCurrentEventTarget()),
mData(std::move(aData)),
mGeneration(aGeneration) {
AssertIsOnBackgroundThread();

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

@ -270,7 +270,7 @@ class ConnectionOperationBase : public Runnable,
protected:
ConnectionOperationBase(Connection* aConnection)
: Runnable("dom::ConnectionOperationBase"),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mConnection(aConnection),
mResultCode(NS_OK),
mOperationMayProceed(true),
@ -594,7 +594,7 @@ already_AddRefed<mozilla::dom::quota::Client> CreateQuotaClient() {
StreamHelper::StreamHelper(nsIFileRandomAccessStream* aFileRandomAccessStream,
nsIRunnable* aCallback)
: Runnable("dom::StreamHelper"),
mOwningEventTarget(GetCurrentSerialEventTarget()),
mOwningEventTarget(GetCurrentEventTarget()),
mFileRandomAccessStream(aFileRandomAccessStream),
mCallback(aCallback) {
AssertIsOnBackgroundThread();

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

@ -79,7 +79,7 @@ class StorageDBThread::InitHelper final : public Runnable {
public:
InitHelper()
: Runnable("dom::StorageDBThread::InitHelper"),
mOwningThread(GetCurrentSerialEventTarget()),
mOwningThread(GetCurrentEventTarget()),
mMutex("InitHelper::mMutex"),
mCondVar(mMutex, "InitHelper::mCondVar"),
mMainThreadResultCode(NS_OK),
@ -107,7 +107,7 @@ class StorageDBThread::NoteBackgroundThreadRunnable final : public Runnable {
explicit NoteBackgroundThreadRunnable(const uint32_t aPrivateBrowsingId)
: Runnable("dom::StorageDBThread::NoteBackgroundThreadRunnable"),
mPrivateBrowsingId(aPrivateBrowsingId),
mOwningThread(GetCurrentSerialEventTarget()) {
mOwningThread(GetCurrentEventTarget()) {
MOZ_RELEASE_ASSERT(aPrivateBrowsingId < kPrivateBrowsingIdCount);
}

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

@ -660,7 +660,7 @@ class StorageDBParent::ObserverSink : public StorageObserverSink {
public:
explicit ObserverSink(StorageDBParent* aActor)
: mOwningEventTarget(GetCurrentSerialEventTarget()), mActor(aActor) {
: mOwningEventTarget(GetCurrentEventTarget()), mActor(aActor) {
::mozilla::ipc::AssertIsOnBackgroundThread();
MOZ_ASSERT(aActor);
}

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

@ -93,7 +93,7 @@ RefPtr<U2FRegisterPromise> AndroidWebAuthnTokenManager::Register(
ClearPromises();
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
"java::WebAuthnTokenManager::WebAuthnMakeCredential",
[self = RefPtr{this}, aInfo, aForceNoneAttestation]() {
AssertIsOnMainThread();
@ -282,7 +282,7 @@ RefPtr<U2FSignPromise> AndroidWebAuthnTokenManager::Sign(
ClearPromises();
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
"java::WebAuthnTokenManager::WebAuthnGetAssertion",
[self = RefPtr{this}, aInfo]() {
AssertIsOnMainThread();

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

@ -195,7 +195,7 @@ nsresult U2FSoftTokenManager::GetOrCreateWrappingKey(
MOZ_LOG(gNSSTokenLog, LogLevel::Debug,
("Key stored, nickname set to %s.", mSecretNickname.get()));
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
GetMainThreadEventTarget()->Dispatch(NS_NewRunnableFunction(
"dom::U2FSoftTokenManager::GetOrCreateWrappingKey", []() {
MOZ_ASSERT(NS_IsMainThread());
Preferences::SetUint(PREF_U2F_NSSTOKEN_COUNTER, 0);
@ -885,7 +885,7 @@ RefPtr<U2FSignPromise> U2FSoftTokenManager::Sign(
counterItem.data[2] = (mCounter >> 8) & 0xFF;
counterItem.data[3] = (mCounter >> 0) & 0xFF;
uint32_t counter = mCounter;
GetMainThreadSerialEventTarget()->Dispatch(
GetMainThreadEventTarget()->Dispatch(
NS_NewRunnableFunction("dom::U2FSoftTokenManager::Sign", [counter]() {
MOZ_ASSERT(NS_IsMainThread());
Preferences::SetUint(PREF_U2F_NSSTOKEN_COUNTER, counter);

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

@ -273,8 +273,8 @@ void U2FTokenManager::SendPromptNotification(const char16_t* aFormat,
"U2FTokenManager::RunSendPromptNotification", this,
&U2FTokenManager::RunSendPromptNotification, json));
MOZ_ALWAYS_SUCCEEDS(GetMainThreadSerialEventTarget()->Dispatch(
r.forget(), NS_DISPATCH_NORMAL));
MOZ_ALWAYS_SUCCEEDS(
GetMainThreadEventTarget()->Dispatch(r.forget(), NS_DISPATCH_NORMAL));
}
void U2FTokenManager::RunSendPromptNotification(const nsString& aJSON) {
@ -390,8 +390,8 @@ static void status_callback(rust_ctap2_status_update_res* status) {
nsCOMPtr<nsIRunnable> r(NewRunnableMethod<nsString>(
"U2FTokenManager::RunSendPromptNotification", gInstance,
&U2FTokenManager::RunSendPromptNotification, notification_json));
MOZ_ALWAYS_SUCCEEDS(GetMainThreadSerialEventTarget()->Dispatch(
r.forget(), NS_DISPATCH_NORMAL));
MOZ_ALWAYS_SUCCEEDS(
GetMainThreadEventTarget()->Dispatch(r.forget(), NS_DISPATCH_NORMAL));
}
}

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

@ -2755,7 +2755,7 @@ WebSocketImpl::Dispatch(already_AddRefed<nsIRunnable> aEvent, uint32_t aFlags) {
if (mIsMainThread) {
return mMainThreadEventTarget
? mMainThreadEventTarget->Dispatch(event_ref.forget())
: GetMainThreadSerialEventTarget()->Dispatch(event_ref.forget());
: GetMainThreadEventTarget()->Dispatch(event_ref.forget());
}
MutexAutoLock lock(mMutex);

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

@ -70,7 +70,7 @@ void WebTransportParent::Create(
return;
}
parent->mOwningEventTarget = GetCurrentSerialEventTarget();
parent->mOwningEventTarget = GetCurrentEventTarget();
MOZ_ASSERT(aPrincipal);
nsCOMPtr<nsIURI> uri;

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

@ -2133,7 +2133,7 @@ WorkerThreadPrimaryRunnable::Run() {
mWorkerPrivate = nullptr;
// Now recycle this thread.
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> mainTarget = GetMainThreadEventTarget();
MOZ_ASSERT(mainTarget);
RefPtr<FinishedRunnable> finishedRunnable =

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

@ -19,7 +19,7 @@ using namespace ipc;
namespace dom {
SharedWorkerParent::SharedWorkerParent()
: mBackgroundEventTarget(GetCurrentSerialEventTarget()),
: mBackgroundEventTarget(GetCurrentEventTarget()),
mStatus(eInit),
mSuspended(false),
mFrozen(false) {

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

@ -37,7 +37,7 @@ class GetOrCreateWorkerManagerRunnable final : public Runnable {
uint64_t aWindowID,
const MessagePortIdentifier& aPortIdentifier)
: Runnable("GetOrCreateWorkerManagerRunnable"),
mBackgroundEventTarget(GetCurrentSerialEventTarget()),
mBackgroundEventTarget(GetCurrentEventTarget()),
mService(aService),
mActor(aActor),
mData(aData),

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

@ -405,7 +405,7 @@ bool CanvasTranslator::CheckForFreshCanvasDevice(int aLineNumber) {
// It is safe to wait here because only the Compositor thread waits on us and
// the main thread doesn't wait on the compositor thread in the GPU process.
SyncRunnable::DispatchToThread(GetMainThreadSerialEventTarget(), runnable,
SyncRunnable::DispatchToThread(GetMainThreadEventTarget(), runnable,
/*aForceDispatch*/ true);
mDevice = gfx::DeviceManagerDx::Get()->GetCanvasDevice();

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

@ -15,7 +15,7 @@
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/webrender/RenderSharedSurfaceTextureHost.h"
#include "mozilla/webrender/RenderThread.h"
#include "nsThreadUtils.h" // for GetCurrentSerialEventTarget
#include "nsThreadUtils.h" // for GetCurrentEventTarget
namespace mozilla {
namespace layers {
@ -55,7 +55,7 @@ void SharedSurfacesParent::MappingTracker::NotifyHandlerEnd() {
SharedSurfacesParent::SharedSurfacesParent()
: mTracker(
StaticPrefs::image_mem_shared_unmap_min_expiration_ms_AtStartup(),
mozilla::GetCurrentSerialEventTarget()) {}
mozilla::GetCurrentEventTarget()) {}
/* static */
void SharedSurfacesParent::Initialize() {

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

@ -1380,8 +1380,7 @@ void OpenVRSession::StartHapticTimer() {
if (!mHapticTimer && mHapticThread) {
mLastHapticUpdate = TimeStamp();
mHapticTimer = NS_NewTimer();
nsCOMPtr<nsIThread> thread = mHapticThread->GetThread();
mHapticTimer->SetTarget(thread);
mHapticTimer->SetTarget(mHapticThread->GetThread()->EventTarget());
mHapticTimer->InitWithNamedFuncCallback(
HapticTimerCallback, this, kVRHapticUpdateInterval,
nsITimer::TYPE_REPEATING_PRECISE_CAN_SKIP,

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

@ -44,7 +44,7 @@ class AsyncBlockers {
}
if (aTimeOutInMs > 0) {
GetCurrentSerialEventTarget()->DelayedDispatch(
GetCurrentEventTarget()->DelayedDispatch(
NS_NewRunnableFunction("AsyncBlockers::WaitUntilClear",
[promise = mPromise]() {
// The AsyncBlockers object may have been

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

@ -163,7 +163,8 @@ RefPtr<EnsureMTA::CreateInstanceAgileRefPromise> EnsureMTA::CreateInstance(
nsCOMPtr<nsIThread> mtaThread(GetPersistentMTAThread());
return InvokeAsync(mtaThread, __func__, std::move(invoker));
return InvokeAsync(mtaThread->SerialEventTarget(), __func__,
std::move(invoker));
}
/* static */

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

@ -105,7 +105,7 @@ void nsFontFaceLoader::StartedLoading(nsIStreamLoader* aStreamLoader) {
if (doc) {
target = doc->EventTargetFor(TaskCategory::Other);
} else {
target = GetMainThreadSerialEventTarget();
target = GetMainThreadEventTarget();
}
NS_NewTimerWithFuncCallback(
getter_AddRefs(mLoadTimer), LoadTimerCallback, static_cast<void*>(this),

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

@ -43,7 +43,7 @@ class MainAsCurrent : public TaskQueueWrapper<DeletionPolicy::NonBlocking> {
public:
MainAsCurrent()
: TaskQueueWrapper(
TaskQueue::Create(do_AddRef(GetMainThreadSerialEventTarget()),
TaskQueue::Create(do_AddRef(GetMainThreadEventTarget()),
"MainAsCurrentTaskQueue"),
"MainAsCurrent"_ns),
mSetter(this) {

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

@ -99,7 +99,7 @@ nsresult BackgroundFileSaver::Init() {
getter_AddRefs(mPipeOutputStream), true, true, 0,
HasInfiniteBuffer() ? UINT32_MAX : 0);
mControlEventTarget = GetCurrentSerialEventTarget();
mControlEventTarget = GetCurrentEventTarget();
NS_ENSURE_TRUE(mControlEventTarget, NS_ERROR_NOT_INITIALIZED);
nsresult rv = NS_CreateBackgroundTaskQueue("BgFileSaver",

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

@ -489,7 +489,7 @@ Dashboard::RequestSockets(nsINetDashboardCallback* aCallback) {
RefPtr<SocketData> socketData = new SocketData();
socketData->mCallback = new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
socketData->mEventTarget = GetCurrentSerialEventTarget();
socketData->mEventTarget = GetCurrentEventTarget();
if (nsIOService::UseSocketProcess()) {
if (!gIOService->SocketProcessReady()) {
@ -579,7 +579,7 @@ Dashboard::RequestHttpConnections(nsINetDashboardCallback* aCallback) {
RefPtr<HttpData> httpData = new HttpData();
httpData->mCallback = new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
httpData->mEventTarget = GetCurrentSerialEventTarget();
httpData->mEventTarget = GetCurrentEventTarget();
if (nsIOService::UseSocketProcess()) {
if (!gIOService->SocketProcessReady()) {
@ -765,7 +765,7 @@ Dashboard::RequestWebsocketConnections(nsINetDashboardCallback* aCallback) {
RefPtr<WebSocketRequest> wsRequest = new WebSocketRequest();
wsRequest->mCallback = new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
wsRequest->mEventTarget = GetCurrentSerialEventTarget();
wsRequest->mEventTarget = GetCurrentEventTarget();
wsRequest->mEventTarget->Dispatch(
NewRunnableMethod<RefPtr<WebSocketRequest>>(
@ -818,7 +818,7 @@ Dashboard::RequestDNSInfo(nsINetDashboardCallback* aCallback) {
nsresult rv;
dnsData->mData.Clear();
dnsData->mEventTarget = GetCurrentSerialEventTarget();
dnsData->mEventTarget = GetCurrentEventTarget();
if (!mDnsService) {
mDnsService = do_GetService("@mozilla.org/network/dns-service;1", &rv);
@ -940,7 +940,7 @@ Dashboard::RequestDNSLookup(const nsACString& aHost,
RefPtr<LookupHelper> helper = new LookupHelper();
helper->mCallback = new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
helper->mEventTarget = GetCurrentSerialEventTarget();
helper->mEventTarget = GetCurrentEventTarget();
OriginAttributes attrs;
rv = mDnsService->AsyncResolveNative(
aHost, nsIDNSService::RESOLVE_TYPE_DEFAULT,
@ -964,7 +964,7 @@ Dashboard::RequestDNSHTTPSRRLookup(const nsACString& aHost,
RefPtr<LookupHelper> helper = new LookupHelper();
helper->mCallback = new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
helper->mEventTarget = GetCurrentSerialEventTarget();
helper->mEventTarget = GetCurrentEventTarget();
OriginAttributes attrs;
rv = mDnsService->AsyncResolveNative(
aHost, nsIDNSService::RESOLVE_TYPE_HTTPSSVC,
@ -976,7 +976,7 @@ Dashboard::RequestDNSHTTPSRRLookup(const nsACString& aHost,
NS_IMETHODIMP
Dashboard::RequestRcwnStats(nsINetDashboardCallback* aCallback) {
RefPtr<RcwnData> rcwnData = new RcwnData();
rcwnData->mEventTarget = GetCurrentSerialEventTarget();
rcwnData->mEventTarget = GetCurrentEventTarget();
rcwnData->mCallback = new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
@ -1072,7 +1072,7 @@ Dashboard::RequestConnection(const nsACString& aHost, uint32_t aPort,
connectionData->mCallback =
new nsMainThreadPtrHolder<nsINetDashboardCallback>(
"nsINetDashboardCallback", aCallback, true);
connectionData->mEventTarget = GetCurrentSerialEventTarget();
connectionData->mEventTarget = GetCurrentEventTarget();
rv = TestNewConnection(connectionData);
if (NS_FAILED(rv)) {
@ -1127,7 +1127,7 @@ nsresult Dashboard::TestNewConnection(ConnectionData* aConnectionData) {
}
rv = connectionData->mSocket->SetEventSink(connectionData,
GetCurrentSerialEventTarget());
GetCurrentEventTarget());
if (NS_FAILED(rv)) {
return rv;
}

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

@ -245,7 +245,7 @@ bool ProxyAutoConfig::ResolveAddress(const nsACString& aHostName,
if (NS_FAILED(dns->AsyncResolveNative(
aHostName, nsIDNSService::RESOLVE_TYPE_DEFAULT, flags, nullptr,
helper, GetCurrentSerialEventTarget(), attrs,
helper, GetCurrentEventTarget(), attrs,
getter_AddRefs(helper->mRequest)))) {
return false;
}

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

@ -64,7 +64,7 @@ nsresult nsAsyncRedirectVerifyHelper::Init(
mFlags = flags;
mCallbackEventTarget = NS_IsMainThread() && mainThreadEventTarget
? mainThreadEventTarget
: GetCurrentSerialEventTarget();
: GetCurrentEventTarget();
if (!(flags & (nsIChannelEventSink::REDIRECT_INTERNAL |
nsIChannelEventSink::REDIRECT_STS_UPGRADE))) {
@ -81,7 +81,7 @@ nsresult nsAsyncRedirectVerifyHelper::Init(
nsresult rv;
rv = mainThreadEventTarget
? mainThreadEventTarget->Dispatch(runnable.forget())
: GetMainThreadSerialEventTarget()->Dispatch(runnable.forget());
: GetMainThreadEventTarget()->Dispatch(runnable.forget());
NS_ENSURE_SUCCESS(rv, rv);
if (synchronize) {

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

@ -35,7 +35,7 @@ class AsyncApplyBufferingPolicyEvent final : public Runnable {
explicit AsyncApplyBufferingPolicyEvent(nsAsyncStreamCopier* aCopier)
: mozilla::Runnable("AsyncApplyBufferingPolicyEvent"),
mCopier(aCopier),
mTarget(GetCurrentSerialEventTarget()) {}
mTarget(GetCurrentEventTarget()) {}
NS_IMETHOD Run() override {
nsresult rv = mCopier->ApplyBufferingPolicy();

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

@ -65,7 +65,7 @@ nsresult nsDNSPrefetch::Prefetch(nsIDNSService::DNSFlags flags) {
// then our timing will be useless. However, in such a case,
// mEndTimestamp will be a null timestamp and callers should check
// TimingsValid() before using the timing.
nsCOMPtr<nsIEventTarget> target = mozilla::GetCurrentSerialEventTarget();
nsCOMPtr<nsIEventTarget> target = mozilla::GetCurrentEventTarget();
flags |= nsIDNSService::GetFlagsFromTRRMode(mTRRMode);
@ -127,7 +127,7 @@ nsresult nsDNSPrefetch::FetchHTTPSSVC(
return NS_ERROR_NOT_AVAILABLE;
}
nsCOMPtr<nsIEventTarget> target = mozilla::GetCurrentSerialEventTarget();
nsCOMPtr<nsIEventTarget> target = mozilla::GetCurrentEventTarget();
nsIDNSService::DNSFlags flags = nsIDNSService::GetFlagsFromTRRMode(mTRRMode);
if (aRefreshDNS) {
flags |= nsIDNSService::RESOLVE_BYPASS_CACHE;

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

@ -100,9 +100,8 @@ nsresult nsInputStreamPump::EnsureWaiting() {
// created on main thread.
if (mState == STATE_STOP && !mOffMainThread) {
nsCOMPtr<nsIEventTarget> mainThread =
mLabeledMainThreadTarget
? mLabeledMainThreadTarget
: do_AddRef(GetMainThreadSerialEventTarget());
mLabeledMainThreadTarget ? mLabeledMainThreadTarget
: do_AddRef(GetMainThreadEventTarget());
if (mTargetThread != mainThread) {
mTargetThread = mainThread;
}
@ -354,7 +353,7 @@ nsInputStreamPump::AsyncRead(nsIStreamListener* listener) {
if (NS_IsMainThread() && mLabeledMainThreadTarget) {
mTargetThread = mLabeledMainThreadTarget;
} else {
mTargetThread = mozilla::GetCurrentSerialEventTarget();
mTargetThread = GetCurrentEventTarget();
}
NS_ENSURE_STATE(mTargetThread);

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

@ -554,10 +554,9 @@ nsresult nsPACMan::LoadPACFromURI(const nsACString& aSpec,
if (!mLoadPending) {
nsCOMPtr<nsIRunnable> runnable = NewRunnableMethod(
"nsPACMan::StartLoading", this, &nsPACMan::StartLoading);
nsresult rv =
NS_IsMainThread()
? Dispatch(runnable.forget())
: GetCurrentSerialEventTarget()->Dispatch(runnable.forget());
nsresult rv = NS_IsMainThread()
? Dispatch(runnable.forget())
: GetCurrentEventTarget()->Dispatch(runnable.forget());
if (NS_FAILED(rv)) return rv;
mLoadPending = true;
}

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

@ -167,7 +167,7 @@ nsRequestObserverProxy::Init(nsIRequestObserver* observer,
//-----------------------------------------------------------------------------
nsresult nsRequestObserverProxy::FireEvent(nsARequestObserverEvent* event) {
nsCOMPtr<nsIEventTarget> mainThread(GetMainThreadSerialEventTarget());
nsCOMPtr<nsIEventTarget> mainThread(GetMainThreadEventTarget());
return mainThread->Dispatch(event, NS_DISPATCH_NORMAL);
}

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

@ -457,7 +457,7 @@ class ServerSocketListenerProxy final : public nsIServerSocketListener {
explicit ServerSocketListenerProxy(nsIServerSocketListener* aListener)
: mListener(new nsMainThreadPtrHolder<nsIServerSocketListener>(
"ServerSocketListenerProxy::mListener", aListener)),
mTarget(GetCurrentSerialEventTarget()) {}
mTarget(GetCurrentEventTarget()) {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSISERVERSOCKETLISTENER
@ -543,7 +543,7 @@ nsServerSocket::AsyncListen(nsIServerSocketListener* aListener) {
{
MutexAutoLock lock(mLock);
mListener = new ServerSocketListenerProxy(aListener);
mListenerTarget = GetCurrentSerialEventTarget();
mListenerTarget = GetCurrentEventTarget();
}
// Child classes may need to do additional setup just before listening begins

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

@ -2405,7 +2405,7 @@ NS_IMETHODIMP
nsSocketTransport::SetSecurityCallbacks(nsIInterfaceRequestor* callbacks) {
nsCOMPtr<nsIInterfaceRequestor> threadsafeCallbacks;
NS_NewNotificationCallbacksAggregation(callbacks, nullptr,
GetCurrentSerialEventTarget(),
GetCurrentEventTarget(),
getter_AddRefs(threadsafeCallbacks));
MutexAutoLock lock(mLock);
mCallbacks = threadsafeCallbacks;

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

@ -375,7 +375,7 @@ class AvailableEvent final : public Runnable {
mDoingCallback(false),
mSize(0),
mResultForCallback(NS_OK) {
mCallbackTarget = GetCurrentSerialEventTarget();
mCallbackTarget = GetCurrentEventTarget();
}
NS_IMETHOD Run() override {

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

@ -787,7 +787,7 @@ class SocketListenerProxy final : public nsIUDPSocketListener {
explicit SocketListenerProxy(nsIUDPSocketListener* aListener)
: mListener(new nsMainThreadPtrHolder<nsIUDPSocketListener>(
"SocketListenerProxy::mListener", aListener)),
mTarget(GetCurrentSerialEventTarget()) {}
mTarget(GetCurrentEventTarget()) {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIUDPSOCKETLISTENER
@ -879,7 +879,7 @@ class SocketListenerProxyBackground final : public nsIUDPSocketListener {
public:
explicit SocketListenerProxyBackground(nsIUDPSocketListener* aListener)
: mListener(aListener), mTarget(GetCurrentSerialEventTarget()) {}
: mListener(aListener), mTarget(GetCurrentEventTarget()) {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIUDPSOCKETLISTENER
@ -1079,7 +1079,7 @@ nsUDPSocket::AsyncListen(nsIUDPSocketListener* aListener) {
NS_ENSURE_TRUE(mSyncListener == nullptr, NS_ERROR_IN_PROGRESS);
{
MutexAutoLock lock(mLock);
mListenerTarget = GetCurrentSerialEventTarget();
mListenerTarget = GetCurrentEventTarget();
if (NS_IsMainThread()) {
// PNecko usage
mListener = new SocketListenerProxy(aListener);

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

@ -86,7 +86,7 @@ CacheEntry::Callback::Callback(CacheEntry* aEntry,
bool aSecret)
: mEntry(aEntry),
mCallback(aCallback),
mTarget(GetCurrentSerialEventTarget()),
mTarget(GetCurrentEventTarget()),
mReadOnly(aReadOnly),
mRevalidating(false),
mCheckOnAnyThread(aCheckOnAnyThread),

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

@ -28,7 +28,7 @@
// - CacheFile is still waiting for the handle
// - the chunk is preloaded
// #define CACHE_CHUNKS
//#define CACHE_CHUNKS
namespace mozilla::net {
@ -2189,7 +2189,7 @@ void CacheFile::QueueChunkListener(uint32_t aIndex,
LOG(
("CacheFile::QueueChunkListener() - Cannot get Cache I/O thread! Using "
"main thread for callback."));
item->mTarget = GetMainThreadSerialEventTarget();
item->mTarget = GetMainThreadEventTarget();
}
item->mCallback = aCallback;

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

@ -432,7 +432,7 @@ void CacheFileChunk::WaitForUpdate(CacheFileChunkListener* aCallback) {
LOG(
("CacheFileChunk::WaitForUpdate() - Cannot get Cache I/O thread! Using "
"main thread for callback."));
item->mTarget = GetMainThreadSerialEventTarget();
item->mTarget = GetMainThreadEventTarget();
}
item->mCallback = aCallback;
MOZ_ASSERT(item->mTarget);

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

@ -635,7 +635,7 @@ void CacheFileInputStream::NotifyListener() {
LOG(
("CacheFileInputStream::NotifyListener() - Cannot get Cache I/O "
"thread! Using main thread for callback."));
mCallbackTarget = GetMainThreadSerialEventTarget();
mCallbackTarget = GetMainThreadEventTarget();
}
}

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

@ -440,7 +440,7 @@ void CacheFileOutputStream::NotifyListener() {
LOG(
("CacheFileOutputStream::NotifyListener() - Cannot get Cache I/O "
"thread! Using main thread for callback."));
mCallbackTarget = GetMainThreadSerialEventTarget();
mCallbackTarget = GetMainThreadEventTarget();
}
}

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

@ -429,7 +429,7 @@ void ProxyRelease(const char* aName, nsCOMPtr<T>& object,
template <class T>
void ProxyReleaseMainThread(const char* aName, nsCOMPtr<T>& object) {
ProxyRelease(aName, object, GetMainThreadSerialEventTarget());
ProxyRelease(aName, object, GetMainThreadEventTarget());
}
} // namespace net

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

@ -45,7 +45,7 @@ void DNSRequestHandler::DoAsyncResolve(const nsACString& hostname,
mFlags = flags;
nsCOMPtr<nsIDNSService> dns = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIEventTarget> main = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> main = GetMainThreadEventTarget();
nsCOMPtr<nsICancelable> unused;
RefPtr<DNSAdditionalInfo> info;
if (!trrServer.IsEmpty() || port != -1) {

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

@ -54,7 +54,7 @@ nsresult DNSUtils::CreateChannelHelper(nsIURI* aUri, nsIChannel** aResult) {
// Unfortunately, we can only initialize gHttpHandler on main thread.
if (!gHttpHandler) {
nsCOMPtr<nsIEventTarget> main = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> main = GetMainThreadEventTarget();
if (main) {
// Forward to the main thread synchronously.
SyncRunnable::DispatchToThread(

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

@ -1039,7 +1039,7 @@ nsresult nsDNSService::AsyncResolveInternal(
// make sure JS callers get notification on the main thread
nsCOMPtr<nsIXPConnectWrappedJS> wrappedListener = do_QueryInterface(listener);
if (wrappedListener && !target) {
target = GetMainThreadSerialEventTarget();
target = GetMainThreadEventTarget();
}
if (target) {

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

@ -40,7 +40,7 @@ class MainThreadChannelEvent : public ChannelEvent {
already_AddRefed<nsIEventTarget> GetEventTarget() override {
MOZ_ASSERT(XRE_IsParentProcess());
return do_AddRef(GetMainThreadSerialEventTarget());
return do_AddRef(GetMainThreadEventTarget());
}
};

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

@ -350,9 +350,8 @@ IPCResult DocumentChannelChild::RecvRedirectToRealChannel(
mRedirectChannel = newChannel;
mStreamFilterEndpoints = std::move(aEndpoints);
rv = gHttpHandler->AsyncOnChannelRedirect(this, newChannel,
aArgs.redirectFlags(),
GetMainThreadSerialEventTarget());
rv = gHttpHandler->AsyncOnChannelRedirect(
this, newChannel, aArgs.redirectFlags(), GetMainThreadEventTarget());
if (NS_SUCCEEDED(rv)) {
scopeExit.release();

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

@ -180,7 +180,7 @@ void AltDataOutputStreamChild::NotifyListener() {
MOZ_ASSERT(mCallback);
if (!mCallbackTarget) {
mCallbackTarget = GetMainThreadSerialEventTarget();
mCallbackTarget = GetMainThreadEventTarget();
}
nsCOMPtr<nsIOutputStreamCallback> asyncCallback =

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

@ -892,7 +892,7 @@ void AltSvcCache::EnsureStorageInited() {
return;
}
nsCOMPtr<nsIEventTarget> main = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> main = GetMainThreadEventTarget();
if (!main) {
return;
}

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

@ -29,7 +29,7 @@ CachePushChecker::CachePushChecker(nsIURI* aPushedURL,
mOriginAttributes(aOriginAttributes),
mRequestString(aRequestString),
mCallback(std::move(aCallback)),
mCurrentEventTarget(GetCurrentSerialEventTarget()) {}
mCurrentEventTarget(GetCurrentEventTarget()) {}
nsresult CachePushChecker::DoCheck() {
if (XRE_IsSocketProcess()) {

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

@ -106,7 +106,7 @@ void HTTPSRecordResolver::PrefetchAddrRecord(const nsACString& aTargetName,
Unused << dns->AsyncResolveNative(
aTargetName, nsIDNSService::RESOLVE_TYPE_DEFAULT,
flags | nsIDNSService::RESOLVE_SPECULATE, nullptr, this,
GetCurrentSerialEventTarget(),
GetCurrentEventTarget(),
mTransaction->ConnectionInfo()->GetOriginAttributes(),
getter_AddRefs(tmpOutstanding));
}

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

@ -392,7 +392,7 @@ nsresult HttpBaseChannel::Init(nsIURI* aURI, uint32_t aCaps,
mProxyInfo = aProxyInfo;
}
mCurrentThread = GetCurrentSerialEventTarget();
mCurrentThread = GetCurrentEventTarget();
return rv;
}

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

@ -2125,7 +2125,7 @@ already_AddRefed<nsIEventTarget> HttpChannelChild::GetODATarget() {
}
if (!target) {
target = GetMainThreadSerialEventTarget();
target = GetMainThreadEventTarget();
}
return target.forget();
}
@ -2845,7 +2845,7 @@ HttpChannelChild::GetDeliveryTarget(nsIEventTarget** aEventTarget) {
nsCOMPtr<nsIEventTarget> target = mODATarget;
if (!mODATarget) {
target = GetCurrentSerialEventTarget();
target = GetCurrentEventTarget();
}
target.forget(aEventTarget);
return NS_OK;

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

@ -116,7 +116,7 @@ nsresult HttpTransactionChild::InitInternal(
nsresult rv = mTransaction->Init(
caps, cinfo, requestHead, requestBody, requestContentLength,
requestBodyHasHeaders, GetCurrentSerialEventTarget(),
requestBodyHasHeaders, GetCurrentEventTarget(),
nullptr, // TODO: security callback, fix in bug 1512479.
this, topLevelOuterContentWindowId,
static_cast<HttpTrafficCategory>(httpTrafficCategory), rc, classOfService,

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

@ -101,7 +101,7 @@ nsresult HttpTransactionParent::Init(
}
mEventsink = eventsink;
mTargetThread = GetCurrentSerialEventTarget();
mTargetThread = GetCurrentEventTarget();
mChannelId = channelId;
mTransactionObserver = std::move(transactionObserver);
mOnPushCallback = std::move(aOnPushCallback);
@ -220,7 +220,7 @@ already_AddRefed<nsIEventTarget> HttpTransactionParent::GetODATarget() {
}
if (!target) {
target = GetMainThreadSerialEventTarget();
target = GetMainThreadEventTarget();
}
return target.forget();
}
@ -400,7 +400,7 @@ already_AddRefed<nsHttpConnectionInfo> HttpTransactionParent::GetConnInfo()
}
already_AddRefed<nsIEventTarget> HttpTransactionParent::GetNeckoTarget() {
nsCOMPtr<nsIEventTarget> target = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> target = GetMainThreadEventTarget();
return target.forget();
}

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

@ -37,7 +37,7 @@ nsresult SpeculativeTransaction::FetchHTTPSRR() {
RefPtr<HTTPSRecordResolver> resolver = new HTTPSRecordResolver(this);
nsCOMPtr<nsICancelable> dnsRequest;
return resolver->FetchHTTPSRRInternal(GetCurrentSerialEventTarget(),
return resolver->FetchHTTPSRRInternal(GetCurrentEventTarget(),
getter_AddRefs(dnsRequest));
}

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

@ -89,7 +89,7 @@ NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
TRRServiceChannel::TRRServiceChannel()
: HttpAsyncAborter<TRRServiceChannel>(this),
mProxyRequest(nullptr, "TRRServiceChannel::mProxyRequest"),
mCurrentEventTarget(GetCurrentSerialEventTarget()) {
mCurrentEventTarget(GetCurrentEventTarget()) {
LOG(("TRRServiceChannel ctor [this=%p]\n", this));
}

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

@ -1390,8 +1390,8 @@ nsresult nsHttpChannel::SetupTransaction() {
mTransaction->SetIsForWebTransport(mIsForWebTransport);
rv = mTransaction->Init(
mCaps, mConnectionInfo, &mRequestHead, mUploadStream, mReqContentLength,
LoadUploadStreamHasHeaders(), GetCurrentSerialEventTarget(), callbacks,
this, mTopBrowsingContextId, category, mRequestContext, mClassOfService,
LoadUploadStreamHasHeaders(), GetCurrentEventTarget(), callbacks, this,
mTopBrowsingContextId, category, mRequestContext, mClassOfService,
mInitialRwin, LoadResponseTimeoutEnabled(), mChannelId,
std::move(observer), std::move(pushCallback), mTransWithPushedStream,
mPushedStreamId);
@ -7971,7 +7971,7 @@ nsHttpChannel::RetargetDeliveryTo(nsIEventTarget* aNewTarget) {
// If retarget fails for transaction pump, we must restore mCachePump.
if (NS_FAILED(rv) && retargetableCachePump) {
nsCOMPtr<nsIEventTarget> main = GetMainThreadSerialEventTarget();
nsCOMPtr<nsIEventTarget> main = GetMainThreadEventTarget();
NS_ENSURE_TRUE(main, NS_ERROR_UNEXPECTED);
rv = retargetableCachePump->RetargetDeliveryTo(main);
}
@ -8734,7 +8734,7 @@ void nsHttpChannel::UpdateAggregateCallbacks() {
}
nsCOMPtr<nsIInterfaceRequestor> callbacks;
NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup,
GetCurrentSerialEventTarget(),
GetCurrentEventTarget(),
getter_AddRefs(callbacks));
mTransaction->SetSecurityCallbacks(callbacks);
}

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

@ -329,7 +329,7 @@ BaseWebSocketChannel::GetDeliveryTarget(nsIEventTarget** aTargetThread) {
nsCOMPtr<nsIEventTarget> target = GetTargetThread();
if (!target) {
target = GetCurrentSerialEventTarget();
target = GetCurrentEventTarget();
}
target.forget(aTargetThread);
return NS_OK;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше