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

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

Generated by: LCOV version 1.13