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


C++ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID函数代码示例

本文整理汇总了C++中V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID函数的典型用法代码示例。如果您正苦于以下问题:C++ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID函数的具体用法?C++ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID怎么用?C++ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID

void V8MessageEvent::initMessageEventMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    MessageEvent* event = V8MessageEvent::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, typeArg, info[0]);
    V8TRYCATCH_VOID(bool, canBubbleArg, info[1]->BooleanValue());
    V8TRYCATCH_VOID(bool, cancelableArg, info[2]->BooleanValue());
    v8::Handle<v8::Value> dataArg = info[3];
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, originArg, info[4]);
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, lastEventIdArg, info[5]);
    DOMWindow* sourceArg = toDOMWindow(info[6], info.GetIsolate());
    OwnPtr<MessagePortArray> portArray;
    const int portArrayIndex = 7;
    if (!isUndefinedOrNull(info[portArrayIndex])) {
        portArray = adoptPtr(new MessagePortArray);
        bool success = false;
        *portArray = toRefPtrNativeArray<MessagePort, V8MessagePort>(info[portArrayIndex], portArrayIndex + 1, info.GetIsolate(), &success);
        if (!success)
            return;
    }
    event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, originArg, lastEventIdArg, sourceArg, portArray.release());

    if (!dataArg.IsEmpty()) {
        V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), V8HiddenValue::data(info.GetIsolate()), dataArg);
        if (DOMWrapperWorld::current(info.GetIsolate())->isIsolatedWorld())
            event->setSerializedData(SerializedScriptValue::createAndSwallowExceptions(dataArg, info.GetIsolate()));
    }
}
开发者ID:Mihiri,项目名称:blink,代码行数:27,代码来源:V8MessageEventCustom.cpp

示例2: exceptionState

void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    DOMWindow* impl = V8Window::toNative(info.Holder());
    ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Window", info.Holder(), info.GetIsolate());
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        exceptionState.throwIfNeeded();
        return;
    }

    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, urlString, info[0]);
    AtomicString frameName;
    if (info[1]->IsUndefined() || info[1]->IsNull()) {
        frameName = "_blank";
    } else {
        V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, frameNameResource, info[1]);
        frameName = frameNameResource;
    }
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, windowFeaturesString, info[2]);

    RefPtr<DOMWindow> openedWindow = impl->open(urlString, frameName, windowFeaturesString, callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()));
    if (!openedWindow)
        return;

    v8SetReturnValueFast(info, openedWindow.release(), impl);
}
开发者ID:kublaj,项目名称:blink,代码行数:25,代码来源:V8WindowCustom.cpp

示例3: namedPropertySetter

static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    if (info.Holder()->HasRealNamedProperty(name))
        return;
    if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
        return;

    TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name);
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
    bool result = imp->anonymousNamedSetter(propertyName, propertyValue);
    if (!result)
        return;
    v8SetReturnValue(info, jsValue);
}
开发者ID:kublaj,项目名称:blink,代码行数:15,代码来源:V8TestEventTarget.cpp

示例4: textAttrSetter

static void textAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    HTMLTitleElement* imp = V8HTMLTitleElement::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, value);
    imp->setText(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8HTMLTitleElement.cpp

示例5: aAttributeSetter

static void aAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
    RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
    imp->setA(v);
    return;
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:7,代码来源:V8TestInterfaceImplementedAs.cpp

示例6: xmlspaceAttrSetter

static void xmlspaceAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    SVGSwitchElement* imp = V8SVGSwitchElement::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
    imp->setXmlspace(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8SVGSwitchElement.cpp

示例7: ASSERT

void V8HTMLAllCollection::legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    if (info.Length() < 1)
        return;

    HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder());
    Node* ownerNode = imp->ownerNode();
    ASSERT(ownerNode);

    UseCounter::count(ownerNode->document(), UseCounter::DocumentAllLegacyCall);

    if (info.Length() == 1) {
        v8SetReturnValue(info, getItem(imp, info[0], info));
        return;
    }

    // If there is a second argument it is the index of the item we want.
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]);
    v8::Local<v8::Uint32> index = info[1]->ToArrayIndex();
    if (index.IsEmpty())
        return;

    if (Node* node = imp->namedItemWithIndex(name, index->Uint32Value())) {
        v8SetReturnValueFast(info, node, imp);
        return;
    }
}
开发者ID:wangshijun,项目名称:Blink,代码行数:27,代码来源:V8HTMLAllCollectionCustom.cpp

