summaryrefslogtreecommitdiffstats
path: root/netwerk/dns/DNSRequestChild.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/dns/DNSRequestChild.cpp')
-rw-r--r--netwerk/dns/DNSRequestChild.cpp42
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,