Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/TCPServerSocketBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM TCPServerSocket.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_TCPServerSocketBinding_h
4
#define mozilla_dom_TCPServerSocketBinding_h
5
6
#include "GeckoProfiler.h"
7
#include "TCPSocketBinding.h"
8
#include "js/RootingAPI.h"
9
#include "jspubtd.h"
10
#include "mozilla/ErrorResult.h"
11
#include "mozilla/dom/BindingDeclarations.h"
12
#include "mozilla/dom/Nullable.h"
13
#include "mozilla/dom/PrototypeList.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
struct NativePropertyHooks;
19
class ProtoAndIfaceCache;
20
struct ServerSocketOptionsAtoms;
21
class TCPServerSocket;
22
struct TCPServerSocketAtoms;
23
24
} // namespace dom
25
} // namespace mozilla
26
27
namespace mozilla {
28
namespace dom {
29
30
struct ServerSocketOptions : public DictionaryBase
31
{
32
  MOZ_INIT_OUTSIDE_CTOR TCPSocketBinaryType mBinaryType;
33
34
  ServerSocketOptions();
35
36
  explicit inline ServerSocketOptions(const FastDictionaryInitializer& )
37
0
  {
38
0
    // Do nothing here; this is used by our "Fast" subclass
39
0
  }
40
41
  explicit inline ServerSocketOptions(const ServerSocketOptions& aOther)
42
0
  {
43
0
    *this = aOther;
44
0
  }
45
46
  bool
47
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
48
49
  bool
50
  Init(const nsAString& aJSON);
51
52
  bool
53
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
54
55
  bool
56
  ToJSON(nsAString& aJSON) const;
57
58
  void
59
  TraceDictionary(JSTracer* trc);
60
61
  ServerSocketOptions&
62
  operator=(const ServerSocketOptions& aOther);
63
64
private:
65
  static bool
66
  InitIds(JSContext* cx, ServerSocketOptionsAtoms* atomsCache);
67
};
68
69
namespace binding_detail {
70
struct FastServerSocketOptions : public ServerSocketOptions
71
{
72
  inline FastServerSocketOptions()
73
    : ServerSocketOptions(FastDictionaryInitializer())
74
0
  {
75
0
    // Doesn't matter what int we pass to the parent constructor
76
0
  }
77
};
78
} // namespace binding_detail
79
80
81
namespace TCPServerSocket_Binding {
82
83
  typedef mozilla::dom::TCPServerSocket NativeType;
84
85
  bool
86
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
87
88
  const JSClass*
89
  GetJSClass();
90
91
  bool
92
  Wrap(JSContext* aCx, mozilla::dom::TCPServerSocket* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
93
94
  template <class T>
95
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
96
0
  {
97
0
    JS::Rooted<JSObject*> reflector(aCx);
98
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
99
0
  }
100
101
  // We declare this as an array so that retrieving a pointer to this
102
  // binding's property hooks only requires compile/link-time resolvable
103
  // address arithmetic.  Declaring it as a pointer instead would require
104
  // doing a run-time load to fetch a pointer to this binding's property
105
  // hooks.  And then structures which embedded a pointer to this structure
106
  // would require a run-time load for proper initialization, which would
107
  // then induce static constructors.  Lots of static constructors.
108
  extern const NativePropertyHooks sNativePropertyHooks[];
109
110
  void
111
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
112
113
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
114
0
  {
115
0
    /* Get the interface prototype object for this class.  This will create the
116
0
       object as needed. */
117
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::TCPServerSocket,
118
0
                                       &CreateInterfaceObjects,
119
0
                                       /* aDefineOnGlobal = */ true);
120
0
121
0
  }
122
123
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
124
0
  {
125
0
    /* Get the interface object for this class.  This will create the object as
126
0
       needed. */
127
0
128
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::TCPServerSocket,
129
0
                                       &CreateInterfaceObjects,
130
0
                                       aDefineOnGlobal);
131
0
  }
132
133
  JSObject*
134
  GetConstructorObject(JSContext* aCx);
135
136
} // namespace TCPServerSocket_Binding
137
138
139
140
} // namespace dom
141
} // namespace mozilla
142
143
#endif // mozilla_dom_TCPServerSocketBinding_h