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


C++ CallbackInfo::GetIsolate方法代码示例

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


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

示例1: getNamedItems

static v8::Local<v8::Value> getNamedItems(HTMLAllCollection* collection, AtomicString name, const CallbackInfo& info)
{
    WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems;
    collection->namedItems(name, namedItems);

    if (!namedItems.size())
        return v8Undefined();

    if (namedItems.size() == 1)
        return toV8(namedItems.at(0).release(), info.Holder(), info.GetIsolate());

    // FIXME: HTML5 specification says this should be a HTMLCollection.
    // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
    return toV8(StaticElementList::adopt(namedItems), info.Holder(), info.GetIsolate());
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:15,代码来源:V8HTMLAllCollectionCustom.cpp

示例2: getItem

static v8::Local<v8::Value> getItem(HTMLAllCollection* collection, v8::Local<v8::Value> argument, const CallbackInfo& info)
{
    v8::Local<v8::Uint32> index;
    if (!argument->ToArrayIndex(info.GetIsolate()->GetCurrentContext()).ToLocal(&index)) {
        TOSTRING_DEFAULT(V8StringResource<>, name, argument, v8::Undefined(info.GetIsolate()));
        v8::Local<v8::Value> result = getNamedItems(collection, name, info);

        if (result.IsEmpty())
            return v8::Undefined(info.GetIsolate());

        return result;
    }

    RefPtrWillBeRawPtr<Element> result = collection->item(index->Value());
    return toV8(result.release(), info.Holder(), info.GetIsolate());
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:16,代码来源:V8HTMLAllCollectionCustom.cpp

示例3: getItem

static v8::Handle<v8::Value> getItem(HTMLAllCollection* collection, v8::Handle<v8::Value> argument, const CallbackInfo& info)
{
    v8::Local<v8::Uint32> index = argument->ToArrayIndex();
    if (index.IsEmpty()) {
        V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, name, argument, v8::Undefined(info.GetIsolate()));
        v8::Handle<v8::Value> result = getNamedItems(collection, name, info);

        if (result.IsEmpty())
            return v8::Undefined(info.GetIsolate());

        return result;
    }

    RefPtr<Element> result = collection->item(index->Uint32Value());
    return toV8(result.release(), info.Holder(), info.GetIsolate());
}
开发者ID:wangshijun,项目名称:Blink,代码行数:16,代码来源:V8HTMLAllCollectionCustom.cpp

示例4: getNamedItems

static v8::Handle<v8::Value> getNamedItems(HTMLFormControlsCollection* collection, const AtomicString& name, const CallbackInfo& callbackInfo)
{
    Vector<RefPtr<Node> > namedItems;
    collection->namedItems(name, namedItems);

    if (!namedItems.size())
        return v8Undefined();

    if (namedItems.size() == 1)
        return toV8(namedItems.at(0).release(), callbackInfo.Holder(), callbackInfo.GetIsolate());

    return toV8(collection->ownerNode()->radioNodeList(name).get(), callbackInfo.Holder(), callbackInfo.GetIsolate());
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:13,代码来源:V8HTMLFormControlsCollectionCustom.cpp

示例5: getNamedItems

static v8::Handle<v8::Value> getNamedItems(HTMLAllCollection* collection, AtomicString name, const CallbackInfo& info)
{
    WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems;
    collection->namedItems(name, namedItems);

    if (!namedItems.size())
        return v8Undefined();

    if (namedItems.size() == 1)
        return toV8(namedItems.at(0).release(), info.Holder(), info.GetIsolate());

    // FIXME: HTML5 specification says this should be a HTMLCollection.
    // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
    //
    // FIXME: Oilpan: explicitly convert adopt()'s result so as to
    // disambiguate the (implicit) conversion of its
    // PassRefPtrWillBeRawPtr<StaticElementList> result -- the
    // other toV8() overload that introduces the ambiguity is
    // toV8(NodeList*, ...).
    //
    // When adopt() no longer uses transition types, the conversion
    // can be removed.
    return toV8(PassRefPtrWillBeRawPtr<NodeList>(StaticElementList::adopt(namedItems)), info.Holder(), info.GetIsolate());
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:24,代码来源:V8HTMLAllCollectionCustom.cpp

示例6: TestInterfaceNamedConstructorCreateDataProperty

static bool TestInterfaceNamedConstructorCreateDataProperty(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
    ASSERT(info.This()->IsObject());
    return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:5,代码来源:V8TestInterfaceNamedConstructor.cpp

示例7: TestTypedefsForceSetAttributeOnThis

static void TestTypedefsForceSetAttributeOnThis(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
    ASSERT(info.This()->IsObject());
    v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCurrentContext(), name, v8Value);
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:5,代码来源:V8TestTypedefs.cpp


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