当前位置: 首页>>代码示例>>C++>>正文


C++ Persistent::Set方法代码示例

本文整理汇总了C++中v8::Persistent::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ Persistent::Set方法的具体用法?C++ Persistent::Set怎么用?C++ Persistent::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在v8::Persistent的用法示例。


在下文中一共展示了Persistent::Set方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: configureTemplate

static v8::Persistent<v8::FunctionTemplate> ConfigureV8SVGFEBlendElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "SVGFEBlendElement", V8SVGElement::GetTemplate(), V8SVGFEBlendElement::internalFieldCount,
        SVGFEBlendElementAttrs, WTF_ARRAY_LENGTH(SVGFEBlendElementAttrs),
        SVGFEBlendElementCallbacks, WTF_ARRAY_LENGTH(SVGFEBlendElementCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    batchConfigureConstants(desc, proto, SVGFEBlendElementConsts, WTF_ARRAY_LENGTH(SVGFEBlendElementConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例2:

static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestNodeTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestNode", V8Node::GetTemplate(), V8TestNode::internalFieldCount,
        0, 0,
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    desc->SetCallHandler(V8TestNode::constructorCallback);
    

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例3: configureTemplate

static v8::Persistent<v8::FunctionTemplate> ConfigureV8HTMLCollectionTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "HTMLCollection", v8::Persistent<v8::FunctionTemplate>(), V8HTMLCollection::internalFieldCount,
        HTMLCollectionAttrs, sizeof(HTMLCollectionAttrs) / sizeof(*HTMLCollectionAttrs),
        HTMLCollectionCallbacks, sizeof(HTMLCollectionCallbacks) / sizeof(*HTMLCollectionCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    setCollectionIndexedGetter<HTMLCollection, Node>(desc);
    desc->InstanceTemplate()->SetNamedPropertyHandler(V8HTMLCollection::namedPropertyGetter, 0, 0, 0, 0);
    desc->InstanceTemplate()->SetCallAsFunctionHandler(V8HTMLCollection::callAsFunctionCallback);

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:16,代码来源:V8HTMLCollection.cpp

示例4:

v8::Handle<v8::ObjectTemplate>
JSFeature::GetAttributesObjectTemplate()
{
    v8::HandleScope handle_scope;

    static v8::Persistent<v8::ObjectTemplate> attr_instance;

    if (attr_instance.IsEmpty())
    {
        attr_instance = v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New());
        attr_instance->Set(v8::String::New(V8_OBJECT_TYPE_PROPERTY), v8::String::New("JSFeature_Attrs"));
        attr_instance->SetInternalFieldCount(1);
        attr_instance->SetNamedPropertyHandler(AttrPropertyCallback);
    }

    return attr_instance;
}
开发者ID:nedbrek,项目名称:osgearth,代码行数:17,代码来源:JSWrappers.cpp

示例5: configureTemplate

static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListenerTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = configureTemplate(desc, "TestMediaQueryListListener", v8::Persistent<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
        0, 0,
        TestMediaQueryListListenerCallbacks, WTF_ARRAY_LENGTH(TestMediaQueryListListenerCallbacks));
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:19,代码来源:V8TestMediaQueryListListener.cpp

示例6:

static v8::Persistent<v8::FunctionTemplate> ConfigureV8InjectedScriptHostTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "InjectedScriptHost", v8::Persistent<v8::FunctionTemplate>(), V8InjectedScriptHost::internalFieldCount,
        0, 0,
        V8InjectedScriptHostCallbacks, WTF_ARRAY_LENGTH(V8InjectedScriptHostCallbacks));
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:19,代码来源:V8InjectedScriptHost.cpp

示例7:

static v8::Persistent<v8::FunctionTemplate> ConfigureV8HTMLAnchorElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "HTMLAnchorElement", V8HTMLElement::GetTemplate(), V8HTMLAnchorElement::internalFieldCount,
                       V8HTMLAnchorElementAttrs, WTF_ARRAY_LENGTH(V8HTMLAnchorElementAttrs),
                       0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.

    proto->Set(v8::String::NewSymbol("toString"), v8::FunctionTemplate::New(HTMLAnchorElementV8Internal::toStringCallback, v8Undefined(), defaultSignature), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum));

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:20,代码来源:V8HTMLAnchorElement.cpp

示例8:

static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType worldType)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestSerializedScriptValueInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
        V8TestSerializedScriptValueInterfaceAttrs, WTF_ARRAY_LENGTH(V8TestSerializedScriptValueInterfaceAttrs),
        V8TestSerializedScriptValueInterfaceMethods, WTF_ARRAY_LENGTH(V8TestSerializedScriptValueInterfaceMethods), isolate);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    desc->SetCallHandler(V8TestSerializedScriptValueInterface::constructorCallback);
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:jbat100,项目名称:webkit,代码行数:20,代码来源:V8TestSerializedScriptValueInterface.cpp

示例9:

static v8::Persistent<v8::FunctionTemplate> ConfigureV8SVGPreserveAspectRatioTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "SVGPreserveAspectRatio", v8::Persistent<v8::FunctionTemplate>(), V8SVGPreserveAspectRatio::internalFieldCount,
        V8SVGPreserveAspectRatioAttrs, WTF_ARRAY_LENGTH(V8SVGPreserveAspectRatioAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    
    V8DOMConfiguration::batchConfigureConstants(desc, proto, V8SVGPreserveAspectRatioConsts, WTF_ARRAY_LENGTH(V8SVGPreserveAspectRatioConsts));

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:20,代码来源:V8SVGPreserveAspectRatio.cpp

示例10: getToStringTemplate

static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestSerializedScriptValueInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
        TestSerializedScriptValueInterfaceAttrs, WTF_ARRAY_LENGTH(TestSerializedScriptValueInterfaceAttrs),
        TestSerializedScriptValueInterfaceCallbacks, WTF_ARRAY_LENGTH(TestSerializedScriptValueInterfaceCallbacks));
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    desc->SetCallHandler(V8TestSerializedScriptValueInterface::constructorCallback);
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例11:

static v8::Persistent<v8::FunctionTemplate> ConfigureV8MediaKeyErrorTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    if (!RuntimeEnabledFeatures::encryptedMediaEnabled())
        defaultSignature = V8DOMConfiguration::configureTemplate(desc, "", v8::Persistent<v8::FunctionTemplate>(), V8MediaKeyError::internalFieldCount, 0, 0, 0, 0);
    else
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "MediaKeyError", v8::Persistent<v8::FunctionTemplate>(), V8MediaKeyError::internalFieldCount,
        V8MediaKeyErrorAttrs, WTF_ARRAY_LENGTH(V8MediaKeyErrorAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    
    V8DOMConfiguration::batchConfigureConstants(desc, proto, V8MediaKeyErrorConsts, WTF_ARRAY_LENGTH(V8MediaKeyErrorConsts));

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:23,代码来源:V8MediaKeyError.cpp


注:本文中的v8::Persistent::Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。