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


C++ JSIDBDatabase类代码示例

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


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

示例1: jsIDBDatabasePrototypeFunctionDeleteObjectStore

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionDeleteObjectStore(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSIDBDatabase::s_info))
        return throwVMTypeError(exec);
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(asObject(thisValue));
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    ExceptionCode ec = 0;
    const String& name(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->deleteObjectStore(name, ec);
    setDOMException(exec, ec);
    return JSValue::encode(jsUndefined());
}
开发者ID:13W,项目名称:phantomjs,代码行数:16,代码来源:JSIDBDatabase.cpp

示例2: jsIDBDatabaseOnversionchange

EncodedJSValue jsIDBDatabaseOnversionchange(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSIDBDatabase* castedThis = jsDynamicCast<JSIDBDatabase*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    IDBDatabase& impl = castedThis->impl();
    if (EventListener* listener = impl.onversionchange()) {
        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {
            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))
                return JSValue::encode(jsFunction);
        }
    }
    return JSValue::encode(jsNull());
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例3: jsIDBDatabasePrototypeFunctionDispatchEvent

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionDispatchEvent(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSIDBDatabase::s_info))
        return throwVMTypeError(exec);
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(asObject(thisValue));
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    ExceptionCode ec = 0;
    Event* evt(toEvent(exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = jsBoolean(imp->dispatchEvent(evt, ec));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
开发者ID:13W,项目名称:phantomjs,代码行数:17,代码来源:JSIDBDatabase.cpp

示例4: jsIDBDatabasePrototypeFunctionDeleteObjectStore

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionDeleteObjectStore(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSIDBDatabase* castedThis = jsDynamicCast<JSIDBDatabase*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSIDBDatabase::info());
    IDBDatabase& impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    ExceptionCode ec = 0;
    const String& name(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl.deleteObjectStore(name, ec);
    setDOMException(exec, ec);
    return JSValue::encode(jsUndefined());
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例5: jsIDBDatabasePrototypeFunctionSetVersion

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionSetVersion(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSIDBDatabase::s_info))
        return throwVMTypeError(exec);
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(asObject(thisValue));
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    ExceptionCode ec = 0;
    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    if (!scriptContext)
        return JSValue::encode(jsUndefined());
    const String& version(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->setVersion(scriptContext, version, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
开发者ID:13W,项目名称:phantomjs,代码行数:20,代码来源:JSIDBDatabase.cpp

示例6: jsIDBDatabasePrototypeFunctionTransaction

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionTransaction(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSIDBDatabase::s_info))
        return throwVMTypeError(exec);
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(asObject(thisValue));
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    ExceptionCode ec = 0;
    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    if (!scriptContext)
        return JSValue::encode(jsUndefined());

    int argsCount = exec->argumentCount();
    if (argsCount <= 0) {

        JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->transaction(scriptContext, ec)));
        setDOMException(exec, ec);
        return JSValue::encode(result);
    }

    DOMStringList* storeNames(toDOMStringList(exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    if (argsCount <= 1) {

        JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->transaction(scriptContext, storeNames, ec)));
        setDOMException(exec, ec);
        return JSValue::encode(result);
    }

    unsigned short mode(exec->argument(1).toUInt32(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->transaction(scriptContext, storeNames, mode, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
开发者ID:13W,项目名称:phantomjs,代码行数:39,代码来源:JSIDBDatabase.cpp

示例7: finalize

void JSIDBDatabaseOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSIDBDatabase* jsIDBDatabase = static_cast<JSIDBDatabase*>(handle.get().asCell());
    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, jsIDBDatabase->impl(), jsIDBDatabase);
}
开发者ID:13W,项目名称:phantomjs,代码行数:6,代码来源:JSIDBDatabase.cpp

示例8: jsIDBDatabaseConstructor

JSValue jsIDBDatabaseConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSIDBDatabase* domObject = static_cast<JSIDBDatabase*>(asObject(slotBase));
    return JSIDBDatabase::getConstructor(exec, domObject->globalObject());
}
开发者ID:13W,项目名称:phantomjs,代码行数:5,代码来源:JSIDBDatabase.cpp


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