Пример #1
0
void JSMessageChannelOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSMessageChannel* jsMessageChannel = jsCast<JSMessageChannel*>(handle.get().asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsMessageChannel->impl(), jsMessageChannel);
    jsMessageChannel->releaseImpl();
}
Пример #2
0
JSValue jsMessageChannelPort2(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSMessageChannel* castedThis = static_cast<JSMessageChannel*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    MessageChannel* imp = static_cast<MessageChannel*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->port2()));
    return result;
}
Пример #3
0
EncodedJSValue jsMessageChannelConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSMessageChannel* domObject = jsDynamicCast<JSMessageChannel*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSMessageChannel::getConstructor(exec->vm(), domObject->globalObject()));
}
Пример #4
0
EncodedJSValue jsMessageChannelPort2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSMessageChannel* castedThis = jsDynamicCast<JSMessageChannel*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    MessageChannel& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.port2()));
    return JSValue::encode(result);
}
void JSMessageChannel::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
    JSMessageChannel* thisObject = jsCast<JSMessageChannel*>(cell);
    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
    Base::visitChildren(thisObject, visitor);

    if (MessagePort* port = thisObject->m_impl->port1())
        visitor.addOpaqueRoot(port);

    if (MessagePort* port = thisObject->m_impl->port2())
        visitor.addOpaqueRoot(port);
}
Пример #6
0
JSValue jsMessageChannelConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSMessageChannel* domObject = static_cast<JSMessageChannel*>(asObject(slotBase));
    return JSMessageChannel::getConstructor(exec, domObject->globalObject());
}