Esempio n. 1
0
void WebIDBCursorImpl::value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const
{
    // Verify we're starting off with blank slates.
    ASSERT(serializedScriptValue.isNull());
    ASSERT(idbKey.type() == WebIDBKey::InvalidType);

    RefPtr<IDBAny> any = m_idbCursorBackend->value();
    if (any->type() == IDBAny::SerializedScriptValueType)
        serializedScriptValue.assign(any->serializedScriptValue());
    else if (any->type() == IDBAny::IDBKeyType)
        idbKey.assign(any->idbKey());
    else
        ASSERT_NOT_REACHED();
}
Esempio n. 2
0
void TestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result)
{
    if (arguments.size() <  3)
        return;

    v8::HandleScope scope;
    v8::Local<v8::Context> ctx = m_webView->mainFrame()->mainWorldScriptContext();
    result->set(m_webView->mainFrame()->selectionAsMarkup().utf8());
    v8::Context::Scope cscope(ctx);

    WebString action = cppVariantToWebString(arguments[0]);
    WebString type = cppVariantToWebString(arguments[1]);
    WebCString data = cppVariantToWebString(arguments[2]).utf8();
    WebSerializedScriptValue serializedData = WebSerializedScriptValue::serialize(v8::String::New(data.data(), data.length()));

    WebIntent intent = WebIntent::create(action, type, serializedData.toString(), WebVector<WebString>(), WebVector<WebString>());

    m_webView->mainFrame()->deliverIntent(intent, 0, m_intentClient.get());
}
Esempio n. 3
0
WebIDBKey WebIDBKey::createFromValueAndKeyPath(const WebSerializedScriptValue& serializedScriptValue, const WebIDBKeyPath& idbKeyPath)
{
    if (serializedScriptValue.isNull())
        return WebIDBKey::createInvalid();
    return createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath);
}