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

          Line data    Source code
       1             : /* THIS FILE IS AUTOGENERATED FROM XSLTProcessor.webidl BY Codegen.py - DO NOT EDIT */
       2             : 
       3             : #include "WrapperFactory.h"
       4             : #include "XSLTProcessorBinding.h"
       5             : #include "mozilla/OwningNonNull.h"
       6             : #include "mozilla/dom/BindingUtils.h"
       7             : #include "mozilla/dom/CustomElementRegistry.h"
       8             : #include "mozilla/dom/DOMJSClass.h"
       9             : #include "mozilla/dom/DocumentFragment.h"
      10             : #include "mozilla/dom/NonRefcountedDOMObject.h"
      11             : #include "mozilla/dom/Nullable.h"
      12             : #include "mozilla/dom/PrimitiveConversions.h"
      13             : #include "mozilla/dom/XrayExpandoClass.h"
      14             : #include "nsContentUtils.h"
      15             : #include "nsIDocument.h"
      16             : #include "nsINode.h"
      17             : #include "nsIVariant.h"
      18             : #include "txMozillaXSLTProcessor.h"
      19             : 
      20             : namespace mozilla {
      21             : namespace dom {
      22             : 
      23             : namespace XSLTProcessorBinding {
      24             : 
      25             : static bool
      26           0 : importStylesheet(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
      27             : {
      28           0 :   if (MOZ_UNLIKELY(args.length() < 1)) {
      29           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "XSLTProcessor.importStylesheet");
      30             :   }
      31           0 :   NonNull<nsINode> arg0;
      32           0 :   if (args[0].isObject()) {
      33             :     {
      34           0 :       nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
      35           0 :       if (NS_FAILED(rv)) {
      36           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of XSLTProcessor.importStylesheet", "Node");
      37           0 :         return false;
      38             :       }
      39             :     }
      40             :   } else {
      41           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of XSLTProcessor.importStylesheet");
      42           0 :     return false;
      43             :   }
      44           0 :   binding_detail::FastErrorResult rv;
      45           0 :   self->ImportStylesheet(NonNullHelper(arg0), rv);
      46           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
      47           0 :     return false;
      48             :   }
      49           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
      50           0 :   args.rval().setUndefined();
      51           0 :   return true;
      52             : }
      53             : 
      54             : static const JSJitInfo importStylesheet_methodinfo = {
      55             :   { (JSJitGetterOp)importStylesheet },
      56             :   { prototypes::id::XSLTProcessor },
      57             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
      58             :   JSJitInfo::Method,
      59             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
      60             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
      61             :   false,  /* isInfallible. False in setters. */
      62             :   false,  /* isMovable.  Not relevant for setters. */
      63             :   false, /* isEliminatable.  Not relevant for setters. */
      64             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
      65             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
      66             :   false,  /* isTypedMethod.  Only relevant for methods. */
      67             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
      68             : };
      69             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
      70             : static_assert(0 < 1, "There is no slot for us");
      71             : 
      72             : static bool
      73           0 : transformToFragment(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
      74             : {
      75           0 :   if (MOZ_UNLIKELY(args.length() < 2)) {
      76           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "XSLTProcessor.transformToFragment");
      77             :   }
      78           0 :   NonNull<nsINode> arg0;
      79           0 :   if (args[0].isObject()) {
      80             :     {
      81           0 :       nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
      82           0 :       if (NS_FAILED(rv)) {
      83           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of XSLTProcessor.transformToFragment", "Node");
      84           0 :         return false;
      85             :       }
      86             :     }
      87             :   } else {
      88           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of XSLTProcessor.transformToFragment");
      89           0 :     return false;
      90             :   }
      91           0 :   NonNull<nsIDocument> arg1;
      92           0 :   if (args[1].isObject()) {
      93             :     {
      94           0 :       nsresult rv = UnwrapObject<prototypes::id::Document, nsIDocument>(args[1], arg1);
      95           0 :       if (NS_FAILED(rv)) {
      96           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 2 of XSLTProcessor.transformToFragment", "Document");
      97           0 :         return false;
      98             :       }
      99             :     }
     100             :   } else {
     101           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 2 of XSLTProcessor.transformToFragment");
     102           0 :     return false;
     103             :   }
     104           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     105           0 :   Maybe<AutoCEReaction> ceReaction;
     106           0 :   if (reactionsStack) {
     107           0 :     ceReaction.emplace(reactionsStack);
     108             :   }
     109           0 :   binding_detail::FastErrorResult rv;
     110           0 :   auto result(StrongOrRawPtr<mozilla::dom::DocumentFragment>(self->TransformToFragment(NonNullHelper(arg0), NonNullHelper(arg1), rv)));
     111           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     112           0 :     return false;
     113             :   }
     114           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     115           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     116           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     117           0 :     return false;
     118             :   }
     119           0 :   return true;
     120             : }
     121             : 
     122             : static const JSJitInfo transformToFragment_methodinfo = {
     123             :   { (JSJitGetterOp)transformToFragment },
     124             :   { prototypes::id::XSLTProcessor },
     125             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     126             :   JSJitInfo::Method,
     127             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     128             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     129             :   false,  /* isInfallible. False in setters. */
     130             :   false,  /* isMovable.  Not relevant for setters. */
     131             :   false, /* isEliminatable.  Not relevant for setters. */
     132             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     133             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     134             :   false,  /* isTypedMethod.  Only relevant for methods. */
     135             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     136             : };
     137             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     138             : static_assert(0 < 1, "There is no slot for us");
     139             : 
     140             : static bool
     141           0 : transformToDocument(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
     142             : {
     143           0 :   if (MOZ_UNLIKELY(args.length() < 1)) {
     144           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "XSLTProcessor.transformToDocument");
     145             :   }
     146           0 :   NonNull<nsINode> arg0;
     147           0 :   if (args[0].isObject()) {
     148             :     {
     149           0 :       nsresult rv = UnwrapObject<prototypes::id::Node, nsINode>(args[0], arg0);
     150           0 :       if (NS_FAILED(rv)) {
     151           0 :         ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of XSLTProcessor.transformToDocument", "Node");
     152           0 :         return false;
     153             :       }
     154             :     }
     155             :   } else {
     156           0 :     ThrowErrorMessage(cx, MSG_NOT_OBJECT, "Argument 1 of XSLTProcessor.transformToDocument");
     157           0 :     return false;
     158             :   }
     159           0 :   CustomElementReactionsStack* reactionsStack = GetCustomElementReactionsStack(obj);
     160           0 :   Maybe<AutoCEReaction> ceReaction;
     161           0 :   if (reactionsStack) {
     162           0 :     ceReaction.emplace(reactionsStack);
     163             :   }
     164           0 :   binding_detail::FastErrorResult rv;
     165           0 :   auto result(StrongOrRawPtr<nsIDocument>(self->TransformToDocument(NonNullHelper(arg0), rv)));
     166           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     167           0 :     return false;
     168             :   }
     169           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     170           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
     171           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     172           0 :     return false;
     173             :   }
     174           0 :   return true;
     175             : }
     176             : 
     177             : static const JSJitInfo transformToDocument_methodinfo = {
     178             :   { (JSJitGetterOp)transformToDocument },
     179             :   { prototypes::id::XSLTProcessor },
     180             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     181             :   JSJitInfo::Method,
     182             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     183             :   JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
     184             :   false,  /* isInfallible. False in setters. */
     185             :   false,  /* isMovable.  Not relevant for setters. */
     186             :   false, /* isEliminatable.  Not relevant for setters. */
     187             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     188             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     189             :   false,  /* isTypedMethod.  Only relevant for methods. */
     190             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     191             : };
     192             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     193             : static_assert(0 < 1, "There is no slot for us");
     194             : 
     195             : static bool
     196           0 : setParameter(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
     197             : {
     198           0 :   if (MOZ_UNLIKELY(args.length() < 3)) {
     199           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "XSLTProcessor.setParameter");
     200             :   }
     201           0 :   binding_detail::FakeString arg0;
     202           0 :   if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
     203           0 :     return false;
     204             :   }
     205           0 :   binding_detail::FakeString arg1;
     206           0 :   if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
     207           0 :     return false;
     208             :   }
     209           0 :   JS::Rooted<JS::Value> arg2(cx);
     210           0 :   arg2 = args[2];
     211           0 :   binding_detail::FastErrorResult rv;
     212           0 :   self->SetParameter(cx, NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), arg2, rv);
     213           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     214           0 :     return false;
     215             :   }
     216           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     217           0 :   args.rval().setUndefined();
     218           0 :   return true;
     219             : }
     220             : 
     221             : static const JSJitInfo setParameter_methodinfo = {
     222             :   { (JSJitGetterOp)setParameter },
     223             :   { prototypes::id::XSLTProcessor },
     224             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     225             :   JSJitInfo::Method,
     226             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     227             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     228             :   false,  /* isInfallible. False in setters. */
     229             :   false,  /* isMovable.  Not relevant for setters. */
     230             :   false, /* isEliminatable.  Not relevant for setters. */
     231             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     232             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     233             :   false,  /* isTypedMethod.  Only relevant for methods. */
     234             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     235             : };
     236             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     237             : static_assert(0 < 1, "There is no slot for us");
     238             : 
     239             : static bool
     240           0 : getParameter(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
     241             : {
     242           0 :   if (MOZ_UNLIKELY(args.length() < 2)) {
     243           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "XSLTProcessor.getParameter");
     244             :   }
     245           0 :   binding_detail::FakeString arg0;
     246           0 :   if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
     247           0 :     return false;
     248             :   }
     249           0 :   binding_detail::FakeString arg1;
     250           0 :   if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
     251           0 :     return false;
     252             :   }
     253           0 :   binding_detail::FastErrorResult rv;
     254           0 :   auto result(StrongOrRawPtr<nsIVariant>(self->GetParameter(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv)));
     255           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     256           0 :     return false;
     257             :   }
     258           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     259           0 :   if (!result) {
     260           0 :     args.rval().setNull();
     261           0 :     return true;
     262             :   }
     263           0 :   if (!WrapObject(cx, result, &NS_GET_IID(nsIVariant), args.rval())) {
     264           0 :     return false;
     265             :   }
     266           0 :   return true;
     267             : }
     268             : 
     269             : static const JSJitInfo getParameter_methodinfo = {
     270             :   { (JSJitGetterOp)getParameter },
     271             :   { prototypes::id::XSLTProcessor },
     272             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     273             :   JSJitInfo::Method,
     274             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     275             :   JSVAL_TYPE_UNKNOWN,  /* returnType.  Not relevant for setters. */
     276             :   false,  /* isInfallible. False in setters. */
     277             :   false,  /* isMovable.  Not relevant for setters. */
     278             :   false, /* isEliminatable.  Not relevant for setters. */
     279             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     280             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     281             :   false,  /* isTypedMethod.  Only relevant for methods. */
     282             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     283             : };
     284             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     285             : static_assert(0 < 1, "There is no slot for us");
     286             : 
     287             : static bool
     288           0 : removeParameter(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
     289             : {
     290           0 :   if (MOZ_UNLIKELY(args.length() < 2)) {
     291           0 :     return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "XSLTProcessor.removeParameter");
     292             :   }
     293           0 :   binding_detail::FakeString arg0;
     294           0 :   if (!ConvertJSValueToString(cx, args[0], eEmpty, eStringify, arg0)) {
     295           0 :     return false;
     296             :   }
     297           0 :   binding_detail::FakeString arg1;
     298           0 :   if (!ConvertJSValueToString(cx, args[1], eStringify, eStringify, arg1)) {
     299           0 :     return false;
     300             :   }
     301           0 :   binding_detail::FastErrorResult rv;
     302           0 :   self->RemoveParameter(NonNullHelper(Constify(arg0)), NonNullHelper(Constify(arg1)), rv);
     303           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     304           0 :     return false;
     305             :   }
     306           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     307           0 :   args.rval().setUndefined();
     308           0 :   return true;
     309             : }
     310             : 
     311             : static const JSJitInfo removeParameter_methodinfo = {
     312             :   { (JSJitGetterOp)removeParameter },
     313             :   { prototypes::id::XSLTProcessor },
     314             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     315             :   JSJitInfo::Method,
     316             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     317             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     318             :   false,  /* isInfallible. False in setters. */
     319             :   false,  /* isMovable.  Not relevant for setters. */
     320             :   false, /* isEliminatable.  Not relevant for setters. */
     321             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     322             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     323             :   false,  /* isTypedMethod.  Only relevant for methods. */
     324             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     325             : };
     326             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     327             : static_assert(0 < 1, "There is no slot for us");
     328             : 
     329             : static bool
     330           0 : clearParameters(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
     331             : {
     332           0 :   self->ClearParameters();
     333           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     334           0 :   args.rval().setUndefined();
     335           0 :   return true;
     336             : }
     337             : 
     338             : static const JSJitInfo clearParameters_methodinfo = {
     339             :   { (JSJitGetterOp)clearParameters },
     340             :   { prototypes::id::XSLTProcessor },
     341             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     342             :   JSJitInfo::Method,
     343             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     344             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     345             :   true,  /* isInfallible. False in setters. */
     346             :   false,  /* isMovable.  Not relevant for setters. */
     347             :   false, /* isEliminatable.  Not relevant for setters. */
     348             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     349             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     350             :   false,  /* isTypedMethod.  Only relevant for methods. */
     351             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     352             : };
     353             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     354             : static_assert(0 < 1, "There is no slot for us");
     355             : 
     356             : static bool
     357           0 : reset(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, const JSJitMethodCallArgs& args)
     358             : {
     359           0 :   self->Reset();
     360           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     361           0 :   args.rval().setUndefined();
     362           0 :   return true;
     363             : }
     364             : 
     365             : static const JSJitInfo reset_methodinfo = {
     366             :   { (JSJitGetterOp)reset },
     367             :   { prototypes::id::XSLTProcessor },
     368             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     369             :   JSJitInfo::Method,
     370             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     371             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     372             :   true,  /* isInfallible. False in setters. */
     373             :   false,  /* isMovable.  Not relevant for setters. */
     374             :   false, /* isEliminatable.  Not relevant for setters. */
     375             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     376             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     377             :   false,  /* isTypedMethod.  Only relevant for methods. */
     378             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     379             : };
     380             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     381             : static_assert(0 < 1, "There is no slot for us");
     382             : 
     383             : static bool
     384           0 : get_flags(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, JSJitGetterCallArgs args)
     385             : {
     386           0 :   uint32_t result(self->Flags(SystemCallerGuarantee()));
     387           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     388           0 :   args.rval().setNumber(result);
     389           0 :   return true;
     390             : }
     391             : 
     392             : static bool
     393           0 : set_flags(JSContext* cx, JS::Handle<JSObject*> obj, txMozillaXSLTProcessor* self, JSJitSetterCallArgs args)
     394             : {
     395             :   uint32_t arg0;
     396           0 :   if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], &arg0)) {
     397           0 :     return false;
     398             :   }
     399           0 :   self->SetFlags(arg0, SystemCallerGuarantee());
     400           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     401             : 
     402           0 :   return true;
     403             : }
     404             : 
     405             : static const JSJitInfo flags_getterinfo = {
     406             :   { (JSJitGetterOp)get_flags },
     407             :   { prototypes::id::XSLTProcessor },
     408             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     409             :   JSJitInfo::Getter,
     410             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     411             :   JSVAL_TYPE_DOUBLE,  /* returnType.  Not relevant for setters. */
     412             :   true,  /* isInfallible. False in setters. */
     413             :   false,  /* isMovable.  Not relevant for setters. */
     414             :   false, /* isEliminatable.  Not relevant for setters. */
     415             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     416             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     417             :   false,  /* isTypedMethod.  Only relevant for methods. */
     418             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     419             : };
     420             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     421             : static_assert(0 < 1, "There is no slot for us");
     422             : static const JSJitInfo flags_setterinfo = {
     423             :   { (JSJitGetterOp)set_flags },
     424             :   { prototypes::id::XSLTProcessor },
     425             :   { PrototypeTraits<prototypes::id::XSLTProcessor>::Depth },
     426             :   JSJitInfo::Setter,
     427             :   JSJitInfo::AliasEverything, /* aliasSet.  Not relevant for setters. */
     428             :   JSVAL_TYPE_UNDEFINED,  /* returnType.  Not relevant for setters. */
     429             :   false,  /* isInfallible. False in setters. */
     430             :   false,  /* isMovable.  Not relevant for setters. */
     431             :   false, /* isEliminatable.  Not relevant for setters. */
     432             :   false, /* isAlwaysInSlot.  Only relevant for getters. */
     433             :   false, /* isLazilyCachedInSlot.  Only relevant for getters. */
     434             :   false,  /* isTypedMethod.  Only relevant for methods. */
     435             :   0   /* Reserved slot index, if we're stored in a slot, else 0. */
     436             : };
     437             : static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
     438             : static_assert(0 < 1, "There is no slot for us");
     439             : 
     440             : static bool
     441           0 : _addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
     442             : {
     443           0 :   txMozillaXSLTProcessor* self = UnwrapPossiblyNotInitializedDOMObject<txMozillaXSLTProcessor>(obj);
     444             :   // We don't want to preserve if we don't have a wrapper, and we
     445             :   // obviously can't preserve if we're not initialized.
     446           0 :   if (self && self->GetWrapperPreserveColor()) {
     447           0 :     PreserveWrapper(self);
     448             :   }
     449           0 :   return true;
     450             : }
     451             : 
     452             : static void
     453           0 : _finalize(js::FreeOp* fop, JSObject* obj)
     454             : {
     455           0 :   txMozillaXSLTProcessor* self = UnwrapPossiblyNotInitializedDOMObject<txMozillaXSLTProcessor>(obj);
     456           0 :   if (self) {
     457           0 :     ClearWrapper(self, self, obj);
     458           0 :     AddForDeferredFinalization<txMozillaXSLTProcessor>(self);
     459             :   }
     460           0 : }
     461             : 
     462             : static void
     463           0 : _objectMoved(JSObject* obj, const JSObject* old)
     464             : {
     465           0 :   txMozillaXSLTProcessor* self = UnwrapPossiblyNotInitializedDOMObject<txMozillaXSLTProcessor>(obj);
     466           0 :   if (self) {
     467           0 :     UpdateWrapper(self, self, obj, old);
     468             :   }
     469           0 : }
     470             : 
     471             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
     472             : #if defined(__clang__)
     473             : #pragma clang diagnostic push
     474             : #pragma clang diagnostic ignored "-Wmissing-braces"
     475             : #endif
     476             : static const JSFunctionSpec sMethods_specs[] = {
     477             :   JS_FNSPEC("importStylesheet", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&importStylesheet_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
     478             :   JS_FNSPEC("transformToFragment", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&transformToFragment_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
     479             :   JS_FNSPEC("transformToDocument", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&transformToDocument_methodinfo), 1, JSPROP_ENUMERATE, nullptr),
     480             :   JS_FNSPEC("setParameter", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&setParameter_methodinfo), 3, JSPROP_ENUMERATE, nullptr),
     481             :   JS_FNSPEC("getParameter", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&getParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
     482             :   JS_FNSPEC("removeParameter", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&removeParameter_methodinfo), 2, JSPROP_ENUMERATE, nullptr),
     483             :   JS_FNSPEC("clearParameters", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&clearParameters_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
     484             :   JS_FNSPEC("reset", GenericBindingMethod, reinterpret_cast<const JSJitInfo*>(&reset_methodinfo), 0, JSPROP_ENUMERATE, nullptr),
     485             :   JS_FS_END
     486             : };
     487             : #if defined(__clang__)
     488             : #pragma clang diagnostic pop
     489             : #endif
     490             : 
     491             : 
     492             : // Can't be const because the pref-enabled boolean needs to be writable
     493             : static Prefable<const JSFunctionSpec> sMethods[] = {
     494             :   { nullptr, &sMethods_specs[0] },
     495             :   { nullptr, nullptr }
     496             : };
     497             : 
     498             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
     499             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
     500             : static_assert(8 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
     501             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
     502             : 
     503             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
     504             : #if defined(__clang__)
     505             : #pragma clang diagnostic push
     506             : #pragma clang diagnostic ignored "-Wmissing-braces"
     507             : #endif
     508             : static const JSPropertySpec sChromeAttributes_specs[] = {
     509             :   { "flags", JSPROP_SHARED | JSPROP_ENUMERATE, GenericBindingGetter, &flags_getterinfo, GenericBindingSetter, &flags_setterinfo },
     510             :   { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
     511             : };
     512             : #if defined(__clang__)
     513             : #pragma clang diagnostic pop
     514             : #endif
     515             : 
     516             : 
     517             : // Can't be const because the pref-enabled boolean needs to be writable
     518             : static Prefable<const JSPropertySpec> sChromeAttributes[] = {
     519             :   { nullptr, &sChromeAttributes_specs[0] },
     520             :   { nullptr, nullptr }
     521             : };
     522             : 
     523             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
     524             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
     525             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
     526             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
     527             : 
     528             : // We deliberately use brace-elision to make Visual Studio produce better initalization code.
     529             : #if defined(__clang__)
     530             : #pragma clang diagnostic push
     531             : #pragma clang diagnostic ignored "-Wmissing-braces"
     532             : #endif
     533             : static const ConstantSpec sChromeConstants_specs[] = {
     534             :   { "DISABLE_ALL_LOADS", JS::NumberValue(1U) },
     535             :   { 0, JS::UndefinedValue() }
     536             : };
     537             : #if defined(__clang__)
     538             : #pragma clang diagnostic pop
     539             : #endif
     540             : 
     541             : 
     542             : // Can't be const because the pref-enabled boolean needs to be writable
     543             : static Prefable<const ConstantSpec> sChromeConstants[] = {
     544             :   { nullptr, &sChromeConstants_specs[0] },
     545             :   { nullptr, nullptr }
     546             : };
     547             : 
     548             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
     549             :     "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
     550             : static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
     551             :     "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
     552             : 
     553             : 
     554             : static uint16_t sNativeProperties_sortedPropertyIndices[8];
     555             : static PropertyInfo sNativeProperties_propertyInfos[8];
     556             : 
     557             : static const NativePropertiesN<1> sNativeProperties = {
     558             :   false, 0,
     559             :   false, 0,
     560             :   true,  0 /* sMethods */,
     561             :   false, 0,
     562             :   false, 0,
     563             :   false, 0,
     564             :   false, 0,
     565             :   -1,
     566             :   8,
     567             :   sNativeProperties_sortedPropertyIndices,
     568             :   {
     569             :     { sMethods, &sNativeProperties_propertyInfos[0] }
     570             :   }
     571             : };
     572             : static_assert(8 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
     573             :     "We have a property info count that is oversized");
     574             : 
     575             : static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[2];
     576             : static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[2];
     577             : 
     578             : static const NativePropertiesN<2> sChromeOnlyNativeProperties = {
     579             :   false, 0,
     580             :   false, 0,
     581             :   false, 0,
     582             :   true,  0 /* sChromeAttributes */,
     583             :   false, 0,
     584             :   false, 0,
     585             :   true,  1 /* sChromeConstants */,
     586             :   -1,
     587             :   2,
     588             :   sChromeOnlyNativeProperties_sortedPropertyIndices,
     589             :   {
     590             :     { sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[0] },
     591             :     { sChromeConstants, &sChromeOnlyNativeProperties_propertyInfos[1] }
     592             :   }
     593             : };
     594             : static_assert(2 < 1ull << CHAR_BIT * sizeof(sChromeOnlyNativeProperties.propertyInfoCount),
     595             :     "We have a property info count that is oversized");
     596             : 
     597             : static bool
     598           0 : _constructor(JSContext* cx, unsigned argc, JS::Value* vp)
     599             : {
     600           0 :   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     601           0 :   JS::Rooted<JSObject*> obj(cx, &args.callee());
     602           0 :   if (!args.isConstructing()) {
     603             :     // XXXbz wish I could get the name from the callee instead of
     604             :     // Adding more relocations
     605           0 :     return ThrowConstructorWithoutNew(cx, "XSLTProcessor");
     606             :   }
     607             : 
     608           0 :   GlobalObject global(cx, obj);
     609           0 :   if (global.Failed()) {
     610           0 :     return false;
     611             :   }
     612             : 
     613           0 :   JS::Rooted<JSObject*> desiredProto(cx);
     614           0 :   if (!GetDesiredProto(cx, args, &desiredProto)) {
     615           0 :     return false;
     616             :   }
     617             : 
     618           0 :   bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
     619           0 :   Maybe<JSAutoCompartment> ac;
     620           0 :   if (objIsXray) {
     621           0 :     obj = js::CheckedUnwrap(obj);
     622           0 :     if (!obj) {
     623           0 :       return false;
     624             :     }
     625           0 :     ac.emplace(cx, obj);
     626           0 :     if (!JS_WrapObject(cx, &desiredProto)) {
     627           0 :       return false;
     628             :     }
     629             :   }
     630           0 :   binding_detail::FastErrorResult rv;
     631           0 :   auto result(StrongOrRawPtr<txMozillaXSLTProcessor>(txMozillaXSLTProcessor::Constructor(global, rv)));
     632           0 :   if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx))) {
     633           0 :     return false;
     634             :   }
     635           0 :   MOZ_ASSERT(!JS_IsExceptionPending(cx));
     636             :   static_assert(!IsPointer<decltype(result)>::value,
     637             :                 "NewObject implies that we need to keep the object alive with a strong reference.");
     638           0 :   if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
     639           0 :     MOZ_ASSERT(true || JS_IsExceptionPending(cx));
     640           0 :     return false;
     641             :   }
     642           0 :   return true;
     643             : }
     644             : 
     645             : static const js::ClassOps sInterfaceObjectClassOps = {
     646             :     nullptr,               /* addProperty */
     647             :     nullptr,               /* delProperty */
     648             :     nullptr,               /* getProperty */
     649             :     nullptr,               /* setProperty */
     650             :     nullptr,               /* enumerate */
     651             :     nullptr,               /* newEnumerate */
     652             :     nullptr,               /* resolve */
     653             :     nullptr,               /* mayResolve */
     654             :     nullptr,               /* finalize */
     655             :     _constructor, /* call */
     656             :     nullptr,               /* hasInstance */
     657             :     _constructor, /* construct */
     658             :     nullptr,               /* trace */
     659             : };
     660             : 
     661             : static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
     662             :   {
     663             :     "Function",
     664             :     JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
     665             :     &sInterfaceObjectClassOps,
     666             :     JS_NULL_CLASS_SPEC,
     667             :     JS_NULL_CLASS_EXT,
     668             :     &sInterfaceObjectClassObjectOps
     669             :   },
     670             :   eInterface,
     671             :   true,
     672             :   prototypes::id::XSLTProcessor,
     673             :   PrototypeTraits<prototypes::id::XSLTProcessor>::Depth,
     674             :   sNativePropertyHooks,
     675             :   "function XSLTProcessor() {\n    [native code]\n}",
     676             :   JS::GetRealmFunctionPrototype
     677             : };
     678             : 
     679             : static const DOMIfaceAndProtoJSClass sPrototypeClass = {
     680             :   {
     681             :     "XSLTProcessorPrototype",
     682             :     JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
     683             :     JS_NULL_CLASS_OPS,
     684             :     JS_NULL_CLASS_SPEC,
     685             :     JS_NULL_CLASS_EXT,
     686             :     JS_NULL_OBJECT_OPS
     687             :   },
     688             :   eInterfacePrototype,
     689             :   false,
     690             :   prototypes::id::XSLTProcessor,
     691             :   PrototypeTraits<prototypes::id::XSLTProcessor>::Depth,
     692             :   sNativePropertyHooks,
     693             :   "[object XSLTProcessorPrototype]",
     694             :   JS::GetRealmObjectPrototype
     695             : };
     696             : 
     697             : JSObject*
     698           0 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal)
     699             : {
     700           0 :   return GetConstructorObjectHandle(aCx, aDefineOnGlobal);
     701             : }
     702             : 
     703             : static const js::ClassOps sClassOps = {
     704             :   _addProperty, /* addProperty */
     705             :   nullptr,               /* delProperty */
     706             :   nullptr,               /* getProperty */
     707             :   nullptr,               /* setProperty */
     708             :   nullptr,               /* enumerate */
     709             :   nullptr, /* newEnumerate */
     710             :   nullptr, /* resolve */
     711             :   nullptr, /* mayResolve */
     712             :   _finalize, /* finalize */
     713             :   nullptr, /* call */
     714             :   nullptr,               /* hasInstance */
     715             :   nullptr,               /* construct */
     716             :   nullptr, /* trace */
     717             : };
     718             : 
     719             : static const js::ClassExtension sClassExtension = {
     720             :   nullptr, /* weakmapKeyDelegateOp */
     721             :   _objectMoved /* objectMovedOp */
     722             : };
     723             : 
     724             : static const DOMJSClass sClass = {
     725             :   { "XSLTProcessor",
     726             :     JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
     727             :     &sClassOps,
     728             :     JS_NULL_CLASS_SPEC,
     729             :     &sClassExtension,
     730             :     JS_NULL_OBJECT_OPS
     731             :   },
     732             :   { prototypes::id::XSLTProcessor, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
     733             :   IsBaseOf<nsISupports, txMozillaXSLTProcessor >::value,
     734             :   sNativePropertyHooks,
     735             :   FindAssociatedGlobalForNative<txMozillaXSLTProcessor>::Get,
     736             :   GetProtoObjectHandle,
     737             :   GetCCParticipant<txMozillaXSLTProcessor>::Get()
     738             : };
     739             : static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
     740             :               "Must have the right minimal number of reserved slots.");
     741             : static_assert(1 >= 1,
     742             :               "Must have enough reserved slots.");
     743             : 
     744             : const JSClass*
     745           0 : GetJSClass()
     746             : {
     747           0 :   return sClass.ToJSClass();
     748             : }
     749             : 
     750             : bool
     751           0 : Wrap(JSContext* aCx, txMozillaXSLTProcessor* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
     752             : {
     753             :   MOZ_ASSERT(static_cast<txMozillaXSLTProcessor*>(aObject) ==
     754             :              reinterpret_cast<txMozillaXSLTProcessor*>(aObject),
     755             :              "Multiple inheritance for txMozillaXSLTProcessor is broken.");
     756           0 :   MOZ_ASSERT(ToSupportsIsCorrect(aObject));
     757           0 :   MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
     758           0 :   MOZ_ASSERT(!aCache->GetWrapper(),
     759             :              "You should probably not be using Wrap() directly; use "
     760             :              "GetOrCreateDOMReflector instead");
     761             : 
     762           0 :   MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
     763             :              "nsISupports must be on our primary inheritance chain");
     764             : 
     765           0 :   JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
     766           0 :   if (!global) {
     767           0 :     return false;
     768             :   }
     769           0 :   MOZ_ASSERT(JS_IsGlobalObject(global));
     770           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(global));
     771             : 
     772             :   // That might have ended up wrapping us already, due to the wonders
     773             :   // of XBL.  Check for that, and bail out as needed.
     774           0 :   aReflector.set(aCache->GetWrapper());
     775           0 :   if (aReflector) {
     776             : #ifdef DEBUG
     777           0 :     binding_detail::AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
     778             : #endif // DEBUG
     779           0 :     return true;
     780             :   }
     781             : 
     782           0 :   JSAutoCompartment ac(aCx, global);
     783           0 :   JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
     784           0 :   if (!canonicalProto) {
     785           0 :     return false;
     786             :   }
     787           0 :   JS::Rooted<JSObject*> proto(aCx);
     788           0 :   if (aGivenProto) {
     789           0 :     proto = aGivenProto;
     790             :     // Unfortunately, while aGivenProto was in the compartment of aCx
     791             :     // coming in, we changed compartments to that of "parent" so may need
     792             :     // to wrap the proto here.
     793           0 :     if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
     794           0 :       if (!JS_WrapObject(aCx, &proto)) {
     795           0 :         return false;
     796             :       }
     797             :     }
     798             :   } else {
     799           0 :     proto = canonicalProto;
     800             :   }
     801             : 
     802           0 :   BindingJSObjectCreator<txMozillaXSLTProcessor> creator(aCx);
     803           0 :   creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
     804           0 :   if (!aReflector) {
     805           0 :     return false;
     806             :   }
     807             : 
     808           0 :   aCache->SetWrapper(aReflector);
     809           0 :   creator.InitializationSucceeded();
     810             : 
     811           0 :   MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
     812             :              aCache->GetWrapperPreserveColor() == aReflector);
     813             :   // If proto != canonicalProto, we have to preserve our wrapper;
     814             :   // otherwise we won't be able to properly recreate it later, since
     815             :   // we won't know what proto to use.  Note that we don't check
     816             :   // aGivenProto here, since it's entirely possible (and even
     817             :   // somewhat common) to have a non-null aGivenProto which is the
     818             :   // same as canonicalProto.
     819           0 :   if (proto != canonicalProto) {
     820           0 :     PreserveWrapper(aObject);
     821             :   }
     822             : 
     823           0 :   return true;
     824             : }
     825             : 
     826             : const NativePropertyHooks sNativePropertyHooks[] = { {
     827             :   nullptr,
     828             :   nullptr,
     829             :   nullptr,
     830             :   { sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast() },
     831             :   prototypes::id::XSLTProcessor,
     832             :   constructors::id::XSLTProcessor,
     833             :   nullptr,
     834             :   &DefaultXrayExpandoObjectClass
     835             : } };
     836             : 
     837             : void
     838           0 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
     839             : {
     840           0 :   JS::Rooted<JSObject*> parentProto(aCx, JS::GetRealmObjectPrototype(aCx));
     841           0 :   if (!parentProto) {
     842           0 :     return;
     843             :   }
     844             : 
     845           0 :   JS::Rooted<JSObject*> constructorProto(aCx, JS::GetRealmFunctionPrototype(aCx));
     846           0 :   if (!constructorProto) {
     847           0 :     return;
     848             :   }
     849             : 
     850             :   static bool sIdsInited = false;
     851           0 :   if (!sIdsInited && NS_IsMainThread()) {
     852           0 :     if (!InitIds(aCx, sNativeProperties.Upcast())) {
     853           0 :       return;
     854             :     }
     855           0 :     if (!InitIds(aCx, sChromeOnlyNativeProperties.Upcast())) {
     856           0 :       return;
     857             :     }
     858           0 :     sIdsInited = true;
     859             :   }
     860             : 
     861           0 :   JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::XSLTProcessor);
     862           0 :   JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::XSLTProcessor);
     863           0 :   dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
     864             :                               &sPrototypeClass.mBase, protoCache,
     865             :                               constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
     866             :                               interfaceCache,
     867             :                               sNativeProperties.Upcast(),
     868           0 :                               nsContentUtils::ThreadsafeIsSystemCaller(aCx) ? sChromeOnlyNativeProperties.Upcast() : nullptr,
     869             :                               "XSLTProcessor", aDefineOnGlobal,
     870             :                               nullptr,
     871           0 :                               false);
     872             : }
     873             : 
     874             : JS::Handle<JSObject*>
     875           0 : GetProtoObjectHandle(JSContext* aCx)
     876             : {
     877             :   /* Get the interface prototype object for this class.  This will create the
     878             :      object as needed. */
     879           0 :   bool aDefineOnGlobal = true;
     880             : 
     881             :   /* Make sure our global is sane.  Hopefully we can remove this sometime */
     882           0 :   JSObject* global = JS::CurrentGlobalOrNull(aCx);
     883           0 :   if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
     884           0 :     return nullptr;
     885             :   }
     886             : 
     887             :   /* Check to see whether the interface objects are already installed */
     888           0 :   ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
     889           0 :   if (!protoAndIfaceCache.HasEntryInSlot(prototypes::id::XSLTProcessor)) {
     890           0 :     JS::Rooted<JSObject*> rootedGlobal(aCx, global);
     891           0 :     CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
     892             :   }
     893             : 
     894             :   /*
     895             :    * The object might _still_ be null, but that's OK.
     896             :    *
     897             :    * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
     898             :    * traced by TraceProtoAndIfaceCache() and its contents are never
     899             :    * changed after they have been set.
     900             :    *
     901             :    * Calling address() avoids the read read barrier that does gray
     902             :    * unmarking, but it's not possible for the object to be gray here.
     903             :    */
     904             : 
     905           0 :   const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(prototypes::id::XSLTProcessor);
     906           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
     907           0 :   return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
     908             : }
     909             : 
     910             : JS::Handle<JSObject*>
     911           0 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal)
     912             : {
     913             :   /* Get the interface object for this class.  This will create the object as
     914             :      needed. */
     915             : 
     916             :   /* Make sure our global is sane.  Hopefully we can remove this sometime */
     917           0 :   JSObject* global = JS::CurrentGlobalOrNull(aCx);
     918           0 :   if (!(js::GetObjectClass(global)->flags & JSCLASS_DOM_GLOBAL)) {
     919           0 :     return nullptr;
     920             :   }
     921             : 
     922             :   /* Check to see whether the interface objects are already installed */
     923           0 :   ProtoAndIfaceCache& protoAndIfaceCache = *GetProtoAndIfaceCache(global);
     924           0 :   if (!protoAndIfaceCache.HasEntryInSlot(constructors::id::XSLTProcessor)) {
     925           0 :     JS::Rooted<JSObject*> rootedGlobal(aCx, global);
     926           0 :     CreateInterfaceObjects(aCx, rootedGlobal, protoAndIfaceCache, aDefineOnGlobal);
     927             :   }
     928             : 
     929             :   /*
     930             :    * The object might _still_ be null, but that's OK.
     931             :    *
     932             :    * Calling fromMarkedLocation() is safe because protoAndIfaceCache is
     933             :    * traced by TraceProtoAndIfaceCache() and its contents are never
     934             :    * changed after they have been set.
     935             :    *
     936             :    * Calling address() avoids the read read barrier that does gray
     937             :    * unmarking, but it's not possible for the object to be gray here.
     938             :    */
     939             : 
     940           0 :   const JS::Heap<JSObject*>& entrySlot = protoAndIfaceCache.EntrySlotMustExist(constructors::id::XSLTProcessor);
     941           0 :   MOZ_ASSERT(JS::ObjectIsNotGray(entrySlot));
     942           0 :   return JS::Handle<JSObject*>::fromMarkedLocation(entrySlot.address());
     943             : }
     944             : 
     945             : JSObject*
     946           0 : GetConstructorObject(JSContext* aCx)
     947             : {
     948           0 :   return GetConstructorObjectHandle(aCx);
     949             : }
     950             : 
     951             : } // namespace XSLTProcessorBinding
     952             : 
     953             : 
     954             : 
     955             : } // namespace dom
     956             : } // namespace mozilla

Generated by: LCOV version 1.13