Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/net/DNSRequestChild.h
Line
Count
Source (jump to first uncovered line)
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_DNSRequestChild_h
8
#define mozilla_net_DNSRequestChild_h
9
10
#include "mozilla/net/PDNSRequestChild.h"
11
#include "nsICancelable.h"
12
#include "nsIDNSRecord.h"
13
#include "nsIDNSListener.h"
14
#include "nsIDNSByTypeRecord.h"
15
#include "nsIEventTarget.h"
16
17
namespace mozilla {
18
namespace net {
19
20
class DNSRequestChild final
21
  : public PDNSRequestChild
22
  , public nsICancelable
23
{
24
public:
25
  NS_DECL_THREADSAFE_ISUPPORTS
26
  NS_DECL_NSICANCELABLE
27
28
  DNSRequestChild(const nsACString& aHost,
29
                  const uint16_t& aType,
30
                  const OriginAttributes& aOriginAttributes,
31
                  const uint32_t& aFlags,
32
                  nsIDNSListener *aListener, nsIEventTarget *target);
33
34
0
  void AddIPDLReference() {
35
0
    AddRef();
36
0
  }
37
  void ReleaseIPDLReference();
38
39
  // Sends IPDL request to parent
40
  void StartRequest();
41
  void CallOnLookupComplete();
42
  void CallOnLookupByTypeComplete();
43
44
protected:
45
  friend class CancelDNSRequestEvent;
46
  friend class ChildDNSService;
47
0
  virtual ~DNSRequestChild() {}
48
49
  virtual mozilla::ipc::IPCResult RecvLookupCompleted(const DNSRequestResponse& reply) override;
50
  virtual void ActorDestroy(ActorDestroyReason why) override;
51
52
  nsCOMPtr<nsIDNSListener>     mListener;
53
  nsCOMPtr<nsIEventTarget>     mTarget;
54
  nsCOMPtr<nsIDNSRecord>       mResultRecord;
55
  nsCOMPtr<nsIDNSByTypeRecord> mResultByTypeRecords; // the result of a by-type
56
                                                     // query (mType must not be
57
                                                     // equal to
58
                                                     // nsIDNSService::RESOLVE_TYPE_DEFAULT
59
                                                     // (this is reserved for
60
                                                     // the standard A/AAAA query)).
61
  nsresult                     mResultStatus;
62
  nsCString                    mHost;
63
  uint16_t                     mType;
64
  const OriginAttributes       mOriginAttributes;
65
  uint16_t                     mFlags;
66
  bool                         mIPCOpen;
67
};
68
69
} // namespace net
70
} // namespace mozilla
71
72
#endif // mozilla_net_DNSRequestChild_h