Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/MediaKeySystemAccessBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM MediaKeySystemAccess.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_MediaKeySystemAccessBinding_h
4
#define mozilla_dom_MediaKeySystemAccessBinding_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 MediaKeySystemAccess;
18
struct MediaKeySystemAccessAtoms;
19
struct MediaKeySystemConfigurationAtoms;
20
struct MediaKeySystemMediaCapability;
21
struct MediaKeySystemMediaCapabilityAtoms;
22
struct NativePropertyHooks;
23
class ProtoAndIfaceCache;
24
25
} // namespace dom
26
} // namespace mozilla
27
28
namespace mozilla {
29
namespace dom {
30
31
enum class MediaKeysRequirement : uint8_t {
32
  Required,
33
  Optional,
34
  Not_allowed,
35
  EndGuard_
36
};
37
38
namespace MediaKeysRequirementValues {
39
extern const EnumEntry strings[4];
40
} // namespace MediaKeysRequirementValues
41
42
bool
43
ToJSValue(JSContext* aCx, MediaKeysRequirement aArgument, JS::MutableHandle<JS::Value> aValue);
44
45
46
struct MediaKeySystemMediaCapability : public DictionaryBase
47
{
48
  MOZ_INIT_OUTSIDE_CTOR nsString mContentType;
49
  MOZ_INIT_OUTSIDE_CTOR nsString mRobustness;
50
51
  MediaKeySystemMediaCapability();
52
53
  explicit inline MediaKeySystemMediaCapability(const FastDictionaryInitializer& )
54
0
  {
55
0
    // Do nothing here; this is used by our "Fast" subclass
56
0
  }
57
58
  explicit inline MediaKeySystemMediaCapability(const MediaKeySystemMediaCapability& aOther)
59
0
  {
60
0
    *this = aOther;
61
0
  }
62
63
  bool
64
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
65
66
  bool
67
  Init(const nsAString& aJSON);
68
69
  bool
70
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
71
72
  bool
73
  ToJSON(nsAString& aJSON) const;
74
75
  void
76
  TraceDictionary(JSTracer* trc);
77
78
  MediaKeySystemMediaCapability&
79
  operator=(const MediaKeySystemMediaCapability& aOther);
80
81
private:
82
  static bool
83
  InitIds(JSContext* cx, MediaKeySystemMediaCapabilityAtoms* atomsCache);
84
};
85
86
namespace binding_detail {
87
struct FastMediaKeySystemMediaCapability : public MediaKeySystemMediaCapability
88
{
89
  inline FastMediaKeySystemMediaCapability()
90
    : MediaKeySystemMediaCapability(FastDictionaryInitializer())
91
0
  {
92
0
    // Doesn't matter what int we pass to the parent constructor
93
0
  }
94
};
95
} // namespace binding_detail
96
97
98
struct MediaKeySystemConfiguration : public DictionaryBase
99
{
100
  MOZ_INIT_OUTSIDE_CTOR Sequence<MediaKeySystemMediaCapability> mAudioCapabilities;
101
  MOZ_INIT_OUTSIDE_CTOR MediaKeysRequirement mDistinctiveIdentifier;
102
  MOZ_INIT_OUTSIDE_CTOR Sequence<nsString> mInitDataTypes;
103
  MOZ_INIT_OUTSIDE_CTOR nsString mLabel;
104
  MOZ_INIT_OUTSIDE_CTOR MediaKeysRequirement mPersistentState;
105
  MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mSessionTypes;
106
  MOZ_INIT_OUTSIDE_CTOR Sequence<MediaKeySystemMediaCapability> mVideoCapabilities;
107
108
  MediaKeySystemConfiguration();
109
110
  explicit inline MediaKeySystemConfiguration(const FastDictionaryInitializer& )
111
0
  {
112
0
    // Do nothing here; this is used by our "Fast" subclass
113
0
  }
114
115
  explicit inline MediaKeySystemConfiguration(const MediaKeySystemConfiguration& aOther)
116
0
  {
117
0
    *this = aOther;
118
0
  }
119
120
  bool
121
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
122
123
  bool
124
  Init(const nsAString& aJSON);
125
126
  bool
127
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
128
129
  bool
130
  ToJSON(nsAString& aJSON) const;
131
132
  void
133
  TraceDictionary(JSTracer* trc);
134
135
  MediaKeySystemConfiguration&
136
  operator=(const MediaKeySystemConfiguration& aOther);
137
138
private:
139
  static bool
140
  InitIds(JSContext* cx, MediaKeySystemConfigurationAtoms* atomsCache);
141
};
142
143
namespace binding_detail {
144
struct FastMediaKeySystemConfiguration : public MediaKeySystemConfiguration
145
{
146
  inline FastMediaKeySystemConfiguration()
147
    : MediaKeySystemConfiguration(FastDictionaryInitializer())
148
0
  {
149
0
    // Doesn't matter what int we pass to the parent constructor
150
0
  }
151
};
152
} // namespace binding_detail
153
154
155
namespace MediaKeySystemAccess_Binding {
156
157
  typedef mozilla::dom::MediaKeySystemAccess NativeType;
158
159
  const JSClass*
160
  GetJSClass();
161
162
  bool
163
  Wrap(JSContext* aCx, mozilla::dom::MediaKeySystemAccess* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
164
165
  template <class T>
166
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
167
0
  {
168
0
    JS::Rooted<JSObject*> reflector(aCx);
169
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
170
0
  }
171
172
  // We declare this as an array so that retrieving a pointer to this
173
  // binding's property hooks only requires compile/link-time resolvable
174
  // address arithmetic.  Declaring it as a pointer instead would require
175
  // doing a run-time load to fetch a pointer to this binding's property
176
  // hooks.  And then structures which embedded a pointer to this structure
177
  // would require a run-time load for proper initialization, which would
178
  // then induce static constructors.  Lots of static constructors.
179
  extern const NativePropertyHooks sNativePropertyHooks[];
180
181
  void
182
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
183
184
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
185
0
  {
186
0
    /* Get the interface prototype object for this class.  This will create the
187
0
       object as needed. */
188
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::MediaKeySystemAccess,
189
0
                                       &CreateInterfaceObjects,
190
0
                                       /* aDefineOnGlobal = */ true);
191
0
192
0
  }
193
194
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
195
0
  {
196
0
    /* Get the interface object for this class.  This will create the object as
197
0
       needed. */
198
0
199
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::MediaKeySystemAccess,
200
0
                                       &CreateInterfaceObjects,
201
0
                                       aDefineOnGlobal);
202
0
  }
203
204
  JSObject*
205
  GetConstructorObject(JSContext* aCx);
206
207
} // namespace MediaKeySystemAccess_Binding
208
209
210
211
} // namespace dom
212
} // namespace mozilla
213
214
#endif // mozilla_dom_MediaKeySystemAccessBinding_h