Coverage Report

Created: 2018-09-25 14:53

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