Bug 1890277: part 4) Add CSPParser support for the `trusted-types` directive, guarded...
[gecko.git] / netwerk / dns / DNSRequestParent.h
blob7583709678f0515b460815cc5f9d2c5d158faed3
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_net_DNSRequestParent_h
8 #define mozilla_net_DNSRequestParent_h
10 #include "mozilla/net/DNSRequestBase.h"
11 #include "mozilla/net/PDNSRequestParent.h"
12 #include "nsIDNSListener.h"
14 namespace mozilla {
15 namespace net {
17 class DNSRequestParent : public DNSRequestActor, public PDNSRequestParent {
18 public:
19 friend class PDNSRequestParent;
20 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DNSRequestParent, override)
22 explicit DNSRequestParent(DNSRequestBase* aRequest);
24 bool CanSend() const override { return PDNSRequestParent::CanSend(); }
25 DNSRequestChild* AsDNSRequestChild() override { return nullptr; }
26 DNSRequestParent* AsDNSRequestParent() override { return this; }
28 private:
29 virtual ~DNSRequestParent() = default;
31 // Pass args here rather than storing them in the parent; they are only
32 // needed if the request is to be canceled.
33 mozilla::ipc::IPCResult RecvCancelDNSRequest(
34 const nsCString& hostName, const nsCString& trrServer,
35 const int32_t& port, const uint16_t& type,
36 const OriginAttributes& originAttributes,
37 const nsIDNSService::DNSFlags& flags, const nsresult& reason);
38 mozilla::ipc::IPCResult RecvLookupCompleted(const DNSRequestResponse& reply);
39 void ActorDestroy(ActorDestroyReason) override;
42 } // namespace net
43 } // namespace mozilla
45 #endif // mozilla_net_DNSRequestParent_h