Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: Source/WebCore/Modules/indexeddb/IDBCursor.cpp

Issue 11348011: Revert 128789 - IndexedDB: Use ScriptValue instead of SerializedScriptValue for get/openCursor (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/Modules/indexeddb/IDBCursor.h ('k') | Source/WebCore/Modules/indexeddb/IDBDatabase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/WebCore/Modules/indexeddb/IDBCursor.h ('k') | Source/WebCore/Modules/indexeddb/IDBDatabase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698