void JSAudioTrackOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) { JSAudioTrack* jsAudioTrack = jsCast<JSAudioTrack*>(handle.get().asCell()); DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context); uncacheWrapper(world, &jsAudioTrack->impl(), jsAudioTrack); jsAudioTrack->releaseImpl(); }
bool JSAudioTrackOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) { JSAudioTrack* jsAudioTrack = jsCast<JSAudioTrack*>(handle.get().asCell()); if (!isObservable(jsAudioTrack)) return false; Element* element = jsAudioTrack->impl().element(); if (!element) return false; void* root = WebCore::root(element); return visitor.containsOpaqueRoot(root); }
EncodedJSValue jsAudioTrackEnabled(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) { JSAudioTrack* castedThis = jsDynamicCast<JSAudioTrack*>(JSValue::decode(thisValue)); UNUSED_PARAM(slotBase); if (!castedThis) return throwVMTypeError(exec); UNUSED_PARAM(exec); AudioTrack& impl = castedThis->impl(); JSValue result = jsBoolean(impl.enabled()); return JSValue::encode(result); }
EncodedJSValue jsAudioTrackLanguage(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) { JSAudioTrack* castedThis = jsDynamicCast<JSAudioTrack*>(JSValue::decode(thisValue)); UNUSED_PARAM(slotBase); if (!castedThis) return throwVMTypeError(exec); UNUSED_PARAM(exec); AudioTrack& impl = castedThis->impl(); JSValue result = jsStringWithCache(exec, impl.language()); return JSValue::encode(result); }
void JSAudioTrack::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSAudioTrack* jsAudioTrack = jsCast<JSAudioTrack*>(cell); ASSERT_GC_OBJECT_INHERITS(jsAudioTrack, info()); COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); ASSERT(jsAudioTrack->structure()->typeInfo().overridesVisitChildren()); Base::visitChildren(jsAudioTrack, visitor); AudioTrack* audioTrack = jsAudioTrack->impl(); visitor.addOpaqueRoot(root(audioTrack)); }
void setJSAudioTrackEnabled(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); UNUSED_PARAM(exec); JSAudioTrack* castedThis = jsDynamicCast<JSAudioTrack*>(JSValue::decode(thisValue)); if (!castedThis) { throwVMTypeError(exec); return; } AudioTrack& impl = castedThis->impl(); bool nativeValue(value.toBoolean(exec)); if (exec->hadException()) return; impl.setEnabled(nativeValue); }