From f3bcaf9f88aad2c423ebcd61121562f9834187d4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:11:27 +0200 Subject: Merging upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- netwerk/dns/DNSRequestChild.cpp | 42 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'netwerk/dns/DNSRequestChild.cpp') diff --git a/netwerk/dns/DNSRequestChild.cpp b/netwerk/dns/DNSRequestChild.cpp index d8ee335b6f..4d9d7e271e 100644 --- a/netwerk/dns/DNSRequestChild.cpp +++ b/netwerk/dns/DNSRequestChild.cpp @@ -395,32 +395,30 @@ DNSRequestSender::Cancel(nsresult reason) { return NS_ERROR_NOT_AVAILABLE; } - if (mIPCActor->CanSend()) { - // We can only do IPDL on the main thread - nsCOMPtr runnable = NS_NewRunnableFunction( - "net::CancelDNSRequestEvent", - [actor(mIPCActor), host(mHost), trrServer(mTrrServer), port(mPort), - type(mType), originAttributes(mOriginAttributes), flags(mFlags), - reason]() { - if (!actor->CanSend()) { - return; - } - - if (DNSRequestChild* child = actor->AsDNSRequestChild()) { - Unused << child->SendCancelDNSRequest( - host, trrServer, port, type, originAttributes, flags, reason); - } else if (DNSRequestParent* parent = actor->AsDNSRequestParent()) { - Unused << parent->SendCancelDNSRequest( - host, trrServer, port, type, originAttributes, flags, reason); - } - }); - SchedulerGroup::Dispatch(TaskCategory::Other, runnable.forget()); - } + // We can only do IPC on the MainThread + nsCOMPtr runnable = NS_NewRunnableFunction( + "net::CancelDNSRequestEvent", + [actor(mIPCActor), host(mHost), trrServer(mTrrServer), port(mPort), + type(mType), originAttributes(mOriginAttributes), flags(mFlags), + reason]() { + if (!actor->CanSend()) { + return; + } + + if (DNSRequestChild* child = actor->AsDNSRequestChild()) { + Unused << child->SendCancelDNSRequest( + host, trrServer, port, type, originAttributes, flags, reason); + } else if (DNSRequestParent* parent = actor->AsDNSRequestParent()) { + Unused << parent->SendCancelDNSRequest( + host, trrServer, port, type, originAttributes, flags, reason); + } + }); + SchedulerGroup::Dispatch(TaskCategory::Other, runnable.forget()); return NS_OK; } void DNSRequestSender::StartRequest() { - // we can only do IPDL on the main thread + // we can only do IPC on the MainThread if (!NS_IsMainThread()) { SchedulerGroup::Dispatch( TaskCategory::Other, -- cgit v1.2.3