IDB: Index cursors use wrong deserialization for the retrieved value The values stored in the index are encoded IDBKeys, and not encoded ScriptValues. Fixing the (de)serialization confusion throughout the IDB mechanism will be a long, iterative process. For now, we'll change the cursor operation callbacks to include a "value key" instead of the value buffer, and the IDB front end will choose the appropriate one to use as the result value.
Created attachment 222871 [details] Patch v1
Attachment 222871 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp:157: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:259: Non-label code inside switch statements should be indented. [whitespace/indent] [4] ERROR: Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp:43: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp:66: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 4 in 28 files If any of these errors are false positives, please file a bug against check-webkit-style.
(In reply to comment #2) > Attachment 222871 [details] did not pass style-queue: > ERROR: Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:259: Non-label code inside switch statements should be indented. [whitespace/indent] [4] Fixed that locally. The other 3 are the long standing (and reported!) bug of check-webkit-style not liking our C++ lambda style.
Comment on attachment 222871 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=222871&action=review > Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp:106 > + m_currentValueBuffer = 0; > + m_currentValueKey = 0; nullptr, not 0 > Source/WebCore/Modules/indexeddb/IDBCursorBackend.h:63 > + SharedBuffer* valueBuffer() const { return (m_cursorType == IndexedDB::CursorType::KeyOnly) ? 0 : m_currentValueBuffer.get(); } > + IDBKey* valueKey() const { return (m_cursorType == IndexedDB::CursorType::KeyOnly) ? 0 : m_currentValueKey.get(); } Ditto > Source/WebCore/Modules/indexeddb/IDBKeyData.cpp:267 > + String result = "<array> - { "; > + for (size_t i = 0; i < arrayValue.size(); ++i) { > + result.append(arrayValue[i].loggingString()); > + if (i < arrayValue.size() - 1) > + result.append(", "); > + } > + result.append(" }"); > + return result; There’s probably a more efficient way to do this using StringBuilder, but this is good enough for debug-only logging.
http://trac.webkit.org/changeset/163234
Release build fix landed in http://trac.webkit.org/changeset/163235.
(In reply to comment #6) > Release build fix landed in http://trac.webkit.org/changeset/163235. DOH! Sorry about that, and thanks for the fix!