void IDBRequest::onSuccess(PassRefPtr<IDBKey> idbKey) { IDB_TRACE("IDBRequest::onSuccess(IDBKey)"); if (!shouldEnqueueEvent()) return; if (idbKey && idbKey->isValid()) onSuccessInternal(IDBAny::create(idbKey)); else onSuccessInternal(IDBAny::createUndefined()); }
void IDBRequest::onSuccess(int64_t value) { IDB_TRACE("IDBRequest::onSuccess(int64_t)"); if (!shouldEnqueueEvent()) return; return onSuccessInternal(SerializedScriptValue::numberValue(value)); }
void LegacyRequest::onSuccess(int64_t value) { LOG(StorageAPI, "LegacyRequest::onSuccess(int64_t)"); if (!shouldEnqueueEvent()) return; return onSuccessInternal(SerializedScriptValue::numberValue(value)); }
void LegacyRequest::onSuccess() { LOG(StorageAPI, "LegacyRequest::onSuccess()"); if (!shouldEnqueueEvent()) return; return onSuccessInternal(SerializedScriptValue::undefinedValue()); }
void IDBRequest::onSuccess(int64_t value) { IDB_TRACE("IDBRequest::onSuccess(int64_t)"); if (!shouldEnqueueEvent()) return; onSuccessInternal(IDBAny::create(value)); }
void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> prpSerializedScriptValue, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath) { IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue, IDBKey, IDBKeyPath)"); if (!shouldEnqueueEvent()) return; #if USE(V8) v8::HandleScope handleScope; v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle); if (context.IsEmpty()) CRASH(); v8::Context::Scope contextScope(context); #endif #ifndef NDEBUG ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath()); #endif ScriptValue value = deserializeIDBValue(scriptExecutionContext(), prpSerializedScriptValue); RefPtr<IDBKey> primaryKey = prpPrimaryKey; #ifndef NDEBUG RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(value, keyPath); ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get())); #endif bool injected = injectIDBKeyIntoScriptValue(primaryKey, value, keyPath); ASSERT_UNUSED(injected, injected); onSuccessInternal(value); }
void IDBRequest::onSuccess() { IDB_TRACE("IDBRequest::onSuccess()"); if (!shouldEnqueueEvent()) return; onSuccessInternal(IDBAny::createUndefined()); }
void IDBRequest::onSuccess(PassRefPtr<IDBValue> prpValue) { IDB_TRACE("IDBRequest::onSuccess(IDBValue)"); if (!shouldEnqueueEvent()) return; RefPtr<IDBValue> value(prpValue); ackReceivedBlobs(value.get()); if (m_pendingCursor) { // Value should be null, signifying the end of the cursor's range. ASSERT(value->isNull()); ASSERT(!value->blobInfo()->size()); m_pendingCursor->close(); m_pendingCursor.clear(); } #if ENABLE(ASSERT) if (value->primaryKey()) { ASSERT(value->keyPath() == effectiveObjectStore(m_source)->metadata().keyPath); assertPrimaryKeyValidOrInjectable(m_scriptState.get(), value.get()); } #endif onSuccessInternal(IDBAny::create(value.release())); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath) { LOG(StorageAPI, "IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); if (!shouldEnqueueEvent()) return; #ifndef NDEBUG ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath()); #endif DOMRequestState::Scope scope(m_requestState); // FIXME: By not knowing whether or not the key is defined here, we don't know // if a null valueBuffer means the value is null or the value is undefined. Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true); RefPtr<IDBKey> primaryKey = prpPrimaryKey; if (!keyPath.isNull()) { #ifndef NDEBUG RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState()->exec(), value, keyPath); ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get())); #endif bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath); ASSERT_UNUSED(injected, injected); } onSuccessInternal(value); }
void IDBRequest::onSuccess() { IDB_TRACE("IDBRequest::onSuccess()"); if (!shouldEnqueueEvent()) return; return onSuccessInternal(SerializedScriptValue::undefinedValue()); }
void IDBRequest::onSuccess(const Vector<RefPtr<IDBValue>>& values) { IDB_TRACE("IDBRequest::onSuccess([IDBValue])"); if (!shouldEnqueueEvent()) return; ackReceivedBlobs(values); onSuccessInternal(IDBAny::create(values)); }
void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue)"); if (!shouldEnqueueEvent()) return; ScriptValue value = deserializeIDBValue(scriptExecutionContext(), serializedScriptValue); onSuccessInternal(value); }
void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value) { ASSERT(m_readyState == PENDING); m_cursorKey = key; m_cursorPrimaryKey = primaryKey; m_cursorValue = value; onSuccessInternal(IDBAny::create(cursor)); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer) { IDB_TRACE("IDBRequest::onSuccess(SharedBuffer)"); if (!shouldEnqueueEvent()) return; DOMRequestState::Scope scope(m_requestState); ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer); onSuccessInternal(value); }
void IDBRequest::setResultCursor(IDBCursor* cursor, IDBKey* key, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<WebBlobInfo> > blobInfo) { ASSERT(m_readyState == PENDING); m_cursorKey = key; m_cursorPrimaryKey = primaryKey; m_cursorValue = value; setBlobInfo(blobInfo); onSuccessInternal(IDBAny::create(cursor)); }
void IDBRequest::setResultCursor(IDBCursor* cursor, IDBKey* key, IDBKey* primaryKey, PassRefPtr<IDBValue> value) { ASSERT(m_readyState == PENDING); m_cursorKey = key; m_cursorPrimaryKey = primaryKey; m_cursorValue = value; ackReceivedBlobs(m_cursorValue.get()); onSuccessInternal(IDBAny::create(cursor)); }
void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue)"); if (!shouldEnqueueEvent()) return; DOMRequestState::Scope scope(m_requestState); ScriptValue value = deserializeIDBValue(requestState(), serializedScriptValue); onSuccessInternal(value); }
void IDBRequest::onSuccess(const Vector<String>& stringList) { IDB_TRACE("IDBRequest::onSuccess(StringList)"); if (!shouldEnqueueEvent()) return; RefPtr<DOMStringList> domStringList = DOMStringList::create(); for (size_t i = 0; i < stringList.size(); ++i) domStringList->append(stringList[i]); onSuccessInternal(IDBAny::create(domStringList.release())); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer) { LOG(StorageAPI, "IDBRequest::onSuccess(SharedBuffer)"); if (!shouldEnqueueEvent()) return; DOMRequestState::Scope scope(m_requestState); // FIXME: By not knowing whether or not the key is defined here, we don't know // if a null valueBuffer means the value is null or the value is undefined. Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true); onSuccessInternal(value); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer) { IDB_TRACE("IDBRequest::onSuccess(SharedBuffer)"); if (!shouldEnqueueEvent()) return; if (m_pendingCursor) { // Value should be null, signifying the end of the cursor's range. ASSERT(!valueBuffer.get()); m_pendingCursor->close(); m_pendingCursor.clear(); } onSuccessInternal(IDBAny::create(valueBuffer)); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassOwnPtr<Vector<WebBlobInfo> > blobInfo) { IDB_TRACE("IDBRequest::onSuccess(SharedBuffer)"); if (!shouldEnqueueEvent()) return; if (m_pendingCursor) { // Value should be null, signifying the end of the cursor's range. ASSERT(!valueBuffer.get()); ASSERT(!blobInfo->size()); m_pendingCursor->close(); m_pendingCursor.clear(); } setBlobInfo(blobInfo); onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get())); }
void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue)"); if (!shouldEnqueueEvent()) return; #if USE(V8) v8::HandleScope handleScope; v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle); if (context.IsEmpty()) CRASH(); v8::Context::Scope contextScope(context); #endif ScriptValue value = deserializeIDBValue(scriptExecutionContext(), serializedScriptValue); onSuccessInternal(value); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassOwnPtr<Vector<WebBlobInfo> > blobInfo, IDBKey* prpPrimaryKey, const IDBKeyPath& keyPath) { IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); if (!shouldEnqueueEvent()) return; ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath); RefPtr<SharedBuffer> valueBuffer = prpValueBuffer; IDBKey* primaryKey = prpPrimaryKey; setBlobInfo(blobInfo); #if ENABLE(ASSERT) assertPrimaryKeyValidOrInjectable(m_scriptState.get(), valueBuffer, m_blobInfo.get(), primaryKey, keyPath); #endif onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get(), primaryKey, keyPath)); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath) { IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); if (!shouldEnqueueEvent()) return; #ifndef NDEBUG ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath); #endif RefPtr<SharedBuffer> valueBuffer = prpValueBuffer; RefPtr<IDBKey> primaryKey = prpPrimaryKey; #ifndef NDEBUG assertPrimaryKeyValidOrInjectable(&m_requestState, valueBuffer, primaryKey, keyPath); #endif onSuccessInternal(IDBAny::create(valueBuffer, primaryKey, keyPath)); }
void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> prpSerializedScriptValue, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath) { IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue, IDBKey, IDBKeyPath)"); if (!shouldEnqueueEvent()) return; #ifndef NDEBUG ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath()); #endif ScriptValue value = deserializeIDBValue(scriptExecutionContext(), prpSerializedScriptValue); RefPtr<IDBKey> primaryKey = prpPrimaryKey; #ifndef NDEBUG RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(value, keyPath); ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get())); #endif bool injected = injectIDBKeyIntoScriptValue(primaryKey, value, keyPath); ASSERT_UNUSED(injected, injected); onSuccessInternal(value); }
void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath) { IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); if (!shouldEnqueueEvent()) return; #ifndef NDEBUG ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath()); #endif DOMRequestState::Scope scope(m_requestState); ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer); RefPtr<IDBKey> primaryKey = prpPrimaryKey; #ifndef NDEBUG RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState(), value, keyPath); ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get())); #endif bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath); ASSERT_UNUSED(injected, injected); onSuccessInternal(value); }
void IDBRequest::onSuccessInternal(PassRefPtr<SerializedScriptValue> value) { ASSERT(!m_contextStopped); DOMRequestState::Scope scope(m_requestState); return onSuccessInternal(deserializeIDBValue(requestState(), value)); }