Coverage Report

Created: 2018-09-25 14:53

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