tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DNSRequestParent.h (1671B)


      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/. */
      6 
      7 #ifndef mozilla_net_DNSRequestParent_h
      8 #define mozilla_net_DNSRequestParent_h
      9 
     10 #include "mozilla/net/DNSRequestBase.h"
     11 #include "mozilla/net/PDNSRequestParent.h"
     12 #include "nsIDNSListener.h"
     13 
     14 namespace mozilla {
     15 namespace net {
     16 
     17 class DNSRequestParent : public DNSRequestActor, public PDNSRequestParent {
     18 public:
     19  friend class PDNSRequestParent;
     20  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DNSRequestParent, override)
     21 
     22  explicit DNSRequestParent(DNSRequestBase* aRequest);
     23 
     24  bool CanSend() const override { return PDNSRequestParent::CanSend(); }
     25  DNSRequestChild* AsDNSRequestChild() override { return nullptr; }
     26  DNSRequestParent* AsDNSRequestParent() override { return this; }
     27 
     28 private:
     29  virtual ~DNSRequestParent() = default;
     30 
     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;
     40 };
     41 
     42 }  // namespace net
     43 }  // namespace mozilla
     44 
     45 #endif  // mozilla_net_DNSRequestParent_h