示例8: selectorTextAttrSetter

static void selectorTextAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    CSSPageRule* imp = V8CSSPageRule::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, v, value);
    imp->setSelectorText(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8CSSPageRule.cpp

示例9: modeAttrSetter

static void modeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    TextTrack* imp = V8TextTrack::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
    imp->setMode(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8TextTrack.cpp

示例10: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID

void V8History::replaceStateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
    bool didThrow = false;
    RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, 0, didThrow, args.GetIsolate());
    if (didThrow)
        return;

    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, title, args[1]);
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, url, argumentOrNull(args, 2));

    ExceptionCode ec = 0;
    History* history = V8History::toNative(args.Holder());
    history->stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
    args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
    v8SetReturnValue(args, setDOMException(ec, args.GetIsolate()));
}
开发者ID:windyuuy,项目名称:opera,代码行数:16,代码来源:V8HistoryCustom.cpp

示例11: effectAllowedAttrSetter

static void effectAllowedAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    Clipboard* imp = V8Clipboard::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
    imp->setEffectAllowed(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8Clipboard.cpp

示例12: mediaAttrSetter

static void mediaAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    HTMLSourceElement* imp = V8HTMLSourceElement::toNative(info.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, v, value);
    imp->setMedia(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8HTMLSourceElement.cpp

示例13: supplementalStr2AttributeSetter

static void supplementalStr2AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
    v8::Handle<v8::Object> holder = info.Holder();
    TestInterface* impl = V8TestInterface::toNative(holder);
    ASSERT(impl);
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
    TestPartialInterface::setSupplementalStr2(*impl, cppValue);
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:8,代码来源:V8TestInterface.cpp

示例14: exceptionState

void V8XMLHttpRequest::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    // Four cases:
    // open(method, url)
    // open(method, url, async)
    // open(method, url, async, user)
    // open(method, url, async, user, passwd)

    ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "XMLHttpRequest", info.Holder(), info.GetIsolate());

    if (info.Length() < 2) {
        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
        exceptionState.throwIfNeeded();
        return;
    }

    XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder());

    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, method, info[0]);
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, urlstring, info[1]);

    ExecutionContext* context = currentExecutionContext(info.GetIsolate());
    KURL url = context->completeURL(urlstring);

    if (info.Length() >= 3) {
        bool async = info[2]->BooleanValue();

        if (info.Length() >= 4 && !info[3]->IsUndefined()) {
            V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, user, info[3]);

            if (info.Length() >= 5 && !info[4]->IsUndefined()) {
                V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, password, info[4]);
                xmlHttpRequest->open(method, url, async, user, password, exceptionState);
            } else {
                xmlHttpRequest->open(method, url, async, user, exceptionState);
            }
        } else {
            xmlHttpRequest->open(method, url, async, exceptionState);
        }
    } else {
        xmlHttpRequest->open(method, url, exceptionState);
    }

    exceptionState.throwIfNeeded();
}
开发者ID:kublaj,项目名称:blink,代码行数:45,代码来源:V8XMLHttpRequestCustom.cpp

示例15: constructor4

static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, string, info[0]);

    RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(string);
    v8::Handle<v8::Object> wrapper = info.Holder();

    V8DOMWrapper::associateObjectWithWrapper<V8TestOverloadedConstructors>(impl.release(), &V8TestOverloadedConstructors::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
    info.GetReturnValue().Set(wrapper);
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:10,代码来源:V8TestOverloadedConstructors.cpp


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