| Index: Source/WebCore/Modules/indexeddb/IDBCursor.cpp
|
| ===================================================================
|
| --- Source/WebCore/Modules/indexeddb/IDBCursor.cpp (revision 132816)
|
| +++ Source/WebCore/Modules/indexeddb/IDBCursor.cpp (working copy)
|
| @@ -38,6 +38,7 @@
|
| #include "IDBTracing.h"
|
| #include "IDBTransaction.h"
|
| #include "ScriptExecutionContext.h"
|
| +#include "SerializedScriptValue.h"
|
|
|
| namespace WebCore {
|
|
|
| @@ -261,25 +262,28 @@
|
| m_request.clear();
|
| }
|
|
|
| -void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, ScriptValue& value)
|
| +void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> prpValue)
|
| {
|
| m_currentKey = key;
|
| m_currentPrimaryKey = primaryKey;
|
|
|
| + RefPtr<SerializedScriptValue> value = prpValue;
|
| if (!isKeyCursor()) {
|
| RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
|
| const IDBObjectStoreMetadata metadata = objectStore->metadata();
|
| if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
|
| #ifndef NDEBUG
|
| - RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(value, metadata.keyPath);
|
| + RefPtr<IDBKey> expectedKey = createIDBKeyFromSerializedValueAndKeyPath(value, metadata.keyPath);
|
| ASSERT(!expectedKey || expectedKey->isEqual(m_currentPrimaryKey.get()));
|
| #endif
|
| - bool injected = injectIDBKeyIntoScriptValue(m_currentPrimaryKey, value, metadata.keyPath);
|
| + RefPtr<SerializedScriptValue> valueAfterInjection = injectIDBKeyIntoSerializedValue(m_currentPrimaryKey, value, metadata.keyPath);
|
| + ASSERT(valueAfterInjection);
|
| // FIXME: There is no way to report errors here. Move this into onSuccessWithContinuation so that we can abort the transaction there. See: https://bugs.webkit.org/show_bug.cgi?id=92278
|
| - ASSERT_UNUSED(injected, injected);
|
| + if (valueAfterInjection)
|
| + value = valueAfterInjection;
|
| }
|
| }
|
| - m_currentValue = IDBAny::create(value);
|
| + m_currentValue = IDBAny::create(value.release());
|
|
|
| m_gotValue = true;
|
| m_valueIsDirty = true;
|
|
|