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


C++ JSIDBDatabase::impl方法代码示例

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


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

示例1: isReachableFromOpaqueRoots

bool JSIDBDatabaseOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSIDBDatabase* jsIDBDatabase = jsCast<JSIDBDatabase*>(handle.get().asCell());
    if (jsIDBDatabase->impl().hasPendingActivity())
        return true;
    if (jsIDBDatabase->impl().isFiringEventListeners())
        return true;
    UNUSED_PARAM(visitor);
    return false;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例2: finalize

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

示例3: throwVMTypeError

static EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionTransaction2(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;
    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    if (!scriptContext)
        return JSValue::encode(jsUndefined());
    Vector<String> storeNames(toNativeArray<String>(exec, exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& mode(argumentOrNull(exec, 1).isEmpty() ? String() : argumentOrNull(exec, 1).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

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

示例4: setJSIDBDatabaseOnversionchange

void setJSIDBDatabaseOnversionchange(ExecState* exec, JSObject* thisObject, JSValue value)
{
    UNUSED_PARAM(exec);
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(thisObject);
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    imp->setOnversionchange(createJSAttributeEventListener(exec, value, thisObject));
}
开发者ID:13W,项目名称:phantomjs,代码行数:7,代码来源:JSIDBDatabase.cpp

示例5: jsIDBDatabasePrototypeFunctionCreateObjectStore

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionCreateObjectStore(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());

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

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

    OptionsObject* options(toOptionsObject(exec->argument(1)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


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

示例6: jsIDBDatabaseVersion

JSValue jsIDBDatabaseVersion(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    JSValue result = jsString(exec, imp->version());
    return result;
}
开发者ID:13W,项目名称:phantomjs,代码行数:8,代码来源:JSIDBDatabase.cpp

示例7: jsIDBDatabaseObjectStoreNames

JSValue jsIDBDatabaseObjectStoreNames(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSIDBDatabase* castedThis = static_cast<JSIDBDatabase*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    IDBDatabase* imp = static_cast<IDBDatabase*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objectStoreNames()));
    return result;
}
开发者ID:13W,项目名称:phantomjs,代码行数:8,代码来源:JSIDBDatabase.cpp

示例8: visitChildren

void JSIDBDatabase::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
    JSIDBDatabase* thisObject = jsCast<JSIDBDatabase*>(cell);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
    Base::visitChildren(thisObject, visitor);
    thisObject->impl().visitJSEventListeners(visitor);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例9: isReachableFromOpaqueRoots

bool JSIDBDatabaseOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSIDBDatabase* jsIDBDatabase = static_cast<JSIDBDatabase*>(handle.get().asCell());
    if (jsIDBDatabase->impl()->hasPendingActivity())
        return true;
    if (!isObservable(jsIDBDatabase))
        return false;
    UNUSED_PARAM(visitor);
    return false;
}
开发者ID:13W,项目名称:phantomjs,代码行数:10,代码来源:JSIDBDatabase.cpp

示例10: jsIDBDatabasePrototypeFunctionClose

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionClose(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());

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

示例11: jsIDBDatabaseVersion

EncodedJSValue jsIDBDatabaseVersion(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();
    JSValue result = jsNumber(impl.version());
    return JSValue::encode(result);
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例12: jsIDBDatabaseObjectStoreNames

EncodedJSValue jsIDBDatabaseObjectStoreNames(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();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.objectStoreNames()));
    return JSValue::encode(result);
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例13: jsIDBDatabasePrototypeFunctionClose

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionClose(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();
    impl.close();
    return JSValue::encode(jsUndefined());
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例14: jsIDBDatabasePrototypeFunctionRemoveEventListener

EncodedJSValue JSC_HOST_CALL jsIDBDatabasePrototypeFunctionRemoveEventListener(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());
    JSValue listener = exec->argument(1);
    if (!listener.isObject())
        return JSValue::encode(jsUndefined());
    imp->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
    return JSValue::encode(jsUndefined());
}
开发者ID:13W,项目名称:phantomjs,代码行数:13,代码来源:JSIDBDatabase.cpp

示例15: setJSIDBDatabaseOnversionchange

void setJSIDBDatabaseOnversionchange(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSIDBDatabase* castedThis = jsDynamicCast<JSIDBDatabase*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    UNUSED_PARAM(exec);
    IDBDatabase& impl = castedThis->impl();
    impl.setOnversionchange(createJSAttributeEventListener(exec, value, castedThis));
}
开发者ID:,项目名称:,代码行数:13,代码来源:


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