LCOV - code coverage report
Current view: top level - obj-x86_64-pc-linux-gnu/dom/bindings - SVGClipPathElementBinding.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 109 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 12 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* THIS FILE IS AUTOGENERATED FROM SVGClipPathElement.webidl BY Codegen.py - DO NOT EDIT */
       2             : 
       3             : #include "SVGClipPathElementBinding.h"
       4             : #include "SVGElementBinding.h"
       5             : #include "WrapperFactory.h"
       6             : #include "mozilla/OwningNonNull.h"
       7             : #include "mozilla/dom/BindingUtils.h"
       8             : #include "mozilla/dom/DOMJSClass.h"
       9             : #include "mozilla/dom/NonRefcountedDOMObject.h"
      10             : #include "mozilla/dom/SVGAnimatedEnumeration.h"
      11             : #include "mozilla/dom/SVGAnimatedTransformList.h"
      12             : #include "mozilla/dom/SVGClipPathElement.h"
      13             : #include "mozilla/dom/XrayExpandoClass.h"
      14             : 
      15             : namespace mozilla {
      16             : namespace dom {
      17             : 
      18             : namespace SVGClipPathElementBinding {
      19             : 
      20             : static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGElementBinding::NativeType>::value,
      21             :               "Can't inherit from an interface with a different ownership model.");
      22             : 
      23             : static bool
      24           0 : get_clipPathUnits(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGClipPathElement* self, JSJitGetterCallArgs args)
      25             : {
      26           0 :   auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedEnumeration>(self->ClipPathUnits()));
      27           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
      28           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
      29           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
      30           0 :     return false;
      31             :   }
      32           0 :   return true;
      33             : }
      34             : 
      35             : static const JSJitInfo clipPathUnits_getterinfo = {
      36             :   { (JSJitGetterOp)get_clipPathUnits },
      37             :   { prototypes::id::SVGClipPathElement },
      38             :   { PrototypeTraits<prototypes::id::SVGClipPathElement>::Depth },
      39             :   JSJitInfo::Getter,
      40             :   JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
      41             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
      42             :   false,  /* isInfallible. False in setters. */
      43             :   true,  /* isMovable.  Not relevant for setters. */
      44             :   true, /* isEliminatable.  Not relevant for setters. */
      45             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
      46             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
      47             :   false,  /* isTypedMethod.  Only relevant for methods. */
      48             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
      49             : };
      50             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
      51             : static_assert(0 < 1, "There is no slot for us");
      52             : 
      53             : static bool
      54           0 : get_transform(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGClipPathElement* self, JSJitGetterCallArgs args)
      55             : {
      56           0 :   auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedTransformList>(self->Transform()));
      57           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
      58           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
      59           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
      60           0 :     return false;
      61             :   }
      62           0 :   return true;
      63             : }
      64             : 
      65             : static const JSJitInfo transform_getterinfo = {
      66             :   { (JSJitGetterOp)get_transform },
      67             :   { prototypes::id::SVGClipPathElement },
      68             :   { PrototypeTraits<prototypes::id::SVGClipPathElement>::Depth },
      69             :   JSJitInfo::Getter,
      70             :   JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
      71             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
      72             :   false,  /* isInfallible. False in setters. */
      73             :   true,  /* isMovable.  Not relevant for setters. */
      74             :   true, /* isEliminatable.  Not relevant for setters. */
      75             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
      76             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
      77             :   false,  /* isTypedMethod.  Only relevant for methods. */
      78             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
      79             : };
      80             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
      81             : static_assert(0 < 1, "There is no slot for us");
      82             : 
      83             : static bool
      84           0 : _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
      85             : {
      86           0 :   mozilla::dom::SVGClipPathElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGClipPathElement>(obj);
      87             :   // We don't want to preserve if we don't have a wrapper, and we
      88             :   // obviously can't preserve if we're not initialized.
      89           0 :   if (self && self->GetWrapperPreserveColor()) {
      90           0 :     PreserveWrapper(self);
      91             :   }
      92           0 :   return true;
      93             : }
      94             : 
      95             : static void
      96           0 : _finalize(js::FreeOp* fop, JSObject* obj)
      97             : {
      98           0 :   mozilla::dom::SVGClipPathElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGClipPathElement>(obj);
      99           0 :   if (self) {
     100           0 :     ClearWrapper(self, self, obj);
     101           0 :     AddForDeferredFinalization<mozilla::dom::SVGClipPathElement>(self);
     102             :   }
     103           0 : }
     104             : 
     105             : static void
     106           0 : _objectMoved(JSObject* obj, const JSObject* old)
     107             : {
     108           0 :   mozilla::dom::SVGClipPathElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGClipPathElement>(obj);
     109           0 :   if (self) {
     110           0 :     UpdateWrapper(self, self, obj, old);
     111             :   }
     112           0 : }
     113             : 
     114             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
     115             : #if defined(__clang__)
     116             : #pragma clang diagnostic push
     117             : #pragma clang diagnostic ignored "-Wmissing-braces"
     118             : #endif
     119             : static const JSPropertySpec sAttributes_specs[] = {
     120             :   { "clipPathUnits", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &clipPathUnits_getterinfo, nullptr, nullptr },
     121             :   { "transform", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &transform_getterinfo, nullptr, nullptr },
     122             :   { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
     123             : };
     124             : #if defined(__clang__)
     125             : #pragma clang diagnostic pop
     126             : #endif
     127             : 
     128             : 
     129             : // Can't be const because the pref-enabled boolean needs to be writable
     130             : static Prefable<const JSPropertySpec> sAttributes[] = {
     131             :   { nullptr, &sAttributes_specs[0] },
     132             :   { nullptr, nullptr }
     133             : };
     134             : 
     135             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
     136             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
     137             : static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
     138             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
     139             : 
     140             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
     141             : #if defined(__clang__)
     142             : #pragma clang diagnostic push
     143             : #pragma clang diagnostic ignored "-Wmissing-braces"
     144             : #endif
     145             : static const ConstantSpec sConstants_specs[] = {
     146             :   { "SVG_UNIT_TYPE_UNKNOWN", JS::Int32Value(0) },
     147             :   { "SVG_UNIT_TYPE_USERSPACEONUSE", JS::Int32Value(1) },
     148             :   { "SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", JS::Int32Value(2) },
     149             :   { 0, JS::UndefinedValue() }
     150             : };
     151             : #if defined(__clang__)
     152             : #pragma clang diagnostic pop
     153             : #endif
     154             : 
     155             : 
     156             : // Can't be const because the pref-enabled boolean needs to be writable
     157             : static Prefable<const ConstantSpec> sConstants[] = {
     158             :   { nullptr, &sConstants_specs[0] },
     159             :   { nullptr, nullptr }
     160             : };
     161             : 
     162             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
     163             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
     164             : static_assert(3 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
     165             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
     166             : 
     167             : 
     168             : static uint16_t sNativeProperties_sortedPropertyIndices[5];
     169             : static PropertyInfo sNativeProperties_propertyInfos[5];
     170             : 
     171             : static const NativePropertiesN<2> sNativeProperties = {
     172             :   false, 0,
     173             :   false, 0,
     174             :   false, 0,
     175             :   true,  0 /* sAttributes */,
     176             :   false, 0,
     177             :   false, 0,
     178             :   true,  1 /* sConstants */,
     179             :   -1,
     180             :   5,
     181             :   sNativeProperties_sortedPropertyIndices,
     182             :   {
     183             :     { sAttributes, &sNativeProperties_propertyInfos[0] },
     184             :     { sConstants, &sNativeProperties_propertyInfos[2] }
     185             :   }
     186             : };
     187             : static_assert(5 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
     188             :     "We have a property info count that is oversized");
     189             : 
     190             : static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
     191             :   {
     192             :     "Function",
     193             :     JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
     194             :     &sBoringInterfaceObjectClassClassOps,
     195             :     JS_NULL_CLASS_SPEC,
     196             :     JS_NULL_CLASS_EXT,
     197             :     &sInterfaceObjectClassObjectOps
     198             :   },
     199             :   eInterface,
     200             :   true,
     201             :   prototypes::id::SVGClipPathElement,
     202             :   PrototypeTraits<prototypes::id::SVGClipPathElement>::Depth,
     203             :   sNativePropertyHooks,
     204             :   "function SVGClipPathElement() {\n    [native code]\n}",
     205             :   SVGElementBinding::GetConstructorObject
     206             : };
     207             : 
     208             : static const DOMIfaceAndProtoJSClass sPrototypeClass = {
     209             :   {
     210             :     "SVGClipPathElementPrototype",
     211             :     JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
     212             :     JS_NULL_CLASS_OPS,
     213             :     JS_NULL_CLASS_SPEC,
     214             :     JS_NULL_CLASS_EXT,
     215             :     JS_NULL_OBJECT_OPS
     216             :   },
     217             :   eInterfacePrototype,
     218             :   false,
     219             :   prototypes::id::SVGClipPathElement,
     220             :   PrototypeTraits<prototypes::id::SVGClipPathElement>::Depth,
     221             :   sNativePropertyHooks,
     222             :   "[object SVGClipPathElementPrototype]",
     223             :   SVGElementBinding::GetProtoObject
     224             : };
     225             : 
     226             : JSObject*
     227           0 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal)
     228             : {
     229           0 :   return GetConstructorObjectHandle(aCx, aDefineOnGlobal);
     230             : }
     231             : 
     232             : static const js::ClassOps sClassOps = {
     233             :   _addProperty, /* addProperty */
     234             :   nullptr,               /* delProperty */
     235             :   nullptr,               /* getProperty */
     236             :   nullptr,               /* setProperty */
     237             :   nullptr,               /* enumerate */
     238             :   nullptr, /* newEnumerate */
     239             :   nullptr, /* resolve */
     240             :   nullptr, /* mayResolve */
     241             :   _finalize, /* finalize */
     242             :   nullptr, /* call */
     243             :   nullptr,               /* hasInstance */
     244             :   nullptr,               /* construct */
     245             :   nullptr, /* trace */
     246             : };
     247             : 
     248             : static const js::ClassExtension sClassExtension = {
     249             :   nullptr, /* weakmapKeyDelegateOp */
     250             :   _objectMoved /* objectMovedOp */
     251             : };
     252             : 
     253             : static const DOMJSClass sClass = {
     254             :   { "SVGClipPathElement",
     255             :     JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
     256             :     &sClassOps,
     257             :     JS_NULL_CLASS_SPEC,
     258             :     &sClassExtension,
     259             :     JS_NULL_OBJECT_OPS
     260             :   },
     261             :   { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGClipPathElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
     262             :   IsBaseOf<nsISupports, mozilla::dom::SVGClipPathElement >::value,
     263             :   sNativePropertyHooks,
     264             :   FindAssociatedGlobalForNative<mozilla::dom::SVGClipPathElement>::Get,
     265             :   GetProtoObjectHandle,
     266             :   GetCCParticipant<mozilla::dom::SVGClipPathElement>::Get()
     267             : };
     268             : static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
     269             :               "Must have the right minimal number of reserved slots.");
     270             : static_assert(1 >= 1,
     271             :               "Must have enough reserved slots.");
     272             : 
     273             : const JSClass*
     274           0 : GetJSClass()
     275             : {
     276           0 :   return sClass.ToJSClass();
     277             : }
     278             : 
     279             : bool
     280           0 : Wrap(JSContext* aCx, mozilla::dom::SVGClipPathElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
     281             : {
     282             :   MOZ_ASSERT(static_cast<mozilla::dom::SVGClipPathElement*>(aObject) ==
     283             :              reinterpret_cast<mozilla::dom::SVGClipPathElement*>(aObject),
     284             :              "Multiple inheritance for mozilla::dom::SVGClipPathElement is broken.");
     285             :   MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) ==
     286             :              reinterpret_cast<nsSVGElement*>(aObject),
     287             :              "Multiple inheritance for nsSVGElement is broken.");
     288             :   MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
     289             :              reinterpret_cast<mozilla::dom::Element*>(aObject),
     290             :              "Multiple inheritance for mozilla::dom::Element is broken.");
     291             :   MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
     292             :              reinterpret_cast<nsINode*>(aObject),
     293             :              "Multiple inheritance for nsINode is broken.");
     294             :   MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
     295             :              reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
     296             :              "Multiple inheritance for mozilla::dom::EventTarget is broken.");
     297           0 :   MOZ_ASSERT(ToSupportsIsCorrect(aObject));
     298           0 :   MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
     299           0 :   MOZ_ASSERT(!aCache->GetWrapper(),
     300             :              "You should probably not be using Wrap() directly; use "
     301             :              "GetOrCreateDOMReflector instead");
     302             : 
     303           0 :   MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
     304             :              "nsISupports must be on our primary inheritance chain");
     305             : 
     306           0 :   JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
     307           0 :   if (!global) {
     308           0 :     return false;
     309             :   }
     310           0 :   MOZ_ASSERT(JS_IsGlobalObject(global));
     311           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(global));
     312             : 
     313             :   // That might have ended up wrapping us already, due to the wonders
     314             :   // of XBL.  Check for that, and bail out as needed.
     315           0 :   aReflector.set(aCache->GetWrapper());
     316           0 :   if (aReflector) {
     317             : #ifdef DEBUG
     318           0 :     binding_detail::AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
     319             : #endif // DEBUG
     320           0 :     return true;
     321             :   }
     322             : 
     323           0 :   JSAutoCompartment ac(aCx, global);
     324           0 :   JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
     325           0 :   if (!canonicalProto) {
     326           0 :     return false;
     327             :   }
     328           0 :   JS::Rooted<JSObject*> proto(aCx);
     329           0 :   if (aGivenProto) {
     330           0 :     proto = aGivenProto;
     331             :     // Unfortunately, while aGivenProto was in the compartment of aCx
     332             :     // coming in, we changed compartments to that of "parent" so may need
     333             :     // to wrap the proto here.
     334           0 :     if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
     335           0 :       if (!JS_WrapObject(aCx, &proto)) {
     336           0 :         return false;
     337             :       }
     338             :     }
     339             :   } else {
     340           0 :     proto = canonicalProto;
     341             :   }
     342             : 
     343           0 :   BindingJSObjectCreator<mozilla::dom::SVGClipPathElement> creator(aCx);
     344           0 :   creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
     345           0 :   if (!aReflector) {
     346           0 :     return false;
     347             :   }
     348             : 
     349           0 :   aCache->SetWrapper(aReflector);
     350           0 :   creator.InitializationSucceeded();
     351             : 
     352           0 :   MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
     353             :              aCache->GetWrapperPreserveColor() == aReflector);
     354             :   // If proto != canonicalProto, we have to preserve our wrapper;
     355             :   // otherwise we won't be able to properly recreate it later, since
     356             :   // we won't know what proto to use.  Note that we don't check
     357             :   // aGivenProto here, since it's entirely possible (and even
     358             :   // somewhat common) to have a non-null aGivenProto which is the
     359             :   // same as canonicalProto.
     360           0 :   if (proto != canonicalProto) {
     361           0 :     PreserveWrapper(aObject);
     362             :   }
     363             : 
     364           0 :   return true;
     365             : }
     366             : 
     367             : const NativePropertyHooks sNativePropertyHooks[] = { {
     368             :   nullptr,
     369             :   nullptr,
     370             :   nullptr,
     371             :   { sNativeProperties.Upcast(), nullptr },
     372             :   prototypes::id::SVGClipPathElement,
     373             :   constructors::id::SVGClipPathElement,
     374             :   SVGElementBinding::sNativePropertyHooks,
     375             :   &DefaultXrayExpandoObjectClass
     376             : } };
     377             : 
     378             : void
     379           0 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
     380             : {
     381           0 :   JS::Handle<JSObject*> parentProto(SVGElementBinding::GetProtoObjectHandle(aCx));
     382           0 :   if (!parentProto) {
     383           0 :     return;
     384             :   }
     385             : 
     386           0 :   JS::Handle<JSObject*> constructorProto(SVGElementBinding::GetConstructorObjectHandle(aCx));
     387           0 :   if (!constructorProto) {
     388           0 :     return;
     389             :   }
     390             : 
     391             :   static bool sIdsInited = false;
     392           0 :   if (!sIdsInited && NS_IsMainThread()) {
     393           0 :     if (!InitIds(aCx, sNativeProperties.Upcast())) {
     394           0 :       return;
     395             :     }
     396           0 :     sIdsInited = true;
     397             :   }
     398             : 
     399           0 :   JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGClipPathElement);
     400           0 :   JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGClipPathElement);
     401           0 :   dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
     402             :                               &sPrototypeClass.mBase, protoCache,
     403             :                               constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
     404             :                               interfaceCache,
     405             :                               sNativeProperties.Upcast(),
     406             :                               nullptr,
     407             :                               "SVGClipPathElement", aDefineOnGlobal,
     408             :                               nullptr,
     409           0 :                               false);
     410             : }
     411             : 
     412             : JS::Handle<JSObject*>
     413           0 : GetProtoObjectHandle(JSContext* aCx)
     414             : {
     415             :   /* Get the interface prototype object for this class.  This will create the
     416             :      object as needed. */
     417           0 :   bool aDefineOnGlobal = true;
     418             : 
     419             :   /* Make sure our global is sane.  Hopefully we can remove this sometime */
     420           0 :   JSObject* global = JS::CurrentGlobalOrNull(aCx);
     421           0 :   if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
     422           0 :     return nullptr;
     423             :   }
     424             : 
     425             :   /* Check to see whether the interface objects are already installed */
     426           0 :   ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
     427           0 :   if (!protoAndIfaceCache.HasEntryInSlot(prototypes::id::SVGClipPathElement)) {
     428           0 :     JS::Rooted<JSObject*> rootedGlobal(aCx, global);
     429           0 :     CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
     430             :   }
     431             : 
     432             :   /*
     433             :    * The object might _still_ be null, but that's OK.
     434             :    *
     435             :    * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
     436             :    * traced by TraceProtoAndIfaceCache() and its contents are never
     437             :    * changed after they have been set.
     438             :    *
     439             :    * Calling address() avoids the read read barrier that does gray
     440             :    * unmarking, but it's not possible for the object to be gray here.
     441             :    */
     442             : 
     443           0 :   const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(prototypes::id::SVGClipPathElement);
     444           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
     445           0 :   return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
     446             : }
     447             : 
     448             : JS::Handle<JSObject*>
     449           0 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal)
     450             : {
     451             :   /* Get the interface object for this class.  This will create the object as
     452             :      needed. */
     453             : 
     454             :   /* Make sure our global is sane.  Hopefully we can remove this sometime */
     455           0 :   JSObject* global = JS::CurrentGlobalOrNull(aCx);
     456           0 :   if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
     457           0 :     return nullptr;
     458             :   }
     459             : 
     460             :   /* Check to see whether the interface objects are already installed */
     461           0 :   ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
     462           0 :   if (!protoAndIfaceCache.HasEntryInSlot(constructors::id::SVGClipPathElement)) {
     463           0 :     JS::Rooted<JSObject*> rootedGlobal(aCx, global);
     464           0 :     CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
     465             :   }
     466             : 
     467             :   /*
     468             :    * The object might _still_ be null, but that's OK.
     469             :    *
     470             :    * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
     471             :    * traced by TraceProtoAndIfaceCache() and its contents are never
     472             :    * changed after they have been set.
     473             :    *
     474             :    * Calling address() avoids the read read barrier that does gray
     475             :    * unmarking, but it's not possible for the object to be gray here.
     476             :    */
     477             : 
     478           0 :   const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(constructors::id::SVGClipPathElement);
     479           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
     480           0 :   return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
     481             : }
     482             : 
     483             : JSObject*
     484           0 : GetConstructorObject(JSContext* aCx)
     485             : {
     486           0 :   return GetConstructorObjectHandle(aCx);
     487             : }
     488             : 
     489             : } // namespace SVGClipPathElementBinding
     490             : 
     491             : 
     492             : 
     493             : } // namespace dom
     494             : } // namespace mozilla

Generated by: LCOV version 1.13