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


C++ V8TRYCATCH_FOR_V8STRINGRESOURCE函数代码示例

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


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

示例1: changeVersionCallback

static v8::Handle<v8::Value> changeVersionCallback(const v8::Arguments& args)
{
    if (args.Length() < 2)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    Database* imp = V8Database::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, oldVersion, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, newVersion, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    RefPtr<SQLTransactionCallback> callback;
    if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
        if (!args[2]->IsFunction())
            return throwTypeError(0, args.GetIsolate());
        callback = V8SQLTransactionCallback::create(args[2], getScriptExecutionContext());
    }
    RefPtr<SQLTransactionErrorCallback> errorCallback;
    if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
        if (!args[3]->IsFunction())
            return throwTypeError(0, args.GetIsolate());
        errorCallback = V8SQLTransactionErrorCallback::create(args[3], getScriptExecutionContext());
    }
    RefPtr<VoidCallback> successCallback;
    if (args.Length() > 4 && !args[4]->IsNull() && !args[4]->IsUndefined()) {
        if (!args[4]->IsFunction())
            return throwTypeError(0, args.GetIsolate());
        successCallback = V8VoidCallback::create(args[4], getScriptExecutionContext());
    }
    imp->changeVersion(oldVersion, newVersion, callback, errorCallback, successCallback);
    return v8Undefined();
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:28,代码来源:V8Database.cpp

示例2: V8TestNamedConstructorConstructorCallback

static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.TestNamedConstructor.Constructor");
    
    if (!args.IsConstructCall())
        return throwTypeError("DOM object constructor cannot be called as a function.");

    if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
        return args.Holder();
    Document* document = currentDocument(BindingState::instance());

    // Make sure the document is added to the DOM Node map. Otherwise, the TestNamedConstructor instance
    // may end up being the only node in the map and get garbage-collected prematurely.
    toV8(document, args.Holder(), args.GetIsolate());

    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());

    ExceptionCode ec = 0;
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str1, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str2, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str3, MAYBE_MISSING_PARAMETER(args, 2, DefaultIsNullString));

    RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstructor(document, str1, str2, str3, ec);
    v8::Handle<v8::Object> wrapper = args.Holder();
    if (ec)
        goto fail;

    V8DOMWrapper::createDOMWrapper(impl.release(), &V8TestNamedConstructorConstructor::info, wrapper, args.GetIsolate());
    return wrapper;
  fail:
    return setDOMException(ec, args.GetIsolate());
}
开发者ID:kcomkar,项目名称:webkit,代码行数:33,代码来源:V8TestNamedConstructor.cpp

示例3: setDataCallback

static v8::Handle<v8::Value> setDataCallback(const v8::Arguments& args)
{
    if (args.Length() < 2)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    Clipboard* imp = V8Clipboard::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, data, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    return v8Boolean(imp->setData(type, data), args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:9,代码来源:V8Clipboard.cpp

示例4: webkitGetEntriesByNameCallback

static v8::Handle<v8::Value> webkitGetEntriesByNameCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    Performance* imp = V8Performance::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, entryType, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsNullString));
    return toV8(imp->webkitGetEntriesByName(name, entryType), args.Holder(), args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:9,代码来源:V8Performance.cpp

示例5: appendCallback

static v8::Handle<v8::Value> appendCallback(const v8::Arguments& args)
{
    if (args.Length() < 2)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    InspectorFrontendHost* imp = V8InspectorFrontendHost::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, url, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, content, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    imp->append(url, content);
    return v8Undefined();
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:10,代码来源:V8InspectorFrontendHost.cpp

示例6: initMutationEventCallback

static v8::Handle<v8::Value> initMutationEventCallback(const v8::Arguments& args)
{
    MutationEvent* imp = V8MutationEvent::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, type, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH(bool, canBubble, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->BooleanValue());
    V8TRYCATCH(bool, cancelable, MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)->BooleanValue());
    V8TRYCATCH(Node*, relatedNode, V8Node::HasInstance(MAYBE_MISSING_PARAMETER(args, 3, DefaultIsUndefined)) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 3, DefaultIsUndefined))) : 0);
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, prevValue, MAYBE_MISSING_PARAMETER(args, 4, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, newValue, MAYBE_MISSING_PARAMETER(args, 5, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, attrName, MAYBE_MISSING_PARAMETER(args, 6, DefaultIsUndefined));
    V8TRYCATCH(int, attrChange, toUInt32(MAYBE_MISSING_PARAMETER(args, 7, DefaultIsUndefined)));
    imp->initMutationEvent(type, canBubble, cancelable, relatedNode, prevValue, newValue, attrName, attrChange);
    return v8Undefined();
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:14,代码来源:V8MutationEvent.cpp

示例7: V8TRYCATCH_FOR_V8STRINGRESOURCE

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

    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithUndefinedOrNullCheck>, title, args[1]);
    V8TRYCATCH_FOR_V8STRINGRESOURCE(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());
    return setDOMException(ec, args.GetIsolate());
}
开发者ID:fmalita,项目名称:webkit,代码行数:16,代码来源:V8HistoryCustom.cpp

