Пример #1
0
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();
}
Пример #2
0
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);
}
Пример #3
0
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);
}
Пример #4
0
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);
}
Пример #5
0
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));
}
Пример #6
0
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);
}