本文整理汇总了C++中MessageChannel::port1方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageChannel::port1方法的具体用法?C++ MessageChannel::port1怎么用?C++ MessageChannel::port1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageChannel
的用法示例。
在下文中一共展示了MessageChannel::port1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsMessageChannelPort1
JSValue jsMessageChannelPort1(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->port1()));
return result;
}
示例2: currentExecutionContext
void V8MessageChannel::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExecutionContext* context = currentExecutionContext(info.GetIsolate());
MessageChannel* channel = MessageChannel::create(context);
v8::Local<v8::Object> wrapper = info.Holder();
// Create references from the MessageChannel wrapper to the two
// MessagePort wrappers to make sure that the MessagePort wrappers
// stay alive as long as the MessageChannel wrapper is around.
V8HiddenValue::setHiddenValue(info.GetIsolate(), wrapper, V8HiddenValue::port1(info.GetIsolate()), toV8(channel->port1(), info.Holder(), info.GetIsolate()));
V8HiddenValue::setHiddenValue(info.GetIsolate(), wrapper, V8HiddenValue::port2(info.GetIsolate()), toV8(channel->port2(), info.Holder(), info.GetIsolate()));
V8DOMWrapper::associateObjectWithWrapper(info.GetIsolate(), channel, &wrapperTypeInfo, wrapper);
info.GetReturnValue().Set(wrapper);
}