Coverage Report

Created: 2018-09-25 14:53

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