Coverage Report

Created: 2018-09-25 14:53

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