示例8: webkitClearMeasuresCallback

static v8::Handle<v8::Value> webkitClearMeasuresCallback(const v8::Arguments& args)
{
    Performance* imp = V8Performance::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, measureName, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsNullString));
    imp->webkitClearMeasures(measureName);
    return v8Undefined();
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8Performance.cpp

示例9: readAsTextCallback

static v8::Handle<v8::Value> readAsTextCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    FileReaderSync* imp = V8FileReaderSync::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    V8TRYCATCH(Blob*, blob, V8Blob::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8Blob::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
    if (args.Length() <= 1) {
        ScriptExecutionContext* scriptContext = getScriptExecutionContext();
        String result = imp->readAsText(scriptContext, blob, ec);
        if (UNLIKELY(ec))
            goto fail;
        return v8String(result, args.GetIsolate());
    }
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, encoding, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    ScriptExecutionContext* scriptContext = getScriptExecutionContext();
    String result = imp->readAsText(scriptContext, blob, encoding, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8String(result, args.GetIsolate());
    }
    fail:
    return setDOMException(ec, args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:25,代码来源:V8FileReaderSync.cpp

示例10: setRGBColorICCColorCallback

static v8::Handle<v8::Value> setRGBColorICCColorCallback(const v8::Arguments& args)
{
    if (args.Length() < 2)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    SVGColor* imp = V8SVGColor::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, rgbColor, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, iccColor, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    imp->setRGBColorICCColor(rgbColor, iccColor, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8Undefined();
    }
    fail:
    return setDOMException(ec, args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:17,代码来源:V8SVGColor.cpp

示例11: namedItemCallback

static v8::Handle<v8::Value> namedItemCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    DOMNamedFlowCollection* imp = V8DOMNamedFlowCollection::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return toV8(imp->namedItem(name), args.Holder(), args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:8,代码来源:V8DOMNamedFlowCollection.cpp

示例12: unregisterProtocolHandlerCallback

static v8::Handle<v8::Value> unregisterProtocolHandlerCallback(const v8::Arguments& args)
{
    if (args.Length() < 2)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    Navigator* imp = V8Navigator::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, scheme, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, url, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined));
    NavigatorContentUtils::unregisterProtocolHandler(imp, scheme, url, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8Undefined();
    }
    fail:
    return setDOMException(ec, args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:17,代码来源:V8Navigator.cpp

示例13: localizeNumberStringCallback

static v8::Handle<v8::Value> localizeNumberStringCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    PagePopupController* imp = V8PagePopupController::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, numberString, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return v8String(imp->localizeNumberString(numberString), args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:8,代码来源:V8PagePopupController.cpp

示例14: webkitMeasureCallback

static v8::Handle<v8::Value> webkitMeasureCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    Performance* imp = V8Performance::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, measureName, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, startMark, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsNullString));
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, endMark, MAYBE_MISSING_PARAMETER(args, 2, DefaultIsNullString));
    imp->webkitMeasure(measureName, startMark, endMark, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8Undefined();
    }
    fail:
    return setDOMException(ec, args.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:18,代码来源:V8Performance.cpp

示例15: setCustomValidityCallback

static v8::Handle<v8::Value> setCustomValidityCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithUndefinedOrNullCheck>, error, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    imp->setCustomValidity(error);
    return v8Undefined();
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:9,代码来源:V8HTMLButtonElement.cpp


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