Bug 1853814 [wpt PR 42017] - LoAF: Expose script URL for promise resolvers, a=testonly
[gecko.git] / dom / bindings / XrayExpandoClass.h
bloba18a7125ca6dcdb336665150d95e5b5904cd9314
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 * This file declares a macro for defining Xray expando classes and declares the
9 * default Xray expando class. The actual definition of that default class
10 * lives elsewhere.
12 #ifndef mozilla_dom_XrayExpandoClass_h
13 #define mozilla_dom_XrayExpandoClass_h
16 * maybeStatic_ Should be either `static` or nothing (because some Xray expando
17 * classes are not static).
19 * name_ should be the name of the variable.
21 * extraSlots_ should be how many extra slots to give the class, in addition to
22 * the ones Xray expandos want.
24 #define DEFINE_XRAY_EXPANDO_CLASS(maybeStatic_, name_, extraSlots_) \
25 maybeStatic_ const JSClass name_ = { \
26 "XrayExpandoObject", \
27 JSCLASS_HAS_RESERVED_SLOTS(xpc::JSSLOT_EXPANDO_COUNT + (extraSlots_)) | \
28 JSCLASS_FOREGROUND_FINALIZE, \
29 &xpc::XrayExpandoObjectClassOps}
31 namespace mozilla::dom {
33 extern const JSClass DefaultXrayExpandoObjectClass;
35 } // namespace mozilla::dom
37 #endif /* mozilla_dom_XrayExpandoClass_h */