Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/MediaStreamEventBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM MediaStreamEvent.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_MediaStreamEventBinding_h
4
#define mozilla_dom_MediaStreamEventBinding_h
5
6
#include "DOMMediaStream.h"
7
#include "EventBinding.h"
8
#include "GeckoProfiler.h"
9
#include "js/RootingAPI.h"
10
#include "jspubtd.h"
11
#include "mozilla/ErrorResult.h"
12
#include "mozilla/dom/BindingDeclarations.h"
13
#include "mozilla/dom/Nullable.h"
14
#include "mozilla/dom/PrototypeList.h"
15
16
namespace mozilla {
17
18
class DOMMediaStream;
19
20
namespace dom {
21
22
class MediaStreamEvent;
23
struct MediaStreamEventAtoms;
24
struct MediaStreamEventInitAtoms;
25
struct NativePropertyHooks;
26
class ProtoAndIfaceCache;
27
28
} // namespace dom
29
30
} // namespace mozilla
31
32
namespace mozilla {
33
namespace dom {
34
35
struct MediaStreamEventInit : public EventInit
36
{
37
  MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::DOMMediaStream> mStream;
38
39
  MediaStreamEventInit();
40
41
  explicit inline MediaStreamEventInit(const FastDictionaryInitializer& )
42
    : EventInit(FastDictionaryInitializer())
43
0
  {
44
0
    // Do nothing here; this is used by our "Fast" subclass
45
0
  }
46
47
  explicit inline MediaStreamEventInit(const MediaStreamEventInit& 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, mStream, "mStream", aFlags);
65
0
  }
66
67
  inline void
68
  UnlinkForCC()
69
0
  {
70
0
    ImplCycleCollectionUnlink(mStream);
71
0
  }
72
73
  MediaStreamEventInit&
74
  operator=(const MediaStreamEventInit& aOther);
75
76
private:
77
  static bool
78
  InitIds(JSContext* cx, MediaStreamEventInitAtoms* atomsCache);
79
};
80
81
namespace binding_detail {
82
struct FastMediaStreamEventInit : public MediaStreamEventInit
83
{
84
  inline FastMediaStreamEventInit()
85
    : MediaStreamEventInit(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 MediaStreamEvent_Binding {
94
95
  typedef mozilla::dom::MediaStreamEvent 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::MediaStreamEvent* 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::MediaStreamEvent,
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::MediaStreamEvent,
141
0
                                       &CreateInterfaceObjects,
142
0
                                       aDefineOnGlobal);
143
0
  }
144
145
  JSObject*
146
  GetConstructorObject(JSContext* aCx);
147
148
} // namespace MediaStreamEvent_Binding
149
150
151
152
} // namespace dom
153
} // namespace mozilla
154
155
#endif // mozilla_dom_MediaStreamEventBinding_h