Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/ClientsBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM Clients.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_ClientsBinding_h
4
#define mozilla_dom_ClientsBinding_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
struct ClientQueryOptionsAtoms;
18
class Clients;
19
struct ClientsAtoms;
20
struct NativePropertyHooks;
21
class ProtoAndIfaceCache;
22
23
} // namespace dom
24
} // namespace mozilla
25
26
namespace mozilla {
27
namespace dom {
28
29
enum class ClientType : uint8_t {
30
  Window,
31
  Worker,
32
  Sharedworker,
33
  Serviceworker,
34
  All,
35
  EndGuard_
36
};
37
38
namespace ClientTypeValues {
39
extern const EnumEntry strings[6];
40
} // namespace ClientTypeValues
41
42
bool
43
ToJSValue(JSContext* aCx, ClientType aArgument, JS::MutableHandle<JS::Value> aValue);
44
45
46
struct ClientQueryOptions : public DictionaryBase
47
{
48
  MOZ_INIT_OUTSIDE_CTOR bool mIncludeUncontrolled;
49
  MOZ_INIT_OUTSIDE_CTOR ClientType mType;
50
51
  ClientQueryOptions();
52
53
  explicit inline ClientQueryOptions(const FastDictionaryInitializer& )
54
0
  {
55
0
    // Do nothing here; this is used by our "Fast" subclass
56
0
  }
57
58
  explicit inline ClientQueryOptions(const ClientQueryOptions& 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
  ClientQueryOptions&
79
  operator=(const ClientQueryOptions& aOther);
80
81
private:
82
  static bool
83
  InitIds(JSContext* cx, ClientQueryOptionsAtoms* atomsCache);
84
};
85
86
namespace binding_detail {
87
struct FastClientQueryOptions : public ClientQueryOptions
88
{
89
  inline FastClientQueryOptions()
90
    : ClientQueryOptions(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
namespace Clients_Binding {
99
100
  typedef mozilla::dom::Clients NativeType;
101
102
  bool
103
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
104
105
  const JSClass*
106
  GetJSClass();
107
108
  bool
109
  Wrap(JSContext* aCx, mozilla::dom::Clients* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
110
111
  template <class T>
112
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
113
0
  {
114
0
    JS::Rooted<JSObject*> reflector(aCx);
115
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
116
0
  }
117
118
  void
119
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
120
121
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
122
0
  {
123
0
    /* Get the interface prototype object for this class.  This will create the
124
0
       object as needed. */
125
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::Clients,
126
0
                                       &CreateInterfaceObjects,
127
0
                                       /* aDefineOnGlobal = */ true);
128
0
129
0
  }
130
131
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
132
0
  {
133
0
    /* Get the interface object for this class.  This will create the object as
134
0
       needed. */
135
0
136
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::Clients,
137
0
                                       &CreateInterfaceObjects,
138
0
                                       aDefineOnGlobal);
139
0
  }
140
141
  JSObject*
142
  GetConstructorObject(JSContext* aCx);
143
144
} // namespace Clients_Binding
145
146
147
148
} // namespace dom
149
} // namespace mozilla
150
151
#endif // mozilla_dom_ClientsBinding_h