diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:11:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 15:11:26 +0000 |
commit | fcea19dfd2c426bac0456da850e7c12258e4b9eb (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /netwerk/dns/DNSRequestChild.cpp | |
parent | Adding upstream version 115.7.0esr. (diff) | |
download | firefox-esr-fcea19dfd2c426bac0456da850e7c12258e4b9eb.tar.xz firefox-esr-fcea19dfd2c426bac0456da850e7c12258e4b9eb.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/dns/DNSRequestChild.cpp')
-rw-r--r-- | netwerk/dns/DNSRequestChild.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
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<nsIRunnable> 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<nsIRunnable> 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, |