<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163234] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163234">163234</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2014-01-31 21:01:15 -0800 (Fri, 31 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>IDB: Index cursors use wrong deserialization for the retrieved value
https://bugs.webkit.org/show_bug.cgi?id=128035

Reviewed by Dan Bernstein.

Source/WebCore:

For the cursor operations, add an IDBKey value result in the callbacks.
If an already deserialized IDBKey value exists it will be preferred over the serialized buffer.

Change some of the onSuccess() callback formats:
* Modules/indexeddb/IDBCallbacks.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onSuccess): Selectively choose between the IDBKey or the SharedBuffer value
  when choosed what to convert to the ScriptValue.
* Modules/indexeddb/IDBRequest.h:

Let the IDBCursorBackend hold both a value buffer and a value key:
* Modules/indexeddb/IDBCursorBackend.cpp:
(WebCore::IDBCursorBackend::updateCursorData):
(WebCore::IDBCursorBackend::clear):
* Modules/indexeddb/IDBCursorBackend.h:
(WebCore::IDBCursorBackend::valueBuffer):
(WebCore::IDBCursorBackend::valueKey):

* Modules/indexeddb/IDBCursorBackendOperations.cpp:
(WebCore::CursorAdvanceOperation::perform):
(WebCore::CursorIterationOperation::perform):

* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::OpenCursorOperation::perform):

* Modules/indexeddb/IDBServerConnection.h:
* Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp:
(WebCore::IDBServerConnectionLevelDB::openCursor):
(WebCore::IDBServerConnectionLevelDB::cursorAdvance):
(WebCore::IDBServerConnectionLevelDB::cursorIterate):
* Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h:

Add IDBKey/IDBKeyData debug logging utilities:
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::loggingString):
* Modules/indexeddb/IDBKey.h:
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString):
* Modules/indexeddb/IDBKeyData.h:

* WebCore.exp.in:

Source/WebKit2:

Most of this is updating everything related to the cursor operation callbacks
to support returning an IDBKey value in addition to a SharedBuffer value.

* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::openCursor):
(WebKit::DatabaseProcessIDBConnection::cursorAdvance):
(WebKit::DatabaseProcessIDBConnection::cursorIterate):

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::openCursor):
(WebKit::UniqueIDBDatabase::cursorAdvance):
(WebKit::UniqueIDBDatabase::cursorIterate):
(WebKit::UniqueIDBDatabase::openCursorInBackingStore):
(WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore):
(WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
(WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore):
(WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):
(WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::iterateCursor):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
(WebKit::SQLiteIDBCursor::advance):
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
(WebKit::SQLiteIDBCursor::currentValueBuffer):
(WebKit::SQLiteIDBCursor::currentValueKey):

* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::didOpenCursor):
(WebKit::WebIDBServerConnection::didAdvanceCursor):
(WebKit::WebIDBServerConnection::didIterateCursor):
(WebKit::WebIDBServerConnection::openCursor):
(WebKit::WebIDBServerConnection::cursorAdvance):
(WebKit::WebIDBServerConnection::cursorIterate):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCallbacksh">trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorBackendcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorBackendh">trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorBackendOperationscpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeycpp">trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyh">trunk/Source/WebCore/Modules/indexeddb/IDBKey.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyDatacpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyDatah">trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBServerConnectionh">trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionBackendOperationscpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbleveldbIDBServerConnectionLevelDBcpp">trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbleveldbIDBServerConnectionLevelDBh">trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectioncpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabasecpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseBackingStoreh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteSQLiteIDBCursorcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteSQLiteIDBCursorh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLitecpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLiteh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectioncpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionmessagesin">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/ChangeLog        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-01-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IDB: Index cursors use wrong deserialization for the retrieved value
+        https://bugs.webkit.org/show_bug.cgi?id=128035
+
+        Reviewed by Dan Bernstein.
+
+        For the cursor operations, add an IDBKey value result in the callbacks.
+        If an already deserialized IDBKey value exists it will be preferred over the serialized buffer.
+
+        Change some of the onSuccess() callback formats:
+        * Modules/indexeddb/IDBCallbacks.h:
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::onSuccess): Selectively choose between the IDBKey or the SharedBuffer value
+          when choosed what to convert to the ScriptValue.
+        * Modules/indexeddb/IDBRequest.h:
+
+        Let the IDBCursorBackend hold both a value buffer and a value key:
+        * Modules/indexeddb/IDBCursorBackend.cpp:
+        (WebCore::IDBCursorBackend::updateCursorData):
+        (WebCore::IDBCursorBackend::clear):
+        * Modules/indexeddb/IDBCursorBackend.h:
+        (WebCore::IDBCursorBackend::valueBuffer):
+        (WebCore::IDBCursorBackend::valueKey):
+
+        * Modules/indexeddb/IDBCursorBackendOperations.cpp:
+        (WebCore::CursorAdvanceOperation::perform):
+        (WebCore::CursorIterationOperation::perform):
+
+        * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
+        (WebCore::OpenCursorOperation::perform):
+
+        * Modules/indexeddb/IDBServerConnection.h:
+        * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp:
+        (WebCore::IDBServerConnectionLevelDB::openCursor):
+        (WebCore::IDBServerConnectionLevelDB::cursorAdvance):
+        (WebCore::IDBServerConnectionLevelDB::cursorIterate):
+        * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h:
+
+        Add IDBKey/IDBKeyData debug logging utilities:
+        * Modules/indexeddb/IDBKey.cpp:
+        (WebCore::IDBKey::loggingString):
+        * Modules/indexeddb/IDBKey.h:
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::loggingString):
+        * Modules/indexeddb/IDBKeyData.h:
+
+        * WebCore.exp.in:
+
</ins><span class="cx"> 2014-01-31  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Debug build fix after r163232. Call hasEditableStyle() instead of isContentEditable() which
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCallbacksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     // From IDBFactory.webkitGetDatabaseNames()
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;DOMStringList&gt;) = 0;
</span><span class="cx">     // From IDBObjectStore/IDBIndex.openCursor(), IDBIndex.openKeyCursor()
</span><del>-    virtual void onSuccess(PassRefPtr&lt;IDBCursorBackend&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt;) = 0;
</del><ins>+    virtual void onSuccess(PassRefPtr&lt;IDBCursorBackend&gt;) = 0;
</ins><span class="cx">     // From IDBObjectStore.add()/put(), IDBIndex.getKey()
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;IDBKey&gt;) = 0;
</span><span class="cx">     // From IDBObjectStore/IDBIndex.get()/count(), and various methods that yield null/undefined.
</span><span class="lines">@@ -67,6 +67,8 @@
</span><span class="cx"> 
</span><span class="cx">     // From IDBCursor.advance()/continue()
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt;) = 0;
</span><ins>+    virtual void onSuccess(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt; valueKey) = 0;
+
</ins><span class="cx">     // From IDBCursor.advance()/continue()
</span><span class="cx">     virtual void onSuccessWithPrefetch(const Vector&lt;RefPtr&lt;IDBKey&gt;&gt;&amp; keys, const Vector&lt;RefPtr&lt;IDBKey&gt;&gt;&amp; primaryKeys, const Vector&lt;RefPtr&lt;SharedBuffer&gt;&gt;&amp; values) = 0;
</span><span class="cx">     // From IDBFactory.open()/deleteDatabase()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -89,19 +89,21 @@
</span><span class="cx">     m_savedCursorID = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursorBackend::updateCursorData(IDBKey* key, IDBKey* primaryKey, SharedBuffer* value)
</del><ins>+void IDBCursorBackend::updateCursorData(IDBKey* key, IDBKey* primaryKey, SharedBuffer* valueBuffer, IDBKey* valueKey)
</ins><span class="cx"> {
</span><span class="cx">     m_currentKey = key;
</span><span class="cx">     m_currentPrimaryKey = primaryKey;
</span><del>-    m_currentValue = value;
</del><ins>+    m_currentValueBuffer = valueBuffer;
+    m_currentValueKey = valueKey;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBCursorBackend::clear()
</span><span class="cx"> {
</span><span class="cx">     m_cursorID = 0;
</span><del>-    m_currentKey = 0;
-    m_currentPrimaryKey = 0;
-    m_currentValue = 0;
</del><ins>+    m_currentKey = nullptr;
+    m_currentPrimaryKey = nullptr;
+    m_currentValueBuffer = nullptr;
+    m_currentValueKey = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackend.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -59,8 +59,9 @@
</span><span class="cx"> 
</span><span class="cx">     IDBKey* key() const { return m_currentKey.get(); }
</span><span class="cx">     IDBKey* primaryKey() const { return m_currentPrimaryKey.get(); }
</span><del>-    SharedBuffer* value() const { return (m_cursorType == IndexedDB::CursorType::KeyOnly) ? 0 : m_currentValue.get(); }
-    void updateCursorData(IDBKey*, IDBKey* primaryKey, SharedBuffer* value);
</del><ins>+    SharedBuffer* valueBuffer() const { return (m_cursorType == IndexedDB::CursorType::KeyOnly) ? nullptr : m_currentValueBuffer.get(); }
+    IDBKey* valueKey() const { return (m_cursorType == IndexedDB::CursorType::KeyOnly) ? nullptr : m_currentValueKey.get(); }
+    void updateCursorData(IDBKey*, IDBKey* primaryKey, SharedBuffer* valueBuffer, IDBKey* valueKey);
</ins><span class="cx"> 
</span><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="lines">@@ -86,7 +87,8 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBKey&gt; m_currentKey;
</span><span class="cx">     RefPtr&lt;IDBKey&gt; m_currentPrimaryKey;
</span><del>-    RefPtr&lt;SharedBuffer&gt; m_currentValue;
</del><ins>+    RefPtr&lt;SharedBuffer&gt; m_currentValueBuffer;
+    RefPtr&lt;IDBKey&gt; m_currentValueKey;
</ins><span class="cx"> 
</span><span class="cx">     bool m_closed;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorBackendOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -40,15 +40,15 @@
</span><span class="cx">     LOG(StorageAPI, &quot;CursorAdvanceOperation&quot;);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CursorAdvanceOperation&gt; operation(this);
</span><del>-    auto callback = [this, operation, completionCallback](PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, PassRefPtr&lt;IDBDatabaseError&gt; error) {
</del><ins>+    auto callback = [this, operation, completionCallback](PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; valueBuffer, PassRefPtr&lt;IDBKey&gt; valueKey, PassRefPtr&lt;IDBDatabaseError&gt; error) {
</ins><span class="cx">         if (error) {
</span><span class="cx">             m_cursor-&gt;clear();
</span><span class="cx">             // FIXME: The LevelDB backend calls onSuccess even on failure.
</span><span class="cx">             // This will probably have to change soon (for sanity) and will probably break LevelDB
</span><span class="cx">             m_callbacks-&gt;onSuccess(static_cast&lt;SharedBuffer*&gt;(0));
</span><span class="cx">         } else {
</span><del>-            m_cursor-&gt;updateCursorData(key.get(), primaryKey.get(), value.get());
-            m_callbacks-&gt;onSuccess(key, primaryKey, value);
</del><ins>+            m_cursor-&gt;updateCursorData(key.get(), primaryKey.get(), valueBuffer.get(), valueKey.get());
+            m_callbacks-&gt;onSuccess(key, primaryKey, valueBuffer, valueKey);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // FIXME: Cursor operations should be able to pass along an error instead of success
</span><span class="lines">@@ -63,15 +63,15 @@
</span><span class="cx">     LOG(StorageAPI, &quot;CursorIterationOperation&quot;);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CursorIterationOperation&gt; operation(this);
</span><del>-    auto callback = [this, operation, completionCallback](PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, PassRefPtr&lt;IDBDatabaseError&gt; error) {
</del><ins>+    auto callback = [this, operation, completionCallback](PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; valueBuffer, PassRefPtr&lt;IDBKey&gt; valueKey, PassRefPtr&lt;IDBDatabaseError&gt; error) {
</ins><span class="cx">         if (error) {
</span><span class="cx">             m_cursor-&gt;clear();
</span><span class="cx">             // FIXME: The LevelDB backend calls onSuccess even on failure.
</span><span class="cx">             // This will probably have to change soon (for sanity) and will probably break LevelDB
</span><span class="cx">             m_callbacks-&gt;onSuccess(static_cast&lt;SharedBuffer*&gt;(0));
</span><span class="cx">         } else {
</span><del>-            m_cursor-&gt;updateCursorData(key.get(), primaryKey.get(), value.get());
-            m_callbacks-&gt;onSuccess(key, primaryKey, value);
</del><ins>+            m_cursor-&gt;updateCursorData(key.get(), primaryKey.get(), valueBuffer.get(), valueKey.get());
+            m_callbacks-&gt;onSuccess(key, primaryKey, valueBuffer, valueKey);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // FIXME: Cursor operations should be able to pass along an error instead of success
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -98,6 +98,13 @@
</span><span class="cx">     return !compare(other);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+String IDBKey::loggingString() const
+{
+    return IDBKeyData(this).loggingString();
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -147,6 +147,10 @@
</span><span class="cx">     using RefCounted&lt;IDBKey&gt;::ref;
</span><span class="cx">     using RefCounted&lt;IDBKey&gt;::deref;
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+    String loggingString() const;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     IDBKey() : m_type(InvalidType), m_number(0), m_sizeEstimate(OverheadSize) { }
</span><span class="cx">     IDBKey(Type type, double number) : m_type(type), m_number(number), m_sizeEstimate(OverheadSize + sizeof(double)) { }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -246,6 +246,38 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+String IDBKeyData::loggingString() const
+{
+    if (isNull)
+        return &quot;&lt;null&gt;&quot;;
+
+    switch (type) {
+    case IDBKey::InvalidType:
+        return &quot;&lt;invalid&gt;&quot;;
+    case IDBKey::ArrayType:
+        {
+            String result = &quot;&lt;array&gt; - { &quot;;
+            for (size_t i = 0; i &lt; arrayValue.size(); ++i) {
+                result.append(arrayValue[i].loggingString());
+                if (i &lt; arrayValue.size() - 1)
+                    result.append(&quot;, &quot;);
+            }
+            result.append(&quot; }&quot;);
+            return result;
+        }
+    case IDBKey::StringType:
+        return String(&quot;&lt;string&gt; - &quot;) + stringValue;
+    case IDBKey::DateType:
+        return String::format(&quot;Date type - %f&quot;, numberValue);
+    case IDBKey::NumberType:
+        return String::format(&quot;&lt;number&gt; - %f&quot;, numberValue);
+    case IDBKey::MinType:
+        return &quot;&lt;minimum&gt;&quot;;
+    }
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -58,6 +58,10 @@
</span><span class="cx">     //   - Returns zero if this IDBKeyData is equal to other.
</span><span class="cx">     int compare(const IDBKeyData&amp; other);
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+    String loggingString() const;
+#endif
+
</ins><span class="cx">     IDBKey::Type type;
</span><span class="cx">     Vector&lt;IDBKeyData&gt; arrayValue;
</span><span class="cx">     String stringValue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -275,27 +275,38 @@
</span><span class="cx">     enqueueEvent(createSuccessEvent());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBRequest::onSuccess(PassRefPtr&lt;IDBCursorBackend&gt; backend, PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; buffer)
</del><ins>+void IDBRequest::onSuccess(PassRefPtr&lt;IDBCursorBackend&gt; prpBackend)
</ins><span class="cx"> {
</span><span class="cx">     LOG(StorageAPI, &quot;IDBRequest::onSuccess(IDBCursor)&quot;);
</span><span class="cx">     if (!shouldEnqueueEvent())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     DOMRequestState::Scope scope(m_requestState);
</span><del>-    Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), buffer);
</del><ins>+
+    RefPtr&lt;IDBCursorBackend&gt; backend = prpBackend;
+    RefPtr&lt;IDBKey&gt; key = backend-&gt;key();
+    RefPtr&lt;IDBKey&gt; primaryKey = backend-&gt;primaryKey();
+
+    Deprecated::ScriptValue value;
+
+    if (backend-&gt;valueKey())
+        value = idbKeyToScriptValue(requestState(), backend-&gt;valueKey());
+    else
+        value = deserializeIDBValueBuffer(requestState(), backend-&gt;valueBuffer());
+
</ins><span class="cx">     ASSERT(!m_pendingCursor);
</span><span class="cx">     RefPtr&lt;IDBCursor&gt; cursor;
</span><span class="cx">     switch (m_cursorType) {
</span><span class="cx">     case IndexedDB::CursorType::KeyOnly:
</span><del>-        cursor = IDBCursor::create(backend, m_cursorDirection, this, m_source.get(), m_transaction.get());
</del><ins>+        cursor = IDBCursor::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
</ins><span class="cx">         break;
</span><span class="cx">     case IndexedDB::CursorType::KeyAndValue:
</span><del>-        cursor = IDBCursorWithValue::create(backend, m_cursorDirection, this, m_source.get(), m_transaction.get());
</del><ins>+        cursor = IDBCursorWithValue::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><del>-    setResultCursor(cursor, key, primaryKey, value);
</del><ins>+    setResultCursor(cursor, key.release(), primaryKey.release(), value);
</ins><span class="cx"> 
</span><span class="cx">     enqueueEvent(createSuccessEvent());
</span><span class="cx"> }
</span><span class="lines">@@ -395,12 +406,23 @@
</span><span class="cx"> 
</span><span class="cx"> void IDBRequest::onSuccess(PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; buffer)
</span><span class="cx"> {
</span><del>-    LOG(StorageAPI, &quot;IDBRequest::onSuccess(key, primaryKey, value)&quot;);
</del><ins>+    onSuccess(key, primaryKey, buffer, nullptr);
+}
+
+void IDBRequest::onSuccess(PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; buffer, PassRefPtr&lt;IDBKey&gt; valueKey)
+{
+    LOG(StorageAPI, &quot;IDBRequest::onSuccess(key, primaryKey, valueBuffer, valueKey)&quot;);
</ins><span class="cx">     if (!shouldEnqueueEvent())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     DOMRequestState::Scope scope(m_requestState);
</span><del>-    Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), buffer);
</del><ins>+
+    Deprecated::ScriptValue value;
+    if (valueKey)
+        value = idbKeyToScriptValue(requestState(), valueKey);
+    else
+        value = deserializeIDBValueBuffer(requestState(), buffer);
+
</ins><span class="cx">     ASSERT(m_pendingCursor);
</span><span class="cx">     setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
</span><span class="cx">     enqueueEvent(createSuccessEvent());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -86,13 +86,14 @@
</span><span class="cx">     // IDBCallbacks
</span><span class="cx">     virtual void onError(PassRefPtr&lt;IDBDatabaseError&gt;);
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;DOMStringList&gt;);
</span><del>-    virtual void onSuccess(PassRefPtr&lt;IDBCursorBackend&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt;);
</del><ins>+    virtual void onSuccess(PassRefPtr&lt;IDBCursorBackend&gt;);
</ins><span class="cx">     virtual void onSuccess(PassRefPtr&lt;IDBKey&gt;);
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;SharedBuffer&gt;);
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, const IDBKeyPath&amp;);
</span><span class="cx">     virtual void onSuccess(int64_t);
</span><span class="cx">     virtual void onSuccess();
</span><span class="cx">     virtual void onSuccess(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt;);
</span><ins>+    virtual void onSuccess(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt; valueKey);
</ins><span class="cx">     virtual void onSuccessWithPrefetch(const Vector&lt;RefPtr&lt;IDBKey&gt;&gt;&amp;, const Vector&lt;RefPtr&lt;IDBKey&gt;&gt;&amp;, const Vector&lt;RefPtr&lt;SharedBuffer&gt;&gt;&amp;) { ASSERT_NOT_REACHED(); } // Not implemented. Callback should not reach the renderer side.
</span><span class="cx"> 
</span><span class="cx">     // ActiveDOMObject
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBServerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     virtual void deleteIndex(IDBTransactionBackend&amp;, const DeleteIndexOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><span class="cx">     virtual void get(IDBTransactionBackend&amp;, const GetOperation&amp;, std::function&lt;void(const IDBGetResult&amp;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><span class="cx">     virtual void put(IDBTransactionBackend&amp;, const PutOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><del>-    virtual void openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</del><ins>+    virtual void openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</ins><span class="cx">     virtual void count(IDBTransactionBackend&amp;, const CountOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><span class="cx">     virtual void deleteRange(IDBTransactionBackend&amp;, const DeleteRangeOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><span class="cx">     virtual void clearObjectStore(IDBTransactionBackend&amp;, const ClearObjectStoreOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><span class="lines">@@ -89,8 +89,8 @@
</span><span class="cx">     virtual void changeDatabaseVersion(IDBTransactionBackend&amp;, const IDBDatabaseBackend::VersionChangeOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</span><span class="cx"> 
</span><span class="cx">     // Cursor-level operations
</span><del>-    virtual void cursorAdvance(IDBCursorBackend&amp;, const CursorAdvanceOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
-    virtual void cursorIterate(IDBCursorBackend&amp;, const CursorIterationOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</del><ins>+    virtual void cursorAdvance(IDBCursorBackend&amp;, const CursorAdvanceOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
+    virtual void cursorIterate(IDBCursorBackend&amp;, const CursorIterationOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionBackendOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -154,17 +154,17 @@
</span><span class="cx">     LOG(StorageAPI, &quot;OpenCursorOperation&quot;);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;OpenCursorOperation&gt; operation(this);
</span><del>-    auto callback = [this, operation, completionCallback](int64_t cursorID, PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, PassRefPtr&lt;IDBDatabaseError&gt;) {
</del><ins>+    auto callback = [this, operation, completionCallback](int64_t cursorID, PassRefPtr&lt;IDBKey&gt; key, PassRefPtr&lt;IDBKey&gt; primaryKey, PassRefPtr&lt;SharedBuffer&gt; valueBuffer, PassRefPtr&lt;IDBKey&gt; valueKey, PassRefPtr&lt;IDBDatabaseError&gt;) {
</ins><span class="cx">         // FIXME: When the LevelDB port fails to open a backing store cursor it calls onSuccess(nullptr);
</span><span class="cx">         // This seems nonsensical and might have to change soon, breaking them.
</span><span class="cx">         if (!cursorID)
</span><span class="cx">             m_callbacks-&gt;onSuccess(static_cast&lt;SharedBuffer*&gt;(0));
</span><span class="cx">         else {
</span><span class="cx">             RefPtr&lt;IDBCursorBackend&gt; cursor = IDBCursorBackend::create(cursorID, m_cursorType, m_taskType, *m_transaction, m_objectStoreID);
</span><del>-            if (key || primaryKey || value)
-                cursor-&gt;updateCursorData(key.get(), primaryKey.get(), value.get());
</del><ins>+            if (key || primaryKey || valueBuffer || valueKey)
+                cursor-&gt;updateCursorData(key.get(), primaryKey.get(), valueBuffer.get(), valueKey.get());
</ins><span class="cx"> 
</span><del>-            m_callbacks-&gt;onSuccess(cursor, cursor-&gt;key(), cursor-&gt;primaryKey(), cursor-&gt;value());
</del><ins>+            m_callbacks-&gt;onSuccess(cursor.release());
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         completionCallback();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbleveldbIDBServerConnectionLevelDBcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -429,7 +429,7 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBServerConnectionLevelDB::openCursor(IDBTransactionBackend&amp; transaction, const OpenCursorOperation&amp; operation, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void IDBServerConnectionLevelDB::openCursor(IDBTransactionBackend&amp; transaction, const OpenCursorOperation&amp; operation, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><span class="cx">     IDBBackingStoreTransactionLevelDB* backingStoreTransaction = m_backingStoreTransactions.get(transaction.id());
</span><span class="cx">     ASSERT(backingStoreTransaction);
</span><span class="lines">@@ -462,7 +462,7 @@
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([completionCallback, cursorID]() {
</span><span class="cx">         // FIXME: Need to actually pass the initial key, primaryKey, and value to the callback.
</span><del>-        completionCallback(cursorID, nullptr, nullptr, nullptr, nullptr);
</del><ins>+        completionCallback(cursorID, nullptr, nullptr, nullptr, nullptr, nullptr);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -569,7 +569,7 @@
</span><span class="cx">     ASYNC_COMPLETION_CALLBACK_WITH_NULL_ARG(completionCallback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBServerConnectionLevelDB::cursorAdvance(IDBCursorBackend&amp; cursor, const CursorAdvanceOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void IDBServerConnectionLevelDB::cursorAdvance(IDBCursorBackend&amp; cursor, const CursorAdvanceOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><span class="cx">     IDBBackingStoreCursorLevelDB* backingStoreCursor = cursor.id() ? m_backingStoreCursors.get(cursor.id()) : 0;
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -581,7 +581,7 @@
</span><span class="cx">         m_backingStoreCursors.remove(cursor.id());
</span><span class="cx"> 
</span><span class="cx">         callOnMainThread([completionCallback]() {
</span><del>-            completionCallback(nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</del><ins>+            completionCallback(nullptr, nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</ins><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         return;
</span><span class="lines">@@ -591,11 +591,11 @@
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; value = backingStoreCursor-&gt;value();
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([completionCallback, key, primaryKey, value]() {
</span><del>-        completionCallback(key, primaryKey, value, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</del><ins>+        completionCallback(key, primaryKey, value, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBServerConnectionLevelDB::cursorIterate(IDBCursorBackend&amp; cursor, const CursorIterationOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void IDBServerConnectionLevelDB::cursorIterate(IDBCursorBackend&amp; cursor, const CursorIterationOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><span class="cx">     IDBBackingStoreCursorLevelDB* backingStoreCursor = cursor.id() ? m_backingStoreCursors.get(cursor.id()) : 0;
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -607,7 +607,7 @@
</span><span class="cx">         m_backingStoreCursors.remove(cursor.id());
</span><span class="cx"> 
</span><span class="cx">         callOnMainThread([completionCallback]() {
</span><del>-            completionCallback(nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</del><ins>+            completionCallback(nullptr, nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</ins><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         return;
</span><span class="lines">@@ -617,7 +617,7 @@
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; value = backingStoreCursor-&gt;value();
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([completionCallback, key, primaryKey, value]() {
</span><del>-        completionCallback(key, primaryKey, value, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</del><ins>+        completionCallback(key, primaryKey, value, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error advancing cursor&quot;));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbleveldbIDBServerConnectionLevelDBh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     virtual void deleteIndex(IDBTransactionBackend&amp;, const DeleteIndexOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void get(IDBTransactionBackend&amp;, const GetOperation&amp;, std::function&lt;void(const IDBGetResult&amp;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void put(IDBTransactionBackend&amp;, const PutOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)  override;
</span><del>-    virtual void openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</del><ins>+    virtual void openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</ins><span class="cx">     virtual void count(IDBTransactionBackend&amp;, const CountOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void deleteRange(IDBTransactionBackend&amp;, const DeleteRangeOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void clearObjectStore(IDBTransactionBackend&amp;, const ClearObjectStoreOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx">     virtual void changeDatabaseVersion(IDBTransactionBackend&amp;, const IDBDatabaseBackend::VersionChangeOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx"> 
</span><span class="cx">     // Cursor-level operations
</span><del>-    virtual void cursorAdvance(IDBCursorBackend&amp;, const CursorAdvanceOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
-    virtual void cursorIterate(IDBCursorBackend&amp;, const CursorIterationOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</del><ins>+    virtual void cursorAdvance(IDBCursorBackend&amp;, const CursorAdvanceOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
+    virtual void cursorIterate(IDBCursorBackend&amp;, const CursorIterationOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback) override;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     IDBServerConnectionLevelDB(const String&amp; databaseName, IDBBackingStoreLevelDB*);
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -3087,6 +3087,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><ins>+__ZNK7WebCore10IDBKeyData13loggingStringEv
</ins><span class="cx"> __ZNK7WebCore10IDBKeyData17maybeCreateIDBKeyEv
</span><span class="cx"> __ZNK7WebCore10IDBKeyData6encodeERNS_12KeyedEncoderE
</span><span class="cx"> __ZNK7WebCore10IDBKeyPath6encodeERNS_12KeyedEncoderE
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2014-01-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IDB: Index cursors use wrong deserialization for the retrieved value
+        https://bugs.webkit.org/show_bug.cgi?id=128035
+
+        Reviewed by Dan Bernstein.
+
+        Most of this is updating everything related to the cursor operation callbacks 
+        to support returning an IDBKey value in addition to a SharedBuffer value.
+
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
+        (WebKit::DatabaseProcessIDBConnection::openCursor):
+        (WebKit::DatabaseProcessIDBConnection::cursorAdvance):
+        (WebKit::DatabaseProcessIDBConnection::cursorIterate):
+
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
+        (WebKit::UniqueIDBDatabase::openCursor):
+        (WebKit::UniqueIDBDatabase::cursorAdvance):
+        (WebKit::UniqueIDBDatabase::cursorIterate):
+        (WebKit::UniqueIDBDatabase::openCursorInBackingStore):
+        (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore):
+        (WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
+        (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore):
+        (WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):
+        (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore):
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
+
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
+        * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor):
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor):
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::iterateCursor):
+        * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
+
+        * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
+        (WebKit::SQLiteIDBCursor::advance):
+        * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h:
+        (WebKit::SQLiteIDBCursor::currentValueBuffer):
+        (WebKit::SQLiteIDBCursor::currentValueKey):
+
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
+        (WebKit::WebIDBServerConnection::didOpenCursor):
+        (WebKit::WebIDBServerConnection::didAdvanceCursor):
+        (WebKit::WebIDBServerConnection::didIterateCursor):
+        (WebKit::WebIDBServerConnection::openCursor):
+        (WebKit::WebIDBServerConnection::cursorAdvance):
+        (WebKit::WebIDBServerConnection::cursorIterate):
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
+
</ins><span class="cx"> 2014-01-31  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove inline member functions of FrameSelection that access m_selection
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -272,9 +272,9 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(IDB, &quot;DatabaseProcess openCursor request ID %llu, object store id %lli&quot;, requestID, objectStoreID);
</span><span class="cx">     RefPtr&lt;DatabaseProcessIDBConnection&gt; connection(this);
</span><del>-    m_uniqueIDBDatabase-&gt;openCursor(IDBIdentifier(*this, transactionID), objectStoreID, indexID, static_cast&lt;IndexedDB::CursorDirection&gt;(cursorDirection), static_cast&lt;IndexedDB::CursorType&gt;(cursorType), static_cast&lt;IDBDatabaseBackend::TaskType&gt;(taskType), keyRangeData, [connection, requestID](int64_t cursorID, const IDBKeyData&amp; resultKey, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, uint32_t errorCode, const String&amp; errorMessage) {
</del><ins>+    m_uniqueIDBDatabase-&gt;openCursor(IDBIdentifier(*this, transactionID), objectStoreID, indexID, static_cast&lt;IndexedDB::CursorDirection&gt;(cursorDirection), static_cast&lt;IndexedDB::CursorType&gt;(cursorType), static_cast&lt;IDBDatabaseBackend::TaskType&gt;(taskType), keyRangeData, [connection, requestID](int64_t cursorID, const IDBKeyData&amp; resultKey, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage) {
</ins><span class="cx">         IPC::DataReference data = value ? IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(value-&gt;data()), value-&gt;size()) : IPC::DataReference();
</span><del>-        connection-&gt;send(Messages::WebIDBServerConnection::DidOpenCursor(requestID, cursorID, resultKey, primaryKey, data, errorCode, errorMessage));
</del><ins>+        connection-&gt;send(Messages::WebIDBServerConnection::DidOpenCursor(requestID, cursorID, resultKey, primaryKey, data, valueKey, errorCode, errorMessage));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -284,9 +284,9 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(IDB, &quot;DatabaseProcess cursorAdvance request ID %llu, cursor id %lli&quot;, requestID, cursorID);
</span><span class="cx">     RefPtr&lt;DatabaseProcessIDBConnection&gt; connection(this);
</span><del>-    m_uniqueIDBDatabase-&gt;cursorAdvance(IDBIdentifier(*this, cursorID), count, [connection, requestID](const IDBKeyData&amp; resultKey, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, uint32_t errorCode, const String&amp; errorMessage) {
</del><ins>+    m_uniqueIDBDatabase-&gt;cursorAdvance(IDBIdentifier(*this, cursorID), count, [connection, requestID](const IDBKeyData&amp; resultKey, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage) {
</ins><span class="cx">         IPC::DataReference data = value ? IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(value-&gt;data()), value-&gt;size()) : IPC::DataReference();
</span><del>-        connection-&gt;send(Messages::WebIDBServerConnection::DidAdvanceCursor(requestID, resultKey, primaryKey, data, errorCode, errorMessage));
</del><ins>+        connection-&gt;send(Messages::WebIDBServerConnection::DidAdvanceCursor(requestID, resultKey, primaryKey, data, valueKey, errorCode, errorMessage));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -296,9 +296,9 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(IDB, &quot;DatabaseProcess cursorIterate request ID %llu, cursor id %lli&quot;, requestID, cursorID);
</span><span class="cx">     RefPtr&lt;DatabaseProcessIDBConnection&gt; connection(this);
</span><del>-    m_uniqueIDBDatabase-&gt;cursorIterate(IDBIdentifier(*this, cursorID), key, [connection, requestID](const IDBKeyData&amp; resultKey, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, uint32_t errorCode, const String&amp; errorMessage) {
</del><ins>+    m_uniqueIDBDatabase-&gt;cursorIterate(IDBIdentifier(*this, cursorID), key, [connection, requestID](const IDBKeyData&amp; resultKey, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage) {
</ins><span class="cx">         IPC::DataReference data = value ? IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;(value-&gt;data()), value-&gt;size()) : IPC::DataReference();
</span><del>-        connection-&gt;send(Messages::WebIDBServerConnection::DidIterateCursor(requestID, resultKey, primaryKey, data, errorCode, errorMessage));
</del><ins>+        connection-&gt;send(Messages::WebIDBServerConnection::DidIterateCursor(requestID, resultKey, primaryKey, data, valueKey, errorCode, errorMessage));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -549,21 +549,21 @@
</span><span class="cx">     postDatabaseTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::getRecordFromBackingStore, requestID, transactionIdentifier, m_metadata-&gt;objectStores.get(objectStoreID), indexID, keyRangeData, cursorType));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, IndexedDB::CursorDirection cursorDirection, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, const IDBKeyRangeData&amp; keyRangeData, std::function&lt;void(int64_t, const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, uint32_t, const String&amp;)&gt; callback)
</del><ins>+void UniqueIDBDatabase::openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, IndexedDB::CursorDirection cursorDirection, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, const IDBKeyRangeData&amp; keyRangeData, std::function&lt;void(int64_t, const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, const IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     if (!m_acceptingNewRequests) {
</span><del>-        callback(0, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to open cursor in database because it has shut down&quot;);
</del><ins>+        callback(0, nullptr, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to open cursor in database because it has shut down&quot;);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_metadata-&gt;objectStores.contains(objectStoreID));
</span><span class="cx"> 
</span><del>-    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;int64_t, const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, uint32_t, const String&amp;&gt;::create([this, callback](int64_t cursorID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, uint32_t errorCode, const String&amp; errorMessage) {
-        callback(cursorID, key, primaryKey, value, errorCode, errorMessage);
</del><ins>+    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;int64_t, const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, const IDBKeyData&amp;, uint32_t, const String&amp;&gt;::create([this, callback](int64_t cursorID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage) {
+        callback(cursorID, key, primaryKey, value, valueKey, errorCode, errorMessage);
</ins><span class="cx">     }, [this, callback]() {
</span><del>-        callback(0, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to get record from database&quot;);
</del><ins>+        callback(0, nullptr, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to get record from database&quot;);
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     uint64_t requestID = request-&gt;requestID();
</span><span class="lines">@@ -572,19 +572,19 @@
</span><span class="cx">     postDatabaseTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::openCursorInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID, cursorDirection, cursorType, taskType, keyRangeData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::cursorAdvance(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, std::function&lt;void(const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, uint32_t, const String&amp;)&gt; callback)
</del><ins>+void UniqueIDBDatabase::cursorAdvance(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, std::function&lt;void(const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, const IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     if (!m_acceptingNewRequests) {
</span><del>-        callback(nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to advance cursor in database because it has shut down&quot;);
</del><ins>+        callback(nullptr, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to advance cursor in database because it has shut down&quot;);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, uint32_t, const String&amp;&gt;::create([this, callback](const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, uint32_t errorCode, const String&amp; errorMessage) {
-        callback(key, primaryKey, value, errorCode, errorMessage);
</del><ins>+    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, const IDBKeyData&amp;, uint32_t, const String&amp;&gt;::create([this, callback](const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage) {
+        callback(key, primaryKey, value, valueKey, errorCode, errorMessage);
</ins><span class="cx">     }, [this, callback]() {
</span><del>-        callback(nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to advance cursor in database&quot;);
</del><ins>+        callback(nullptr, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to advance cursor in database&quot;);
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     uint64_t requestID = request-&gt;requestID();
</span><span class="lines">@@ -593,19 +593,19 @@
</span><span class="cx">     postDatabaseTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::advanceCursorInBackingStore, requestID, cursorIdentifier, count));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::cursorIterate(const IDBIdentifier&amp; cursorIdentifier, const IDBKeyData&amp; key, std::function&lt;void(const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, uint32_t, const String&amp;)&gt; callback)
</del><ins>+void UniqueIDBDatabase::cursorIterate(const IDBIdentifier&amp; cursorIdentifier, const IDBKeyData&amp; key, std::function&lt;void(const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, const IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     if (!m_acceptingNewRequests) {
</span><del>-        callback(nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to iterate cursor in database because it has shut down&quot;);
</del><ins>+        callback(nullptr, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to iterate cursor in database because it has shut down&quot;);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, uint32_t, const String&amp;&gt;::create([this, callback](const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, uint32_t errorCode, const String&amp; errorMessage) {
-        callback(key, primaryKey, value, errorCode, errorMessage);
</del><ins>+    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;const IDBKeyData&amp;, const IDBKeyData&amp;, PassRefPtr&lt;SharedBuffer&gt;, const IDBKeyData&amp;, uint32_t, const String&amp;&gt;::create([this, callback](const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, PassRefPtr&lt;SharedBuffer&gt; value, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage) {
+        callback(key, primaryKey, value, valueKey, errorCode, errorMessage);
</ins><span class="cx">     }, [this, callback]() {
</span><del>-        callback(nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to iterate cursor in database&quot;);
</del><ins>+        callback(nullptr, nullptr, nullptr, nullptr, INVALID_STATE_ERR, &quot;Unable to iterate cursor in database&quot;);
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     uint64_t requestID = request-&gt;requestID();
</span><span class="lines">@@ -890,75 +890,78 @@
</span><span class="cx">     int64_t cursorID = 0;
</span><span class="cx">     IDBKeyData key;
</span><span class="cx">     IDBKeyData primaryKey;
</span><del>-    Vector&lt;char&gt; value;
</del><ins>+    Vector&lt;char&gt; valueBuffer;
+    IDBKeyData valueKey;
</ins><span class="cx">     int32_t errorCode = 0;
</span><span class="cx">     String errorMessage;
</span><del>-    bool success = m_backingStore-&gt;openCursor(transactionIdentifier, objectStoreID, indexID, cursorDirection, cursorType, taskType, keyRange, cursorID, key, primaryKey, value);
</del><ins>+    bool success = m_backingStore-&gt;openCursor(transactionIdentifier, objectStoreID, indexID, cursorDirection, cursorType, taskType, keyRange, cursorID, key, primaryKey, valueBuffer, valueKey);
</ins><span class="cx"> 
</span><span class="cx">     if (!success) {
</span><span class="cx">         errorCode = IDBDatabaseException::UnknownError;
</span><span class="cx">         errorMessage = ASCIILiteral(&quot;Unknown error opening cursor in backing store&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didOpenCursorInBackingStore, requestID, cursorID, key, primaryKey, value, errorCode, errorMessage));
</del><ins>+    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didOpenCursorInBackingStore, requestID, cursorID, key, primaryKey, valueBuffer, valueKey, errorCode, errorMessage));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::didOpenCursorInBackingStore(uint64_t requestID, int64_t cursorID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const Vector&lt;char&gt;&amp; value, uint32_t errorCode, const String&amp; errorMessage)
</del><ins>+void UniqueIDBDatabase::didOpenCursorInBackingStore(uint64_t requestID, int64_t cursorID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const Vector&lt;char&gt;&amp; valueBuffer, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;AsyncRequest&gt; request = m_pendingDatabaseTasks.take(requestID);
</span><span class="cx">     ASSERT(request);
</span><span class="cx"> 
</span><del>-    request-&gt;completeRequest(cursorID, key, primaryKey, SharedBuffer::create(value.data(), value.size()), errorCode, errorMessage);
</del><ins>+    request-&gt;completeRequest(cursorID, key, primaryKey, SharedBuffer::create(valueBuffer.data(), valueBuffer.size()), valueKey, errorCode, errorMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UniqueIDBDatabase::advanceCursorInBackingStore(uint64_t requestID, const IDBIdentifier&amp; cursorIdentifier, uint64_t count)
</span><span class="cx"> {
</span><span class="cx">     IDBKeyData key;
</span><span class="cx">     IDBKeyData primaryKey;
</span><del>-    Vector&lt;char&gt; value;
</del><ins>+    Vector&lt;char&gt; valueBuffer;
+    IDBKeyData valueKey;
</ins><span class="cx">     int32_t errorCode = 0;
</span><span class="cx">     String errorMessage;
</span><del>-    bool success = m_backingStore-&gt;advanceCursor(cursorIdentifier, count, key, primaryKey, value);
</del><ins>+    bool success = m_backingStore-&gt;advanceCursor(cursorIdentifier, count, key, primaryKey, valueBuffer, valueKey);
</ins><span class="cx"> 
</span><span class="cx">     if (!success) {
</span><span class="cx">         errorCode = IDBDatabaseException::UnknownError;
</span><span class="cx">         errorMessage = ASCIILiteral(&quot;Unknown error advancing cursor in backing store&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didAdvanceCursorInBackingStore, requestID, key, primaryKey, value, errorCode, errorMessage));
</del><ins>+    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didAdvanceCursorInBackingStore, requestID, key, primaryKey, valueBuffer, valueKey, errorCode, errorMessage));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::didAdvanceCursorInBackingStore(uint64_t requestID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const Vector&lt;char&gt;&amp; value, uint32_t errorCode, const String&amp; errorMessage)
</del><ins>+void UniqueIDBDatabase::didAdvanceCursorInBackingStore(uint64_t requestID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const Vector&lt;char&gt;&amp; valueBuffer, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;AsyncRequest&gt; request = m_pendingDatabaseTasks.take(requestID);
</span><span class="cx">     ASSERT(request);
</span><span class="cx"> 
</span><del>-    request-&gt;completeRequest(key, primaryKey, SharedBuffer::create(value.data(), value.size()), errorCode, errorMessage);
</del><ins>+    request-&gt;completeRequest(key, primaryKey, SharedBuffer::create(valueBuffer.data(), valueBuffer.size()), valueKey, errorCode, errorMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UniqueIDBDatabase::iterateCursorInBackingStore(uint64_t requestID, const IDBIdentifier&amp; cursorIdentifier, const IDBKeyData&amp; iterateKey)
</span><span class="cx"> {
</span><span class="cx">     IDBKeyData key;
</span><span class="cx">     IDBKeyData primaryKey;
</span><del>-    Vector&lt;char&gt; value;
</del><ins>+    Vector&lt;char&gt; valueBuffer;
+    IDBKeyData valueKey;
</ins><span class="cx">     int32_t errorCode = 0;
</span><span class="cx">     String errorMessage;
</span><del>-    bool success = m_backingStore-&gt;iterateCursor(cursorIdentifier, iterateKey, key, primaryKey, value);
</del><ins>+    bool success = m_backingStore-&gt;iterateCursor(cursorIdentifier, iterateKey, key, primaryKey, valueBuffer, valueKey);
</ins><span class="cx"> 
</span><span class="cx">     if (!success) {
</span><span class="cx">         errorCode = IDBDatabaseException::UnknownError;
</span><span class="cx">         errorMessage = ASCIILiteral(&quot;Unknown error iterating cursor in backing store&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didIterateCursorInBackingStore, requestID, key, primaryKey, value, errorCode, errorMessage));
</del><ins>+    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didIterateCursorInBackingStore, requestID, key, primaryKey, valueBuffer, valueKey, errorCode, errorMessage));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::didIterateCursorInBackingStore(uint64_t requestID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const Vector&lt;char&gt;&amp; value, uint32_t errorCode, const String&amp; errorMessage)
</del><ins>+void UniqueIDBDatabase::didIterateCursorInBackingStore(uint64_t requestID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const Vector&lt;char&gt;&amp; valueBuffer, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;AsyncRequest&gt; request = m_pendingDatabaseTasks.take(requestID);
</span><span class="cx">     ASSERT(request);
</span><span class="cx"> 
</span><del>-    request-&gt;completeRequest(key, primaryKey, SharedBuffer::create(value.data(), value.size()), errorCode, errorMessage);
</del><ins>+    request-&gt;completeRequest(key, primaryKey, SharedBuffer::create(valueBuffer.data(), valueBuffer.size()), valueKey, errorCode, errorMessage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UniqueIDBDatabase::countInBackingStore(uint64_t requestID, const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, const IDBKeyRangeData&amp; keyRangeData)
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -87,9 +87,9 @@
</span><span class="cx">     void putRecord(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp; value, int64_t putMode, const Vector&lt;int64_t&gt;&amp; indexIDs, const Vector&lt;Vector&lt;WebCore::IDBKeyData&gt;&gt;&amp; indexKeys, std::function&lt;void(const WebCore::IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback);
</span><span class="cx">     void getRecord(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, WebCore::IndexedDB::CursorType, std::function&lt;void(const WebCore::IDBGetResult&amp;, uint32_t, const String&amp;)&gt; callback);
</span><span class="cx"> 
</span><del>-    void openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, WebCore::IndexedDB::CursorDirection, WebCore::IndexedDB::CursorType, WebCore::IDBDatabaseBackend::TaskType, const WebCore::IDBKeyRangeData&amp;, std::function&lt;void(int64_t, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, uint32_t, const String&amp;)&gt; callback);
-    void cursorAdvance(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, std::function&lt;void(const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, uint32_t, const String&amp;)&gt; callback);
-    void cursorIterate(const IDBIdentifier&amp; cursorIdentifier, const WebCore::IDBKeyData&amp;, std::function&lt;void(const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, uint32_t, const String&amp;)&gt; callback);
</del><ins>+    void openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, WebCore::IndexedDB::CursorDirection, WebCore::IndexedDB::CursorType, WebCore::IDBDatabaseBackend::TaskType, const WebCore::IDBKeyRangeData&amp;, std::function&lt;void(int64_t, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, const WebCore::IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback);
+    void cursorAdvance(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, std::function&lt;void(const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, const WebCore::IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback);
+    void cursorIterate(const IDBIdentifier&amp; cursorIdentifier, const WebCore::IDBKeyData&amp;, std::function&lt;void(const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, const WebCore::IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback);
</ins><span class="cx"> 
</span><span class="cx">     void count(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, std::function&lt;void(int64_t, uint32_t, const String&amp;)&gt; callback);
</span><span class="cx">     void deleteRange(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRangeData&amp;, std::function&lt;void(uint32_t, const String&amp;)&gt; callback);
</span><span class="lines">@@ -159,9 +159,9 @@
</span><span class="cx">     void didDeleteIndex(uint64_t requestID, bool success);
</span><span class="cx">     void didPutRecordInBackingStore(uint64_t requestID, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
</span><span class="cx">     void didGetRecordFromBackingStore(uint64_t requestID, const WebCore::IDBGetResult&amp;, uint32_t errorCode, const String&amp; errorMessage);
</span><del>-    void didOpenCursorInBackingStore(uint64_t requestID, int64_t cursorID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;char&gt;&amp;, uint32_t errorCode, const String&amp; errorMessage);
-    void didAdvanceCursorInBackingStore(uint64_t requestID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;char&gt;&amp;, uint32_t errorCode, const String&amp; errorMessage);
-    void didIterateCursorInBackingStore(uint64_t requestID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;char&gt;&amp;, uint32_t errorCode, const String&amp; errorMessage);
</del><ins>+    void didOpenCursorInBackingStore(uint64_t requestID, int64_t cursorID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;char&gt;&amp;, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
+    void didAdvanceCursorInBackingStore(uint64_t requestID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;char&gt;&amp;, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
+    void didIterateCursorInBackingStore(uint64_t requestID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;char&gt;&amp;, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
</ins><span class="cx">     void didCountInBackingStore(uint64_t requestID, int64_t count, uint32_t errorCode, const String&amp; errorMessage);
</span><span class="cx">     void didDeleteRangeInBackingStore(uint64_t requestID, uint32_t errorCode, const String&amp; errorMessage);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx">     virtual bool getKeyRangeRecordFromObjectStore(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRange&amp;, RefPtr&lt;WebCore::SharedBuffer&gt;&amp; result, RefPtr&lt;WebCore::IDBKey&gt;&amp; resultKey) = 0;
</span><span class="cx">     virtual bool count(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, int64_t&amp; count) = 0;
</span><span class="cx"> 
</span><del>-    virtual bool openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, WebCore::IndexedDB::CursorDirection, WebCore::IndexedDB::CursorType, WebCore::IDBDatabaseBackend::TaskType, const WebCore::IDBKeyRangeData&amp;, int64_t&amp; cursorID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;) = 0;
-    virtual bool advanceCursor(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;) = 0;
-    virtual bool iterateCursor(const IDBIdentifier&amp; cursorIdentifier, const WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;) = 0;
</del><ins>+    virtual bool openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, WebCore::IndexedDB::CursorDirection, WebCore::IndexedDB::CursorType, WebCore::IDBDatabaseBackend::TaskType, const WebCore::IDBKeyRangeData&amp;, int64_t&amp; cursorID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;, WebCore::IDBKeyData&amp;) = 0;
+    virtual bool advanceCursor(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;, WebCore::IDBKeyData&amp;) = 0;
+    virtual bool iterateCursor(const IDBIdentifier&amp; cursorIdentifier, const WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;, WebCore::IDBKeyData&amp;) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteSQLiteIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -244,8 +244,19 @@
</span><span class="cx"> 
</span><span class="cx">     m_currentKey = key;
</span><span class="cx">     m_currentPrimaryKey = key;
</span><del>-    m_currentValue = keyData;
</del><ins>+    m_currentValueBuffer = keyData;
</ins><span class="cx"> 
</span><ins>+    if (m_indexID != IDBIndexMetadata::InvalidId) {
+        if (!deserializeIDBKeyData(reinterpret_cast&lt;const uint8_t*&gt;(keyData.data()), keyData.size(), m_currentValueKey)) {
+            LOG_ERROR(&quot;Unable to deserialize value data from database while advancing cursor&quot;);
+            m_completed = true;
+            return false;
+        }
+
+        // Index cursors should only have a m_currentValueKey, and not m_currentValueBuffer
+        m_currentValueBuffer.clear();
+    }
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteSQLiteIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -58,7 +58,8 @@
</span><span class="cx"> 
</span><span class="cx">     const WebCore::IDBKeyData&amp; currentKey() const { return m_currentKey; }
</span><span class="cx">     const WebCore::IDBKeyData&amp; currentPrimaryKey() const { return m_currentPrimaryKey; }
</span><del>-    const Vector&lt;char&gt;&amp; currentValue() const { return m_currentValue; }
</del><ins>+    const Vector&lt;char&gt;&amp; currentValueBuffer() const { return m_currentValueBuffer; }
+    const WebCore::IDBKeyData&amp; currentValueKey() const { return m_currentValueKey; }
</ins><span class="cx"> 
</span><span class="cx">     bool advance(uint64_t count);
</span><span class="cx">     bool iterate(const WebCore::IDBKeyData&amp; targetKey);
</span><span class="lines">@@ -78,7 +79,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebCore::IDBKeyData m_currentKey;
</span><span class="cx">     WebCore::IDBKeyData m_currentPrimaryKey;
</span><del>-    Vector&lt;char&gt; m_currentValue;
</del><ins>+    Vector&lt;char&gt; m_currentValueBuffer;
+    WebCore::IDBKeyData m_currentValueKey;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;WebCore::SQLiteStatement&gt; m_statement;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -938,7 +938,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool UniqueIDBDatabaseBackingStoreSQLite::openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, IndexedDB::CursorDirection cursorDirection, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, const IDBKeyRangeData&amp; keyRange, int64_t&amp; cursorID, IDBKeyData&amp; key, IDBKeyData&amp; primaryKey, Vector&lt;char&gt;&amp; value)
</del><ins>+bool UniqueIDBDatabaseBackingStoreSQLite::openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, IndexedDB::CursorDirection cursorDirection, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, const IDBKeyRangeData&amp; keyRange, int64_t&amp; cursorID, IDBKeyData&amp; key, IDBKeyData&amp; primaryKey, Vector&lt;char&gt;&amp; valueBuffer, IDBKeyData&amp; valueKey)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!isMainThread());
</span><span class="cx">     ASSERT(m_sqliteDB);
</span><span class="lines">@@ -958,12 +958,13 @@
</span><span class="cx">     cursorID = cursor-&gt;identifier().id();
</span><span class="cx">     key = cursor-&gt;currentKey();
</span><span class="cx">     primaryKey = cursor-&gt;currentPrimaryKey();
</span><del>-    value = cursor-&gt;currentValue();
</del><ins>+    valueBuffer = cursor-&gt;currentValueBuffer();
+    valueKey = cursor-&gt;currentValueKey();
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool UniqueIDBDatabaseBackingStoreSQLite::advanceCursor(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, IDBKeyData&amp; key, IDBKeyData&amp; primaryKey, Vector&lt;char&gt;&amp; value)
</del><ins>+bool UniqueIDBDatabaseBackingStoreSQLite::advanceCursor(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, IDBKeyData&amp; key, IDBKeyData&amp; primaryKey, Vector&lt;char&gt;&amp; valueBuffer, IDBKeyData&amp; valueKey)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!isMainThread());
</span><span class="cx">     ASSERT(m_sqliteDB);
</span><span class="lines">@@ -986,12 +987,13 @@
</span><span class="cx"> 
</span><span class="cx">     key = cursor-&gt;currentKey();
</span><span class="cx">     primaryKey = cursor-&gt;currentPrimaryKey();
</span><del>-    value = cursor-&gt;currentValue();
</del><ins>+    valueBuffer = cursor-&gt;currentValueBuffer();
+    valueKey = cursor-&gt;currentValueKey();
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool UniqueIDBDatabaseBackingStoreSQLite::iterateCursor(const IDBIdentifier&amp; cursorIdentifier, const IDBKeyData&amp; targetKey, IDBKeyData&amp; key, IDBKeyData&amp; primaryKey, Vector&lt;char&gt;&amp; value)
</del><ins>+bool UniqueIDBDatabaseBackingStoreSQLite::iterateCursor(const IDBIdentifier&amp; cursorIdentifier, const IDBKeyData&amp; targetKey, IDBKeyData&amp; key, IDBKeyData&amp; primaryKey, Vector&lt;char&gt;&amp; valueBuffer, IDBKeyData&amp; valueKey)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!isMainThread());
</span><span class="cx">     ASSERT(m_sqliteDB);
</span><span class="lines">@@ -1014,7 +1016,8 @@
</span><span class="cx"> 
</span><span class="cx">     key = cursor-&gt;currentKey();
</span><span class="cx">     primaryKey = cursor-&gt;currentPrimaryKey();
</span><del>-    value = cursor-&gt;currentValue();
</del><ins>+    valueBuffer = cursor-&gt;currentValueBuffer();
+    valueKey = cursor-&gt;currentValueKey();
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLiteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -80,9 +80,9 @@
</span><span class="cx">     virtual bool getKeyRangeRecordFromObjectStore(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRange&amp;, RefPtr&lt;WebCore::SharedBuffer&gt;&amp; result, RefPtr&lt;WebCore::IDBKey&gt;&amp; resultKey) override;
</span><span class="cx">     virtual bool count(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, int64_t&amp; count) override;
</span><span class="cx"> 
</span><del>-    virtual bool openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, WebCore::IndexedDB::CursorDirection, WebCore::IndexedDB::CursorType, WebCore::IDBDatabaseBackend::TaskType, const WebCore::IDBKeyRangeData&amp;, int64_t&amp; cursorID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;) override;
-    virtual bool advanceCursor(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;) override;
-    virtual bool iterateCursor(const IDBIdentifier&amp; cursorIdentifier, const WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;) override;
</del><ins>+    virtual bool openCursor(const IDBIdentifier&amp; transactionIdentifier, int64_t objectStoreID, int64_t indexID, WebCore::IndexedDB::CursorDirection, WebCore::IndexedDB::CursorType, WebCore::IDBDatabaseBackend::TaskType, const WebCore::IDBKeyRangeData&amp;, int64_t&amp; cursorID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;, WebCore::IDBKeyData&amp;) override;
+    virtual bool advanceCursor(const IDBIdentifier&amp; cursorIdentifier, uint64_t count, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;, WebCore::IDBKeyData&amp;) override;
+    virtual bool iterateCursor(const IDBIdentifier&amp; cursorIdentifier, const WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, Vector&lt;char&gt;&amp;, WebCore::IDBKeyData&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     void unregisterCursor(SQLiteIDBCursor*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">     serverRequest-&gt;completeRequest(getResult, errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::didOpenCursor(uint64_t requestID, int64_t cursorID, WebCore::IDBKeyData&amp; key, WebCore::IDBKeyData&amp; primaryKey, const IPC::DataReference&amp; valueData, uint32_t errorCode, const String&amp; errorMessage)
</del><ins>+void WebIDBServerConnection::didOpenCursor(uint64_t requestID, int64_t cursorID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const IPC::DataReference&amp; valueData, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IDB, &quot;WebProcess didOpenCursor request ID %llu (error - %s)&quot;, requestID, errorMessage.utf8().data());
</span><span class="cx"> 
</span><span class="lines">@@ -454,10 +454,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; value = SharedBuffer::create(valueData.data(), valueData.size());
</span><del>-    serverRequest-&gt;completeRequest(cursorID, key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</del><ins>+    serverRequest-&gt;completeRequest(cursorID, key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), valueKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::didAdvanceCursor(uint64_t requestID, WebCore::IDBKeyData&amp; key, WebCore::IDBKeyData&amp; primaryKey, const IPC::DataReference&amp; valueData, uint32_t errorCode, const String&amp; errorMessage)
</del><ins>+void WebIDBServerConnection::didAdvanceCursor(uint64_t requestID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const IPC::DataReference&amp; valueData, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IDB, &quot;WebProcess didAdvanceCursor request ID %llu (error - %s)&quot;, requestID, errorMessage.utf8().data());
</span><span class="cx"> 
</span><span class="lines">@@ -467,10 +467,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; value = SharedBuffer::create(valueData.data(), valueData.size());
</span><del>-    serverRequest-&gt;completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</del><ins>+    serverRequest-&gt;completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), valueKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::didIterateCursor(uint64_t requestID, WebCore::IDBKeyData&amp; key, WebCore::IDBKeyData&amp; primaryKey, const IPC::DataReference&amp; valueData, uint32_t errorCode, const String&amp; errorMessage)
</del><ins>+void WebIDBServerConnection::didIterateCursor(uint64_t requestID, const IDBKeyData&amp; key, const IDBKeyData&amp; primaryKey, const IPC::DataReference&amp; valueData, const IDBKeyData&amp; valueKey, uint32_t errorCode, const String&amp; errorMessage)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IDB, &quot;WebProcess didIterateCursor request ID %llu (error - %s)&quot;, requestID, errorMessage.utf8().data());
</span><span class="cx"> 
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SharedBuffer&gt; value = SharedBuffer::create(valueData.data(), valueData.size());
</span><del>-    serverRequest-&gt;completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</del><ins>+    serverRequest-&gt;completeRequest(key.maybeCreateIDBKey(), primaryKey.maybeCreateIDBKey(), value.release(), valueKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebIDBServerConnection::count(IDBTransactionBackend&amp; transaction, const CountOperation&amp; operation, std::function&lt;void(int64_t, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</span><span class="lines">@@ -628,12 +628,12 @@
</span><span class="cx">     serverRequest-&gt;completeRequest(success ? nullptr : IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured changing database version&quot;));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp; operation, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void WebIDBServerConnection::openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp; operation, std::function&lt;void(int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
</del><ins>+    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;int64_t, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
</ins><span class="cx"> 
</span><span class="cx">     serverRequest-&gt;setAbortHandler([completionCallback]() {
</span><del>-        completionCallback(0, nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured opening database cursor&quot;));
</del><ins>+        completionCallback(0, nullptr, nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured opening database cursor&quot;));
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     uint64_t requestID = serverRequest-&gt;requestID();
</span><span class="lines">@@ -645,12 +645,12 @@
</span><span class="cx">     send(Messages::DatabaseProcessIDBConnection::OpenCursor(requestID, operation.transactionID(), operation.objectStoreID(), operation.indexID(), static_cast&lt;int64_t&gt;(operation.direction()), static_cast&lt;int64_t&gt;(operation.cursorType()), static_cast&lt;int64_t&gt;(operation.taskType()), operation.keyRange()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::cursorAdvance(IDBCursorBackend&amp;, const CursorAdvanceOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void WebIDBServerConnection::cursorAdvance(IDBCursorBackend&amp;, const CursorAdvanceOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
</del><ins>+    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
</ins><span class="cx"> 
</span><span class="cx">     serverRequest-&gt;setAbortHandler([completionCallback]() {
</span><del>-        completionCallback(nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured advancing database cursor&quot;));
</del><ins>+        completionCallback(nullptr, nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured advancing database cursor&quot;));
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     uint64_t requestID = serverRequest-&gt;requestID();
</span><span class="lines">@@ -662,12 +662,12 @@
</span><span class="cx">     send(Messages::DatabaseProcessIDBConnection::CursorAdvance(requestID, operation.cursorID(), operation.count()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::cursorIterate(IDBCursorBackend&amp;, const CursorIterationOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void WebIDBServerConnection::cursorIterate(IDBCursorBackend&amp;, const CursorIterationOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
</del><ins>+    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;SharedBuffer&gt;, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
</ins><span class="cx"> 
</span><span class="cx">     serverRequest-&gt;setAbortHandler([completionCallback]() {
</span><del>-        completionCallback(nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured iterating database cursor&quot;));
</del><ins>+        completionCallback(nullptr, nullptr, nullptr, nullptr, IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured iterating database cursor&quot;));
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     uint64_t requestID = serverRequest-&gt;requestID();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     virtual void deleteIndex(WebCore::IDBTransactionBackend&amp;, const WebCore::DeleteIndexOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void get(WebCore::IDBTransactionBackend&amp;, const WebCore::GetOperation&amp;, std::function&lt;void(const WebCore::IDBGetResult&amp;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void put(WebCore::IDBTransactionBackend&amp;, const WebCore::PutOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><del>-    virtual void openCursor(WebCore::IDBTransactionBackend&amp;, const WebCore::OpenCursorOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</del><ins>+    virtual void openCursor(WebCore::IDBTransactionBackend&amp;, const WebCore::OpenCursorOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</ins><span class="cx">     virtual void count(WebCore::IDBTransactionBackend&amp;, const WebCore::CountOperation&amp;, std::function&lt;void(int64_t, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void deleteRange(WebCore::IDBTransactionBackend&amp;, const WebCore::DeleteRangeOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx">     virtual void clearObjectStore(WebCore::IDBTransactionBackend&amp;, const WebCore::ClearObjectStoreOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="lines">@@ -80,8 +80,8 @@
</span><span class="cx">     virtual void changeDatabaseVersion(WebCore::IDBTransactionBackend&amp;, const WebCore::IDBDatabaseBackend::VersionChangeOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</span><span class="cx"> 
</span><span class="cx">     // Cursor-level operations
</span><del>-    virtual void cursorAdvance(WebCore::IDBCursorBackend&amp;, const WebCore::CursorAdvanceOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
-    virtual void cursorIterate(WebCore::IDBCursorBackend&amp;, const WebCore::CursorIterationOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</del><ins>+    virtual void cursorAdvance(WebCore::IDBCursorBackend&amp;, const WebCore::CursorAdvanceOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
+    virtual void cursorIterate(WebCore::IDBCursorBackend&amp;, const WebCore::CursorIterationOperation&amp;, std::function&lt;void(PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::SharedBuffer&gt;, PassRefPtr&lt;WebCore::IDBKey&gt;, PassRefPtr&lt;WebCore::IDBDatabaseError&gt;)&gt; completionCallback) override;
</ins><span class="cx"> 
</span><span class="cx">     // Message handlers.
</span><span class="cx">     void didReceiveWebIDBServerConnectionMessage(IPC::Connection*, IPC::MessageDecoder&amp;);
</span><span class="lines">@@ -110,9 +110,9 @@
</span><span class="cx">     void didDeleteIndex(uint64_t requestID, bool success);
</span><span class="cx">     void didPutRecord(uint64_t requestID, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
</span><span class="cx">     void didGetRecord(uint64_t requestID, const WebCore::IDBGetResult&amp;, uint32_t errorCode, const String&amp; errorMessage);
</span><del>-    void didOpenCursor(uint64_t requestID, int64_t cursorID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, const IPC::DataReference&amp;, uint32_t errorCode, const String&amp; errorMessage);
-    void didAdvanceCursor(uint64_t requestID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, const IPC::DataReference&amp;, uint32_t errorCode, const String&amp; errorMessage);
-    void didIterateCursor(uint64_t requestID, WebCore::IDBKeyData&amp;, WebCore::IDBKeyData&amp;, const IPC::DataReference&amp;, uint32_t errorCode, const String&amp; errorMessage);
</del><ins>+    void didOpenCursor(uint64_t requestID, int64_t cursorID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp;, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
+    void didAdvanceCursor(uint64_t requestID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp;, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
+    void didIterateCursor(uint64_t requestID, const WebCore::IDBKeyData&amp;, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp;, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
</ins><span class="cx">     void didCount(uint64_t requestID, int64_t count, uint32_t errorCode, const String&amp; errorMessage);
</span><span class="cx">     void didDeleteRange(uint64_t requestID, uint32_t errorCode, const String&amp; errorMessage);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in (163233 => 163234)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in        2014-02-01 04:58:12 UTC (rev 163233)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in        2014-02-01 05:01:15 UTC (rev 163234)
</span><span class="lines">@@ -40,9 +40,9 @@
</span><span class="cx">     DidDeleteIndex(uint64_t requestID, bool success)
</span><span class="cx">     DidPutRecord(uint64_t requestID, WebCore::IDBKeyData resultKey, uint32_t errorCode, String errorMessage)
</span><span class="cx">     DidGetRecord(uint64_t requestID, WebCore::IDBGetResult getResult, uint32_t errorCode, String errorMessage)
</span><del>-    DidOpenCursor(uint64_t requestID, int64_t cursorID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
-    DidAdvanceCursor(uint64_t requestID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
-    DidIterateCursor(uint64_t requestID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
</del><ins>+    DidOpenCursor(uint64_t requestID, int64_t cursorID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, WebCore::IDBKeyData valueKey, uint32_t errorCode, String errorMessage)
+    DidAdvanceCursor(uint64_t requestID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, WebCore::IDBKeyData valueKey, uint32_t errorCode, String errorMessage)
+    DidIterateCursor(uint64_t requestID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, WebCore::IDBKeyData valueKey, uint32_t errorCode, String errorMessage)
</ins><span class="cx">     DidCount(uint64_t requestID, int64_t count, uint32_t errorCode, String errorMessage)
</span><span class="cx">     DidDeleteRange(uint64_t requestID, uint32_t errorCode, String errorMessage)
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>