Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/PerformanceResourceTimingBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM PerformanceResourceTiming.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "PerformanceEntryBinding.h"
4
#include "PerformanceResourceTimingBinding.h"
5
#include "WrapperFactory.h"
6
#include "XrayWrapper.h"
7
#include "mozilla/FloatingPoint.h"
8
#include "mozilla/OwningNonNull.h"
9
#include "mozilla/dom/BindingUtils.h"
10
#include "mozilla/dom/DOMJSClass.h"
11
#include "mozilla/dom/NonRefcountedDOMObject.h"
12
#include "mozilla/dom/PerformanceResourceTiming.h"
13
#include "mozilla/dom/PerformanceServerTiming.h"
14
#include "mozilla/dom/PrimitiveConversions.h"
15
#include "mozilla/dom/XrayExpandoClass.h"
16
17
namespace mozilla {
18
namespace dom {
19
20
namespace binding_detail {}; // Just to make sure it's known as a namespace
21
using namespace mozilla::dom::binding_detail;
22
23
24
namespace PerformanceResourceTiming_Binding {
25
26
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<PerformanceEntry_Binding::NativeType>::value,
27
              "Can't inherit from an interface with a different ownership model.");
28
29
MOZ_CAN_RUN_SCRIPT static bool
30
get_initiatorType(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
31
0
{
32
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.initiatorType", DOM, cx);
33
0
34
0
  DOMString result;
35
0
  self->GetInitiatorType(result);
36
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
37
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
38
0
    return false;
39
0
  }
40
0
  return true;
41
0
}
42
43
static const JSJitInfo initiatorType_getterinfo = {
44
  { (JSJitGetterOp)get_initiatorType },
45
  { prototypes::id::PerformanceResourceTiming },
46
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
47
  JSJitInfo::Getter,
48
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
49
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
50
  false,  /* isInfallible. False in setters. */
51
  false,  /* isMovable.  Not relevant for setters. */
52
  false, /* isEliminatable.  Not relevant for setters. */
53
  false, /* isAlwaysInSlot.  Only relevant for getters. */
54
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
55
  false,  /* isTypedMethod.  Only relevant for methods. */
56
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
57
};
58
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
59
static_assert(0 < 2, "There is no slot for us");
60
61
MOZ_CAN_RUN_SCRIPT static bool
62
get_nextHopProtocol(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
63
0
{
64
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.nextHopProtocol", DOM, cx);
65
0
66
0
  DOMString result;
67
0
  self->GetNextHopProtocol(result);
68
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
69
0
  if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
70
0
    return false;
71
0
  }
72
0
  return true;
73
0
}
74
75
static const JSJitInfo nextHopProtocol_getterinfo = {
76
  { (JSJitGetterOp)get_nextHopProtocol },
77
  { prototypes::id::PerformanceResourceTiming },
78
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
79
  JSJitInfo::Getter,
80
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
81
  JSVAL_TYPE_STRING,  /* returnType.  Not relevant for setters. */
82
  false,  /* isInfallible. False in setters. */
83
  false,  /* isMovable.  Not relevant for setters. */
84
  false, /* isEliminatable.  Not relevant for setters. */
85
  false, /* isAlwaysInSlot.  Only relevant for getters. */
86
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
87
  false,  /* isTypedMethod.  Only relevant for methods. */
88
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
89
};
90
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
91
static_assert(0 < 2, "There is no slot for us");
92
93
MOZ_CAN_RUN_SCRIPT static bool
94
get_workerStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
95
0
{
96
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.workerStart", DOM, cx);
97
0
98
0
  double result(self->WorkerStart());
99
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
100
0
  args.rval().set(JS_NumberValue(double(result)));
101
0
  return true;
102
0
}
103
104
static const JSJitInfo workerStart_getterinfo = {
105
  { (JSJitGetterOp)get_workerStart },
106
  { prototypes::id::PerformanceResourceTiming },
107
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
108
  JSJitInfo::Getter,
109
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
110
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
111
  true,  /* isInfallible. False in setters. */
112
  false,  /* isMovable.  Not relevant for setters. */
113
  false, /* isEliminatable.  Not relevant for setters. */
114
  false, /* isAlwaysInSlot.  Only relevant for getters. */
115
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
116
  false,  /* isTypedMethod.  Only relevant for methods. */
117
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
118
};
119
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
120
static_assert(0 < 2, "There is no slot for us");
121
122
MOZ_CAN_RUN_SCRIPT static bool
123
get_redirectStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
124
0
{
125
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.redirectStart", DOM, cx);
126
0
127
0
  Maybe<nsIPrincipal*> subjectPrincipal;
128
0
  if (NS_IsMainThread()) {
129
0
    JS::Realm* realm = js::GetContextRealm(cx);
130
0
    MOZ_ASSERT(realm);
131
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
132
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
133
0
134
0
    subjectPrincipal.emplace(principal);
135
0
  }
136
0
  double result(self->RedirectStart(subjectPrincipal));
137
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
138
0
  args.rval().set(JS_NumberValue(double(result)));
139
0
  return true;
140
0
}
141
142
static const JSJitInfo redirectStart_getterinfo = {
143
  { (JSJitGetterOp)get_redirectStart },
144
  { prototypes::id::PerformanceResourceTiming },
145
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
146
  JSJitInfo::Getter,
147
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
148
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
149
  true,  /* isInfallible. False in setters. */
150
  false,  /* isMovable.  Not relevant for setters. */
151
  false, /* isEliminatable.  Not relevant for setters. */
152
  false, /* isAlwaysInSlot.  Only relevant for getters. */
153
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
154
  false,  /* isTypedMethod.  Only relevant for methods. */
155
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
156
};
157
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
158
static_assert(0 < 2, "There is no slot for us");
159
160
MOZ_CAN_RUN_SCRIPT static bool
161
get_redirectEnd(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
162
0
{
163
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.redirectEnd", DOM, cx);
164
0
165
0
  Maybe<nsIPrincipal*> subjectPrincipal;
166
0
  if (NS_IsMainThread()) {
167
0
    JS::Realm* realm = js::GetContextRealm(cx);
168
0
    MOZ_ASSERT(realm);
169
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
170
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
171
0
172
0
    subjectPrincipal.emplace(principal);
173
0
  }
174
0
  double result(self->RedirectEnd(subjectPrincipal));
175
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
176
0
  args.rval().set(JS_NumberValue(double(result)));
177
0
  return true;
178
0
}
179
180
static const JSJitInfo redirectEnd_getterinfo = {
181
  { (JSJitGetterOp)get_redirectEnd },
182
  { prototypes::id::PerformanceResourceTiming },
183
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
184
  JSJitInfo::Getter,
185
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
186
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
187
  true,  /* isInfallible. False in setters. */
188
  false,  /* isMovable.  Not relevant for setters. */
189
  false, /* isEliminatable.  Not relevant for setters. */
190
  false, /* isAlwaysInSlot.  Only relevant for getters. */
191
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
192
  false,  /* isTypedMethod.  Only relevant for methods. */
193
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
194
};
195
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
196
static_assert(0 < 2, "There is no slot for us");
197
198
MOZ_CAN_RUN_SCRIPT static bool
199
get_fetchStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
200
0
{
201
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.fetchStart", DOM, cx);
202
0
203
0
  double result(self->FetchStart());
204
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
205
0
  args.rval().set(JS_NumberValue(double(result)));
206
0
  return true;
207
0
}
208
209
static const JSJitInfo fetchStart_getterinfo = {
210
  { (JSJitGetterOp)get_fetchStart },
211
  { prototypes::id::PerformanceResourceTiming },
212
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
213
  JSJitInfo::Getter,
214
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
215
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
216
  true,  /* isInfallible. False in setters. */
217
  false,  /* isMovable.  Not relevant for setters. */
218
  false, /* isEliminatable.  Not relevant for setters. */
219
  false, /* isAlwaysInSlot.  Only relevant for getters. */
220
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
221
  false,  /* isTypedMethod.  Only relevant for methods. */
222
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
223
};
224
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
225
static_assert(0 < 2, "There is no slot for us");
226
227
MOZ_CAN_RUN_SCRIPT static bool
228
get_domainLookupStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
229
0
{
230
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.domainLookupStart", DOM, cx);
231
0
232
0
  Maybe<nsIPrincipal*> subjectPrincipal;
233
0
  if (NS_IsMainThread()) {
234
0
    JS::Realm* realm = js::GetContextRealm(cx);
235
0
    MOZ_ASSERT(realm);
236
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
237
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
238
0
239
0
    subjectPrincipal.emplace(principal);
240
0
  }
241
0
  double result(self->DomainLookupStart(subjectPrincipal));
242
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
243
0
  args.rval().set(JS_NumberValue(double(result)));
244
0
  return true;
245
0
}
246
247
static const JSJitInfo domainLookupStart_getterinfo = {
248
  { (JSJitGetterOp)get_domainLookupStart },
249
  { prototypes::id::PerformanceResourceTiming },
250
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
251
  JSJitInfo::Getter,
252
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
253
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
254
  true,  /* isInfallible. False in setters. */
255
  false,  /* isMovable.  Not relevant for setters. */
256
  false, /* isEliminatable.  Not relevant for setters. */
257
  false, /* isAlwaysInSlot.  Only relevant for getters. */
258
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
259
  false,  /* isTypedMethod.  Only relevant for methods. */
260
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
261
};
262
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
263
static_assert(0 < 2, "There is no slot for us");
264
265
MOZ_CAN_RUN_SCRIPT static bool
266
get_domainLookupEnd(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
267
0
{
268
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.domainLookupEnd", DOM, cx);
269
0
270
0
  Maybe<nsIPrincipal*> subjectPrincipal;
271
0
  if (NS_IsMainThread()) {
272
0
    JS::Realm* realm = js::GetContextRealm(cx);
273
0
    MOZ_ASSERT(realm);
274
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
275
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
276
0
277
0
    subjectPrincipal.emplace(principal);
278
0
  }
279
0
  double result(self->DomainLookupEnd(subjectPrincipal));
280
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
281
0
  args.rval().set(JS_NumberValue(double(result)));
282
0
  return true;
283
0
}
284
285
static const JSJitInfo domainLookupEnd_getterinfo = {
286
  { (JSJitGetterOp)get_domainLookupEnd },
287
  { prototypes::id::PerformanceResourceTiming },
288
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
289
  JSJitInfo::Getter,
290
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
291
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
292
  true,  /* isInfallible. False in setters. */
293
  false,  /* isMovable.  Not relevant for setters. */
294
  false, /* isEliminatable.  Not relevant for setters. */
295
  false, /* isAlwaysInSlot.  Only relevant for getters. */
296
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
297
  false,  /* isTypedMethod.  Only relevant for methods. */
298
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
299
};
300
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
301
static_assert(0 < 2, "There is no slot for us");
302
303
MOZ_CAN_RUN_SCRIPT static bool
304
get_connectStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
305
0
{
306
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.connectStart", DOM, cx);
307
0
308
0
  Maybe<nsIPrincipal*> subjectPrincipal;
309
0
  if (NS_IsMainThread()) {
310
0
    JS::Realm* realm = js::GetContextRealm(cx);
311
0
    MOZ_ASSERT(realm);
312
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
313
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
314
0
315
0
    subjectPrincipal.emplace(principal);
316
0
  }
317
0
  double result(self->ConnectStart(subjectPrincipal));
318
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
319
0
  args.rval().set(JS_NumberValue(double(result)));
320
0
  return true;
321
0
}
322
323
static const JSJitInfo connectStart_getterinfo = {
324
  { (JSJitGetterOp)get_connectStart },
325
  { prototypes::id::PerformanceResourceTiming },
326
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
327
  JSJitInfo::Getter,
328
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
329
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
330
  true,  /* isInfallible. False in setters. */
331
  false,  /* isMovable.  Not relevant for setters. */
332
  false, /* isEliminatable.  Not relevant for setters. */
333
  false, /* isAlwaysInSlot.  Only relevant for getters. */
334
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
335
  false,  /* isTypedMethod.  Only relevant for methods. */
336
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
337
};
338
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
339
static_assert(0 < 2, "There is no slot for us");
340
341
MOZ_CAN_RUN_SCRIPT static bool
342
get_connectEnd(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
343
0
{
344
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.connectEnd", DOM, cx);
345
0
346
0
  Maybe<nsIPrincipal*> subjectPrincipal;
347
0
  if (NS_IsMainThread()) {
348
0
    JS::Realm* realm = js::GetContextRealm(cx);
349
0
    MOZ_ASSERT(realm);
350
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
351
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
352
0
353
0
    subjectPrincipal.emplace(principal);
354
0
  }
355
0
  double result(self->ConnectEnd(subjectPrincipal));
356
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
357
0
  args.rval().set(JS_NumberValue(double(result)));
358
0
  return true;
359
0
}
360
361
static const JSJitInfo connectEnd_getterinfo = {
362
  { (JSJitGetterOp)get_connectEnd },
363
  { prototypes::id::PerformanceResourceTiming },
364
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
365
  JSJitInfo::Getter,
366
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
367
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
368
  true,  /* isInfallible. False in setters. */
369
  false,  /* isMovable.  Not relevant for setters. */
370
  false, /* isEliminatable.  Not relevant for setters. */
371
  false, /* isAlwaysInSlot.  Only relevant for getters. */
372
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
373
  false,  /* isTypedMethod.  Only relevant for methods. */
374
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
375
};
376
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
377
static_assert(0 < 2, "There is no slot for us");
378
379
MOZ_CAN_RUN_SCRIPT static bool
380
get_secureConnectionStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
381
0
{
382
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.secureConnectionStart", DOM, cx);
383
0
384
0
  Maybe<nsIPrincipal*> subjectPrincipal;
385
0
  if (NS_IsMainThread()) {
386
0
    JS::Realm* realm = js::GetContextRealm(cx);
387
0
    MOZ_ASSERT(realm);
388
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
389
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
390
0
391
0
    subjectPrincipal.emplace(principal);
392
0
  }
393
0
  double result(self->SecureConnectionStart(subjectPrincipal));
394
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
395
0
  args.rval().set(JS_NumberValue(double(result)));
396
0
  return true;
397
0
}
398
399
static const JSJitInfo secureConnectionStart_getterinfo = {
400
  { (JSJitGetterOp)get_secureConnectionStart },
401
  { prototypes::id::PerformanceResourceTiming },
402
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
403
  JSJitInfo::Getter,
404
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
405
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
406
  true,  /* isInfallible. False in setters. */
407
  false,  /* isMovable.  Not relevant for setters. */
408
  false, /* isEliminatable.  Not relevant for setters. */
409
  false, /* isAlwaysInSlot.  Only relevant for getters. */
410
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
411
  false,  /* isTypedMethod.  Only relevant for methods. */
412
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
413
};
414
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
415
static_assert(0 < 2, "There is no slot for us");
416
417
MOZ_CAN_RUN_SCRIPT static bool
418
get_requestStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
419
0
{
420
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.requestStart", DOM, cx);
421
0
422
0
  Maybe<nsIPrincipal*> subjectPrincipal;
423
0
  if (NS_IsMainThread()) {
424
0
    JS::Realm* realm = js::GetContextRealm(cx);
425
0
    MOZ_ASSERT(realm);
426
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
427
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
428
0
429
0
    subjectPrincipal.emplace(principal);
430
0
  }
431
0
  double result(self->RequestStart(subjectPrincipal));
432
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
433
0
  args.rval().set(JS_NumberValue(double(result)));
434
0
  return true;
435
0
}
436
437
static const JSJitInfo requestStart_getterinfo = {
438
  { (JSJitGetterOp)get_requestStart },
439
  { prototypes::id::PerformanceResourceTiming },
440
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
441
  JSJitInfo::Getter,
442
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
443
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
444
  true,  /* isInfallible. False in setters. */
445
  false,  /* isMovable.  Not relevant for setters. */
446
  false, /* isEliminatable.  Not relevant for setters. */
447
  false, /* isAlwaysInSlot.  Only relevant for getters. */
448
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
449
  false,  /* isTypedMethod.  Only relevant for methods. */
450
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
451
};
452
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
453
static_assert(0 < 2, "There is no slot for us");
454
455
MOZ_CAN_RUN_SCRIPT static bool
456
get_responseStart(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
457
0
{
458
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.responseStart", DOM, cx);
459
0
460
0
  Maybe<nsIPrincipal*> subjectPrincipal;
461
0
  if (NS_IsMainThread()) {
462
0
    JS::Realm* realm = js::GetContextRealm(cx);
463
0
    MOZ_ASSERT(realm);
464
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
465
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
466
0
467
0
    subjectPrincipal.emplace(principal);
468
0
  }
469
0
  double result(self->ResponseStart(subjectPrincipal));
470
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
471
0
  args.rval().set(JS_NumberValue(double(result)));
472
0
  return true;
473
0
}
474
475
static const JSJitInfo responseStart_getterinfo = {
476
  { (JSJitGetterOp)get_responseStart },
477
  { prototypes::id::PerformanceResourceTiming },
478
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
479
  JSJitInfo::Getter,
480
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
481
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
482
  true,  /* isInfallible. False in setters. */
483
  false,  /* isMovable.  Not relevant for setters. */
484
  false, /* isEliminatable.  Not relevant for setters. */
485
  false, /* isAlwaysInSlot.  Only relevant for getters. */
486
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
487
  false,  /* isTypedMethod.  Only relevant for methods. */
488
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
489
};
490
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
491
static_assert(0 < 2, "There is no slot for us");
492
493
MOZ_CAN_RUN_SCRIPT static bool
494
get_responseEnd(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
495
0
{
496
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.responseEnd", DOM, cx);
497
0
498
0
  double result(self->ResponseEnd());
499
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
500
0
  args.rval().set(JS_NumberValue(double(result)));
501
0
  return true;
502
0
}
503
504
static const JSJitInfo responseEnd_getterinfo = {
505
  { (JSJitGetterOp)get_responseEnd },
506
  { prototypes::id::PerformanceResourceTiming },
507
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
508
  JSJitInfo::Getter,
509
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
510
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
511
  true,  /* isInfallible. False in setters. */
512
  false,  /* isMovable.  Not relevant for setters. */
513
  false, /* isEliminatable.  Not relevant for setters. */
514
  false, /* isAlwaysInSlot.  Only relevant for getters. */
515
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
516
  false,  /* isTypedMethod.  Only relevant for methods. */
517
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
518
};
519
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
520
static_assert(0 < 2, "There is no slot for us");
521
522
MOZ_CAN_RUN_SCRIPT static bool
523
get_transferSize(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
524
0
{
525
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.transferSize", DOM, cx);
526
0
527
0
  Maybe<nsIPrincipal*> subjectPrincipal;
528
0
  if (NS_IsMainThread()) {
529
0
    JS::Realm* realm = js::GetContextRealm(cx);
530
0
    MOZ_ASSERT(realm);
531
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
532
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
533
0
534
0
    subjectPrincipal.emplace(principal);
535
0
  }
536
0
  uint64_t result(self->TransferSize(subjectPrincipal));
537
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
538
0
  args.rval().set(JS_NumberValue(double(result)));
539
0
  return true;
540
0
}
541
542
static const JSJitInfo transferSize_getterinfo = {
543
  { (JSJitGetterOp)get_transferSize },
544
  { prototypes::id::PerformanceResourceTiming },
545
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
546
  JSJitInfo::Getter,
547
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
548
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
549
  true,  /* isInfallible. False in setters. */
550
  false,  /* isMovable.  Not relevant for setters. */
551
  false, /* isEliminatable.  Not relevant for setters. */
552
  false, /* isAlwaysInSlot.  Only relevant for getters. */
553
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
554
  false,  /* isTypedMethod.  Only relevant for methods. */
555
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
556
};
557
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
558
static_assert(0 < 2, "There is no slot for us");
559
560
MOZ_CAN_RUN_SCRIPT static bool
561
get_encodedBodySize(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
562
0
{
563
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.encodedBodySize", DOM, cx);
564
0
565
0
  Maybe<nsIPrincipal*> subjectPrincipal;
566
0
  if (NS_IsMainThread()) {
567
0
    JS::Realm* realm = js::GetContextRealm(cx);
568
0
    MOZ_ASSERT(realm);
569
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
570
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
571
0
572
0
    subjectPrincipal.emplace(principal);
573
0
  }
574
0
  uint64_t result(self->EncodedBodySize(subjectPrincipal));
575
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
576
0
  args.rval().set(JS_NumberValue(double(result)));
577
0
  return true;
578
0
}
579
580
static const JSJitInfo encodedBodySize_getterinfo = {
581
  { (JSJitGetterOp)get_encodedBodySize },
582
  { prototypes::id::PerformanceResourceTiming },
583
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
584
  JSJitInfo::Getter,
585
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
586
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
587
  true,  /* isInfallible. False in setters. */
588
  false,  /* isMovable.  Not relevant for setters. */
589
  false, /* isEliminatable.  Not relevant for setters. */
590
  false, /* isAlwaysInSlot.  Only relevant for getters. */
591
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
592
  false,  /* isTypedMethod.  Only relevant for methods. */
593
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
594
};
595
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
596
static_assert(0 < 2, "There is no slot for us");
597
598
MOZ_CAN_RUN_SCRIPT static bool
599
get_decodedBodySize(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
600
0
{
601
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.decodedBodySize", DOM, cx);
602
0
603
0
  Maybe<nsIPrincipal*> subjectPrincipal;
604
0
  if (NS_IsMainThread()) {
605
0
    JS::Realm* realm = js::GetContextRealm(cx);
606
0
    MOZ_ASSERT(realm);
607
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
608
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
609
0
610
0
    subjectPrincipal.emplace(principal);
611
0
  }
612
0
  uint64_t result(self->DecodedBodySize(subjectPrincipal));
613
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
614
0
  args.rval().set(JS_NumberValue(double(result)));
615
0
  return true;
616
0
}
617
618
static const JSJitInfo decodedBodySize_getterinfo = {
619
  { (JSJitGetterOp)get_decodedBodySize },
620
  { prototypes::id::PerformanceResourceTiming },
621
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
622
  JSJitInfo::Getter,
623
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
624
  JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
625
  true,  /* isInfallible. False in setters. */
626
  false,  /* isMovable.  Not relevant for setters. */
627
  false, /* isEliminatable.  Not relevant for setters. */
628
  false, /* isAlwaysInSlot.  Only relevant for getters. */
629
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
630
  false,  /* isTypedMethod.  Only relevant for methods. */
631
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
632
};
633
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
634
static_assert(0 < 2, "There is no slot for us");
635
636
MOZ_CAN_RUN_SCRIPT static bool
637
get_serverTiming(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JSJitGetterCallArgs args)
638
0
{
639
0
  AUTO_PROFILER_LABEL_FAST("get PerformanceResourceTiming.serverTiming", DOM, cx);
640
0
641
0
  // Have to either root across the getter call or reget after.
642
0
  bool isXray;
643
0
  JS::Rooted<JSObject*> slotStorage(cx, GetCachedSlotStorageObject(cx, obj, &isXray));
644
0
  if (!slotStorage) {
645
0
    return false;
646
0
  }
647
0
  const size_t slotIndex = isXray ? (xpc::JSSLOT_EXPANDO_COUNT + 0) : (DOM_INSTANCE_RESERVED_SLOTS + 0);
648
0
  MOZ_ASSERT(JSCLASS_RESERVED_SLOTS(js::GetObjectClass(slotStorage)) > slotIndex);
649
0
  {
650
0
    // Scope for cachedVal
651
0
    JS::Value cachedVal = js::GetReservedSlot(slotStorage, slotIndex);
652
0
    if (!cachedVal.isUndefined()) {
653
0
      args.rval().set(cachedVal);
654
0
      // The cached value is in the compartment of slotStorage,
655
0
      // so wrap into the caller compartment as needed.
656
0
      if (MaybeWrapNonDOMObjectValue(cx, args.rval())) {
657
0
        return true;
658
0
      }
659
0
      return false;
660
0
    }
661
0
  }
662
0
663
0
  Maybe<nsIPrincipal*> subjectPrincipal;
664
0
  if (NS_IsMainThread()) {
665
0
    JS::Realm* realm = js::GetContextRealm(cx);
666
0
    MOZ_ASSERT(realm);
667
0
    JSPrincipals* principals = JS::GetRealmPrincipals(realm);
668
0
    nsIPrincipal* principal = nsJSPrincipals::get(principals);
669
0
670
0
    subjectPrincipal.emplace(principal);
671
0
  }
672
0
  nsTArray<StrongPtrForMember<mozilla::dom::PerformanceServerTiming>::Type> result;
673
0
  self->GetServerTiming(result, subjectPrincipal);
674
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
675
0
  {
676
0
    JS::Rooted<JSObject*> conversionScope(cx, isXray ? JS::CurrentGlobalOrNull(cx) : slotStorage);
677
0
    JSAutoRealm ar(cx, conversionScope);
678
0
    do { // block we break out of when done wrapping
679
0
680
0
      uint32_t length = result.Length();
681
0
      JS::Rooted<JSObject*> returnArray(cx, JS_NewArrayObject(cx, length));
682
0
      if (!returnArray) {
683
0
        return false;
684
0
      }
685
0
      // Scope for 'tmp'
686
0
      {
687
0
        JS::Rooted<JS::Value> tmp(cx);
688
0
        for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
689
0
          // Control block to let us common up the JS_DefineElement calls when there
690
0
          // are different ways to succeed at wrapping the object.
691
0
          do {
692
0
            if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
693
0
              MOZ_ASSERT(JS_IsExceptionPending(cx));
694
0
              return false;
695
0
            }
696
0
            break;
697
0
          } while (false);
698
0
          if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
699
0
                                JSPROP_ENUMERATE)) {
700
0
            return false;
701
0
          }
702
0
        }
703
0
      }
704
0
      args.rval().setObject(*returnArray);
705
0
      break;
706
0
    } while (false);
707
0
    JS::Rooted<JSObject*> rvalObj(cx, &args.rval().toObject());
708
0
    if (!JS_FreezeObject(cx, rvalObj)) {
709
0
      return false;
710
0
    }
711
0
  }
712
0
  { // And now store things in the realm of our slotStorage.
713
0
    JSAutoRealm ar(cx, slotStorage);
714
0
    // Make a copy so that we don't do unnecessary wrapping on args.rval().
715
0
    JS::Rooted<JS::Value> storedVal(cx, args.rval());
716
0
    if (!MaybeWrapNonDOMObjectValue(cx, &storedVal)) {
717
0
      return false;
718
0
    }
719
0
    js::SetReservedSlot(slotStorage, slotIndex, storedVal);
720
0
    if (!isXray) {
721
0
      // In the Xray case we don't need to do this, because getting the
722
0
      // expando object already preserved our wrapper.
723
0
      PreserveWrapper(self);
724
0
    }
725
0
  }
726
0
  // And now make sure args.rval() is in the caller realm.
727
0
  if (MaybeWrapNonDOMObjectValue(cx, args.rval())) {
728
0
    return true;
729
0
  }
730
0
  return false;
731
0
}
732
733
static const JSJitInfo serverTiming_getterinfo = {
734
  { (JSJitGetterOp)get_serverTiming },
735
  { prototypes::id::PerformanceResourceTiming },
736
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
737
  JSJitInfo::Getter,
738
  JSJitInfo::AliasDOMSets, /* aliasSet.  Not relevant for setters. */
739
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
740
  false,  /* isInfallible. False in setters. */
741
  true,  /* isMovable.  Not relevant for setters. */
742
  true, /* isEliminatable.  Not relevant for setters. */
743
  false, /* isAlwaysInSlot.  Only relevant for getters. */
744
  true, /* isLazilyCachedInSlot.  Only relevant for getters. */
745
  false,  /* isTypedMethod.  Only relevant for methods. */
746
  (DOM_INSTANCE_RESERVED_SLOTS + 0)   /* Reserved slot index, if we're stored in a slot, else 0. */
747
};
748
static_assert((DOM_INSTANCE_RESERVED_SLOTS + 0) <= JSJitInfo::maxSlotIndex, "We won't fit");
749
static_assert((DOM_INSTANCE_RESERVED_SLOTS + 0) < 2, "There is no slot for us");
750
751
MOZ_CAN_RUN_SCRIPT static bool
752
toJSON(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, const JSJitMethodCallArgs& args)
753
0
{
754
0
  AUTO_PROFILER_LABEL_FAST("PerformanceResourceTiming.toJSON", DOM, cx);
755
0
756
0
  JS::Rooted<JSObject*> result(cx, JS_NewPlainObject(cx));
757
0
  if (!result) {
758
0
    return false;
759
0
  }
760
0
  if (!PerformanceEntry_Binding::CollectJSONAttributes(cx, obj, self, result)) {
761
0
    return false;
762
0
  }
763
0
  if (!PerformanceResourceTiming_Binding::CollectJSONAttributes(cx, obj, self, result)) {
764
0
    return false;
765
0
  }
766
0
  args.rval().setObject(*result);
767
0
  return true;
768
0
}
769
770
static const JSJitInfo toJSON_methodinfo = {
771
  { (JSJitGetterOp)toJSON },
772
  { prototypes::id::PerformanceResourceTiming },
773
  { PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth },
774
  JSJitInfo::Method,
775
  JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
776
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
777
  false,  /* isInfallible. False in setters. */
778
  false,  /* isMovable.  Not relevant for setters. */
779
  false, /* isEliminatable.  Not relevant for setters. */
780
  false, /* isAlwaysInSlot.  Only relevant for getters. */
781
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
782
  false,  /* isTypedMethod.  Only relevant for methods. */
783
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
784
};
785
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
786
static_assert(0 < 2, "There is no slot for us");
787
788
static bool
789
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
790
0
{
791
0
  mozilla::dom::PerformanceResourceTiming* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::PerformanceResourceTiming>(obj);
792
0
  // We don't want to preserve if we don't have a wrapper, and we
793
0
  // obviously can't preserve if we're not initialized.
794
0
  if (self && self->GetWrapperPreserveColor()) {
795
0
    PreserveWrapper(self);
796
0
  }
797
0
  return true;
798
0
}
799
800
static void
801
_finalize(js::FreeOp* fop, JSObject* obj)
802
0
{
803
0
  mozilla::dom::PerformanceResourceTiming* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::PerformanceResourceTiming>(obj);
804
0
  if (self) {
805
0
    ClearWrapper(self, self, obj);
806
0
    AddForDeferredFinalization<mozilla::dom::PerformanceResourceTiming>(self);
807
0
  }
808
0
}
809
810
static size_t
811
_objectMoved(JSObject* obj, JSObject* old)
812
0
{
813
0
  mozilla::dom::PerformanceResourceTiming* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::PerformanceResourceTiming>(obj);
814
0
  if (self) {
815
0
    UpdateWrapper(self, self, obj, old);
816
0
  }
817
0
818
0
  return 0;
819
0
}
820
821
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
822
#if defined(__clang__)
823
#pragma clang diagnostic push
824
#pragma clang diagnostic ignored "-Wmissing-braces"
825
#endif
826
static const JSFunctionSpec sMethods_specs[] = {
827
  JS_FNSPEC("toJSON", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&toJSON_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
828
  JS_FS_END
829
};
830
#if defined(__clang__)
831
#pragma clang diagnostic pop
832
#endif
833
834
835
static const Prefable<const JSFunctionSpec> sMethods[] = {
836
  { nullptr, &sMethods_specs[0] },
837
  { nullptr, nullptr }
838
};
839
840
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
841
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
842
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
843
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
844
845
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
846
#if defined(__clang__)
847
#pragma clang diagnostic push
848
#pragma clang diagnostic ignored "-Wmissing-braces"
849
#endif
850
static const JSPropertySpec sAttributes_specs[] = {
851
  { "initiatorType", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &initiatorType_getterinfo, nullptr, nullptr },
852
  { "nextHopProtocol", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nextHopProtocol_getterinfo, nullptr, nullptr },
853
  { "workerStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &workerStart_getterinfo, nullptr, nullptr },
854
  { "redirectStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &redirectStart_getterinfo, nullptr, nullptr },
855
  { "redirectEnd", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &redirectEnd_getterinfo, nullptr, nullptr },
856
  { "fetchStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &fetchStart_getterinfo, nullptr, nullptr },
857
  { "domainLookupStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &domainLookupStart_getterinfo, nullptr, nullptr },
858
  { "domainLookupEnd", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &domainLookupEnd_getterinfo, nullptr, nullptr },
859
  { "connectStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &connectStart_getterinfo, nullptr, nullptr },
860
  { "connectEnd", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &connectEnd_getterinfo, nullptr, nullptr },
861
  { "secureConnectionStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &secureConnectionStart_getterinfo, nullptr, nullptr },
862
  { "requestStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &requestStart_getterinfo, nullptr, nullptr },
863
  { "responseStart", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &responseStart_getterinfo, nullptr, nullptr },
864
  { "responseEnd", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &responseEnd_getterinfo, nullptr, nullptr },
865
  { "transferSize", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &transferSize_getterinfo, nullptr, nullptr },
866
  { "encodedBodySize", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &encodedBodySize_getterinfo, nullptr, nullptr },
867
  { "decodedBodySize", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &decodedBodySize_getterinfo, nullptr, nullptr },
868
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr },
869
  { "serverTiming", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &serverTiming_getterinfo, nullptr, nullptr },
870
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
871
};
872
#if defined(__clang__)
873
#pragma clang diagnostic pop
874
#endif
875
876
// Can't be const because the pref-enabled boolean needs to be writable
877
static PrefableDisablers sAttributes_disablers18 = {
878
  true, true, 0, nullptr
879
};
880
881
static const Prefable<const JSPropertySpec> sAttributes[] = {
882
  { nullptr, &sAttributes_specs[0] },
883
  { &sAttributes_disablers18, &sAttributes_specs[18] },
884
  { nullptr, nullptr }
885
};
886
887
static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
888
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
889
static_assert(17 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
890
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
891
892
893
static uint16_t sNativeProperties_sortedPropertyIndices[19];
894
static PropertyInfo sNativeProperties_propertyInfos[19];
895
896
static const NativePropertiesN<2> sNativeProperties = {
897
  false, 0,
898
  false, 0,
899
  true,  0 /* sMethods */,
900
  true,  1 /* sAttributes */,
901
  false, 0,
902
  false, 0,
903
  false, 0,
904
  -1,
905
  19,
906
  sNativeProperties_sortedPropertyIndices,
907
  {
908
    { sMethods, &sNativeProperties_propertyInfos[0] },
909
    { sAttributes, &sNativeProperties_propertyInfos[1] }
910
  }
911
};
912
static_assert(19 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
913
    "We have a property info count that is oversized");
914
915
MOZ_CAN_RUN_SCRIPT bool
916
CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::PerformanceResourceTiming* self, JS::Rooted<JSObject*>& result)
917
0
{
918
0
  JS::Rooted<JSObject*> unwrappedObj(cx, js::CheckedUnwrap(obj));
919
0
  if (!unwrappedObj) {
920
0
    // How did that happen?  We managed to get called with that
921
0
    // object as "this"!  Just give up on sanity.
922
0
    return false;
923
0
  }
924
0
925
0
  { // scope for "temp"
926
0
    JS::Rooted<JS::Value> temp(cx);
927
0
    if (!get_initiatorType(cx, obj, self, JSJitGetterCallArgs(&temp))) {
928
0
      return false;
929
0
    }
930
0
    if (!JS_DefineProperty(cx, result, "initiatorType", temp, JSPROP_ENUMERATE)) {
931
0
      return false;
932
0
    }
933
0
  }
934
0
  { // scope for "temp"
935
0
    JS::Rooted<JS::Value> temp(cx);
936
0
    if (!get_nextHopProtocol(cx, obj, self, JSJitGetterCallArgs(&temp))) {
937
0
      return false;
938
0
    }
939
0
    if (!JS_DefineProperty(cx, result, "nextHopProtocol", temp, JSPROP_ENUMERATE)) {
940
0
      return false;
941
0
    }
942
0
  }
943
0
  { // scope for "temp"
944
0
    JS::Rooted<JS::Value> temp(cx);
945
0
    if (!get_workerStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
946
0
      return false;
947
0
    }
948
0
    if (!JS_DefineProperty(cx, result, "workerStart", temp, JSPROP_ENUMERATE)) {
949
0
      return false;
950
0
    }
951
0
  }
952
0
  { // scope for "temp"
953
0
    JS::Rooted<JS::Value> temp(cx);
954
0
    if (!get_redirectStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
955
0
      return false;
956
0
    }
957
0
    if (!JS_DefineProperty(cx, result, "redirectStart", temp, JSPROP_ENUMERATE)) {
958
0
      return false;
959
0
    }
960
0
  }
961
0
  { // scope for "temp"
962
0
    JS::Rooted<JS::Value> temp(cx);
963
0
    if (!get_redirectEnd(cx, obj, self, JSJitGetterCallArgs(&temp))) {
964
0
      return false;
965
0
    }
966
0
    if (!JS_DefineProperty(cx, result, "redirectEnd", temp, JSPROP_ENUMERATE)) {
967
0
      return false;
968
0
    }
969
0
  }
970
0
  { // scope for "temp"
971
0
    JS::Rooted<JS::Value> temp(cx);
972
0
    if (!get_fetchStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
973
0
      return false;
974
0
    }
975
0
    if (!JS_DefineProperty(cx, result, "fetchStart", temp, JSPROP_ENUMERATE)) {
976
0
      return false;
977
0
    }
978
0
  }
979
0
  { // scope for "temp"
980
0
    JS::Rooted<JS::Value> temp(cx);
981
0
    if (!get_domainLookupStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
982
0
      return false;
983
0
    }
984
0
    if (!JS_DefineProperty(cx, result, "domainLookupStart", temp, JSPROP_ENUMERATE)) {
985
0
      return false;
986
0
    }
987
0
  }
988
0
  { // scope for "temp"
989
0
    JS::Rooted<JS::Value> temp(cx);
990
0
    if (!get_domainLookupEnd(cx, obj, self, JSJitGetterCallArgs(&temp))) {
991
0
      return false;
992
0
    }
993
0
    if (!JS_DefineProperty(cx, result, "domainLookupEnd", temp, JSPROP_ENUMERATE)) {
994
0
      return false;
995
0
    }
996
0
  }
997
0
  { // scope for "temp"
998
0
    JS::Rooted<JS::Value> temp(cx);
999
0
    if (!get_connectStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1000
0
      return false;
1001
0
    }
1002
0
    if (!JS_DefineProperty(cx, result, "connectStart", temp, JSPROP_ENUMERATE)) {
1003
0
      return false;
1004
0
    }
1005
0
  }
1006
0
  { // scope for "temp"
1007
0
    JS::Rooted<JS::Value> temp(cx);
1008
0
    if (!get_connectEnd(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1009
0
      return false;
1010
0
    }
1011
0
    if (!JS_DefineProperty(cx, result, "connectEnd", temp, JSPROP_ENUMERATE)) {
1012
0
      return false;
1013
0
    }
1014
0
  }
1015
0
  { // scope for "temp"
1016
0
    JS::Rooted<JS::Value> temp(cx);
1017
0
    if (!get_secureConnectionStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1018
0
      return false;
1019
0
    }
1020
0
    if (!JS_DefineProperty(cx, result, "secureConnectionStart", temp, JSPROP_ENUMERATE)) {
1021
0
      return false;
1022
0
    }
1023
0
  }
1024
0
  { // scope for "temp"
1025
0
    JS::Rooted<JS::Value> temp(cx);
1026
0
    if (!get_requestStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1027
0
      return false;
1028
0
    }
1029
0
    if (!JS_DefineProperty(cx, result, "requestStart", temp, JSPROP_ENUMERATE)) {
1030
0
      return false;
1031
0
    }
1032
0
  }
1033
0
  { // scope for "temp"
1034
0
    JS::Rooted<JS::Value> temp(cx);
1035
0
    if (!get_responseStart(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1036
0
      return false;
1037
0
    }
1038
0
    if (!JS_DefineProperty(cx, result, "responseStart", temp, JSPROP_ENUMERATE)) {
1039
0
      return false;
1040
0
    }
1041
0
  }
1042
0
  { // scope for "temp"
1043
0
    JS::Rooted<JS::Value> temp(cx);
1044
0
    if (!get_responseEnd(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1045
0
      return false;
1046
0
    }
1047
0
    if (!JS_DefineProperty(cx, result, "responseEnd", temp, JSPROP_ENUMERATE)) {
1048
0
      return false;
1049
0
    }
1050
0
  }
1051
0
  { // scope for "temp"
1052
0
    JS::Rooted<JS::Value> temp(cx);
1053
0
    if (!get_transferSize(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1054
0
      return false;
1055
0
    }
1056
0
    if (!JS_DefineProperty(cx, result, "transferSize", temp, JSPROP_ENUMERATE)) {
1057
0
      return false;
1058
0
    }
1059
0
  }
1060
0
  { // scope for "temp"
1061
0
    JS::Rooted<JS::Value> temp(cx);
1062
0
    if (!get_encodedBodySize(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1063
0
      return false;
1064
0
    }
1065
0
    if (!JS_DefineProperty(cx, result, "encodedBodySize", temp, JSPROP_ENUMERATE)) {
1066
0
      return false;
1067
0
    }
1068
0
  }
1069
0
  { // scope for "temp"
1070
0
    JS::Rooted<JS::Value> temp(cx);
1071
0
    if (!get_decodedBodySize(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1072
0
      return false;
1073
0
    }
1074
0
    if (!JS_DefineProperty(cx, result, "decodedBodySize", temp, JSPROP_ENUMERATE)) {
1075
0
      return false;
1076
0
    }
1077
0
  }
1078
0
  // This is unfortunately a linear scan through sAttributes, but we
1079
0
  // only do it for things which _might_ be disabled, which should
1080
0
  // help keep the performance problems down.
1081
0
  if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_serverTiming, sAttributes)) {
1082
0
    JS::Rooted<JS::Value> temp(cx);
1083
0
    if (!get_serverTiming(cx, obj, self, JSJitGetterCallArgs(&temp))) {
1084
0
      return false;
1085
0
    }
1086
0
    if (!JS_DefineProperty(cx, result, "serverTiming", temp, JSPROP_ENUMERATE)) {
1087
0
      return false;
1088
0
    }
1089
0
  }
1090
0
  return true;
1091
0
}
1092
1093
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
1094
  {
1095
    "Function",
1096
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
1097
    &sBoringInterfaceObjectClassClassOps,
1098
    JS_NULL_CLASS_SPEC,
1099
    JS_NULL_CLASS_EXT,
1100
    &sInterfaceObjectClassObjectOps
1101
  },
1102
  eInterface,
1103
  true,
1104
  prototypes::id::PerformanceResourceTiming,
1105
  PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth,
1106
  sNativePropertyHooks,
1107
  "function PerformanceResourceTiming() {\n    [native code]\n}",
1108
  PerformanceEntry_Binding::GetConstructorObject
1109
};
1110
1111
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
1112
  {
1113
    "PerformanceResourceTimingPrototype",
1114
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
1115
    JS_NULL_CLASS_OPS,
1116
    JS_NULL_CLASS_SPEC,
1117
    JS_NULL_CLASS_EXT,
1118
    JS_NULL_OBJECT_OPS
1119
  },
1120
  eInterfacePrototype,
1121
  false,
1122
  prototypes::id::PerformanceResourceTiming,
1123
  PrototypeTraits<prototypes::id::PerformanceResourceTiming>::Depth,
1124
  sNativePropertyHooks,
1125
  "[object PerformanceResourceTimingPrototype]",
1126
  PerformanceEntry_Binding::GetProtoObject
1127
};
1128
1129
static const js::ClassOps sClassOps = {
1130
  _addProperty, /* addProperty */
1131
  nullptr,               /* delProperty */
1132
  nullptr,               /* enumerate */
1133
  nullptr, /* newEnumerate */
1134
  nullptr, /* resolve */
1135
  nullptr, /* mayResolve */
1136
  _finalize, /* finalize */
1137
  nullptr, /* call */
1138
  nullptr,               /* hasInstance */
1139
  nullptr,               /* construct */
1140
  nullptr, /* trace */
1141
};
1142
1143
static const js::ClassExtension sClassExtension = {
1144
  nullptr, /* weakmapKeyDelegateOp */
1145
  _objectMoved /* objectMovedOp */
1146
};
1147
1148
static const DOMJSClass sClass = {
1149
  { "PerformanceResourceTiming",
1150
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(2),
1151
    &sClassOps,
1152
    JS_NULL_CLASS_SPEC,
1153
    &sClassExtension,
1154
    JS_NULL_OBJECT_OPS
1155
  },
1156
  { prototypes::id::PerformanceEntry, prototypes::id::PerformanceResourceTiming, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
1157
  IsBaseOf<nsISupports, mozilla::dom::PerformanceResourceTiming >::value,
1158
  sNativePropertyHooks,
1159
  FindAssociatedGlobalForNative<mozilla::dom::PerformanceResourceTiming>::Get,
1160
  GetProtoObjectHandle,
1161
  GetCCParticipant<mozilla::dom::PerformanceResourceTiming>::Get()
1162
};
1163
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
1164
              "Must have the right minimal number of reserved slots.");
1165
static_assert(2 >= 2,
1166
              "Must have enough reserved slots.");
1167
1168
const JSClass*
1169
GetJSClass()
1170
0
{
1171
0
  return sClass.ToJSClass();
1172
0
}
1173
1174
bool
1175
Wrap(JSContext* aCx, mozilla::dom::PerformanceResourceTiming* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
1176
0
{
1177
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::PerformanceResourceTiming>::value,
1178
0
                "Shouldn't have wrappercached things that are not refcounted.");
1179
0
  MOZ_ASSERT(static_cast<mozilla::dom::PerformanceResourceTiming*>(aObject) ==
1180
0
             reinterpret_cast<mozilla::dom::PerformanceResourceTiming*>(aObject),
1181
0
             "Multiple inheritance for mozilla::dom::PerformanceResourceTiming is broken.");
1182
0
  MOZ_ASSERT(static_cast<mozilla::dom::PerformanceEntry*>(aObject) ==
1183
0
             reinterpret_cast<mozilla::dom::PerformanceEntry*>(aObject),
1184
0
             "Multiple inheritance for mozilla::dom::PerformanceEntry is broken.");
1185
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
1186
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
1187
0
  MOZ_ASSERT(!aCache->GetWrapper(),
1188
0
             "You should probably not be using Wrap() directly; use "
1189
0
             "GetOrCreateDOMReflector instead");
1190
0
1191
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
1192
0
             "nsISupports must be on our primary inheritance chain");
1193
0
1194
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
1195
0
  if (!global) {
1196
0
    return false;
1197
0
  }
1198
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
1199
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
1200
0
1201
0
  // That might have ended up wrapping us already, due to the wonders
1202
0
  // of XBL.  Check for that, and bail out as needed.
1203
0
  aReflector.set(aCache->GetWrapper());
1204
0
  if (aReflector) {
1205
#ifdef DEBUG
1206
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
1207
#endif // DEBUG
1208
    return true;
1209
0
  }
1210
0
1211
0
  JSAutoRealm ar(aCx, global);
1212
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
1213
0
  if (!canonicalProto) {
1214
0
    return false;
1215
0
  }
1216
0
  JS::Rooted<JSObject*> proto(aCx);
1217
0
  if (aGivenProto) {
1218
0
    proto = aGivenProto;
1219
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
1220
0
    // coming in, we changed compartments to that of "parent" so may need
1221
0
    // to wrap the proto here.
1222
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
1223
0
      if (!JS_WrapObject(aCx, &proto)) {
1224
0
        return false;
1225
0
      }
1226
0
    }
1227
0
  } else {
1228
0
    proto = canonicalProto;
1229
0
  }
1230
0
1231
0
  BindingJSObjectCreator<mozilla::dom::PerformanceResourceTiming> creator(aCx);
1232
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
1233
0
  if (!aReflector) {
1234
0
    return false;
1235
0
  }
1236
0
1237
0
  aCache->SetWrapper(aReflector);
1238
0
  creator.InitializationSucceeded();
1239
0
1240
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
1241
0
             aCache->GetWrapperPreserveColor() == aReflector);
1242
0
  // If proto != canonicalProto, we have to preserve our wrapper;
1243
0
  // otherwise we won't be able to properly recreate it later, since
1244
0
  // we won't know what proto to use.  Note that we don't check
1245
0
  // aGivenProto here, since it's entirely possible (and even
1246
0
  // somewhat common) to have a non-null aGivenProto which is the
1247
0
  // same as canonicalProto.
1248
0
  if (proto != canonicalProto) {
1249
0
    PreserveWrapper(aObject);
1250
0
  }
1251
0
1252
0
  return true;
1253
0
}
1254
1255
// This may allocate too many slots, because we only really need
1256
// slots for our non-interface-typed members that we cache.  But
1257
// allocating slots only for those would make the slot index
1258
// computations much more complicated, so let's do this the simple
1259
// way for now.
1260
DEFINE_XRAY_EXPANDO_CLASS(static, sXrayExpandoObjectClass, 1);
1261
1262
const NativePropertyHooks sNativePropertyHooks[] = { {
1263
  nullptr,
1264
  nullptr,
1265
  nullptr,
1266
  { sNativeProperties.Upcast(), nullptr },
1267
  prototypes::id::PerformanceResourceTiming,
1268
  constructors::id::PerformanceResourceTiming,
1269
  PerformanceEntry_Binding::sNativePropertyHooks,
1270
  &sXrayExpandoObjectClass
1271
} };
1272
1273
void
1274
ClearCachedServerTimingValue(mozilla::dom::PerformanceResourceTiming* aObject)
1275
0
{
1276
0
  JSObject* obj;
1277
0
  obj = aObject->GetWrapper();
1278
0
  if (!obj) {
1279
0
    return;
1280
0
  }
1281
0
  js::SetReservedSlot(obj, (DOM_INSTANCE_RESERVED_SLOTS + 0), JS::UndefinedValue());
1282
0
  xpc::ClearXrayExpandoSlots(obj, (xpc::JSSLOT_EXPANDO_COUNT + 0));
1283
0
}
1284
1285
void
1286
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
1287
0
{
1288
0
  JS::Handle<JSObject*> parentProto(PerformanceEntry_Binding::GetProtoObjectHandle(aCx));
1289
0
  if (!parentProto) {
1290
0
    return;
1291
0
  }
1292
0
1293
0
  JS::Handle<JSObject*> constructorProto(PerformanceEntry_Binding::GetConstructorObjectHandle(aCx));
1294
0
  if (!constructorProto) {
1295
0
    return;
1296
0
  }
1297
0
1298
0
  static bool sIdsInited = false;
1299
0
  if (!sIdsInited && NS_IsMainThread()) {
1300
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
1301
0
      return;
1302
0
    }
1303
0
    sIdsInited = true;
1304
0
  }
1305
0
1306
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::PerformanceResourceTiming);
1307
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::PerformanceResourceTiming);
1308
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
1309
0
                              &sPrototypeClass.mBase, protoCache,
1310
0
                              nullptr,
1311
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
1312
0
                              interfaceCache,
1313
0
                              sNativeProperties.Upcast(),
1314
0
                              nullptr,
1315
0
                              "PerformanceResourceTiming", aDefineOnGlobal,
1316
0
                              nullptr,
1317
0
                              false);
1318
0
}
1319
1320
JSObject*
1321
GetProtoObject(JSContext* aCx)
1322
0
{
1323
0
  return GetProtoObjectHandle(aCx);
1324
0
}
1325
1326
JSObject*
1327
GetConstructorObject(JSContext* aCx)
1328
0
{
1329
0
  return GetConstructorObjectHandle(aCx);
1330
0
}
1331
1332
} // namespace PerformanceResourceTiming_Binding
1333
1334
1335
1336
} // namespace dom
1337
} // namespace mozilla