Coverage Report

Created: 2018-09-25 14:53

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