<!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>[209893] trunk/Source/WebCore</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/209893">209893</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-12-15 17:20:24 -0800 (Thu, 15 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>IndexedDB: Add an &quot;IDBCursorRecord&quot; struct.
https://bugs.webkit.org/show_bug.cgi?id=165929

Reviewed by Alex Christensen.

No new tests (Refactor, no behavior change).

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):

* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):

* Modules/indexeddb/shared/IDBCursorRecord.h: Added.
(WebCore::IDBCursorRecord::encode):
(WebCore::IDBCursorRecord::decode):

* WebCore.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBCursorRecordh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorRecord.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209892 => 209893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-16 01:14:40 UTC (rev 209892)
+++ trunk/Source/WebCore/ChangeLog        2016-12-16 01:20:24 UTC (rev 209893)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-12-15  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB: Add an &quot;IDBCursorRecord&quot; struct.
+        https://bugs.webkit.org/show_bug.cgi?id=165929
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Refactor, no behavior change).
+
+        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
+        (WebCore::IDBServer::SQLiteIDBCursor::currentData):
+        (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
+        (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
+        (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
+        (WebCore::IDBServer::SQLiteIDBCursor::iterate):
+        
+        * Modules/indexeddb/server/SQLiteIDBCursor.h:
+        (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
+        (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
+        (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
+
+        * Modules/indexeddb/shared/IDBCursorRecord.h: Added.
+        (WebCore::IDBCursorRecord::encode):
+        (WebCore::IDBCursorRecord::decode):
+        
+        * WebCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2016-12-15  Keith Rollin  &lt;krollin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refactor Document::suspend/resume
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp (209892 => 209893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-12-16 01:14:40 UTC (rev 209892)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-12-16 01:20:24 UTC (rev 209893)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    result = { m_currentKey, m_currentPrimaryKey, m_currentValue ? *m_currentValue : IDBValue() };
</del><ins>+    result = { m_currentRecord.key, m_currentRecord.primaryKey, m_currentRecord.value ? *m_currentRecord.value : IDBValue() };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static String buildIndexStatement(const IDBKeyRangeData&amp; keyRange, IndexedDB::CursorDirection cursorDirection)
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">     m_statementNeedsReset = false;
</span><span class="cx"> 
</span><span class="cx">     // If this cursor never fetched any records, we don't need to reset the statement.
</span><del>-    if (m_currentKey.isNull())
</del><ins>+    if (m_currentRecord.key.isNull())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Otherwise update the lower key or upper key used for the cursor range.
</span><span class="lines">@@ -230,7 +230,7 @@
</span><span class="cx">     // This is so the cursor can pick up where we left off.
</span><span class="cx">     // We might also have to change the statement from closed to open so we don't refetch the current key a second time.
</span><span class="cx">     if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate) {
</span><del>-        m_currentLowerKey = m_currentKey;
</del><ins>+        m_currentLowerKey = m_currentRecord.key;
</ins><span class="cx">         if (!m_keyRange.lowerOpen) {
</span><span class="cx">             m_keyRange.lowerOpen = true;
</span><span class="cx">             m_keyRange.lowerKey = m_currentLowerKey;
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">             m_statement = nullptr;
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-        m_currentUpperKey = m_currentKey;
</del><ins>+        m_currentUpperKey = m_currentRecord.key;
</ins><span class="cx">         if (!m_keyRange.upperOpen) {
</span><span class="cx">             m_keyRange.upperOpen = true;
</span><span class="cx">             m_keyRange.upperKey = m_currentUpperKey;
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool SQLiteIDBCursor::advanceUnique()
</span><span class="cx"> {
</span><del>-    IDBKeyData currentKey = m_currentKey;
</del><ins>+    IDBKeyData currentKey = m_currentRecord.key;
</ins><span class="cx"> 
</span><span class="cx">     while (!m_completed) {
</span><span class="cx">         if (!advanceOnce())
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         // If the new current key is different from the old current key, we're done.
</span><del>-        if (currentKey.compare(m_currentKey))
</del><ins>+        if (currentKey.compare(m_currentRecord.key))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx">     ASSERT(m_statement);
</span><span class="cx">     ASSERT(!m_completed);
</span><span class="cx"> 
</span><del>-    m_currentValue = nullptr;
</del><ins>+    m_currentRecord.value = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     int result = m_statement-&gt;step();
</span><span class="cx">     if (result == SQLITE_DONE) {
</span><span class="lines">@@ -363,9 +363,7 @@
</span><span class="cx">         m_completed = true;
</span><span class="cx"> 
</span><span class="cx">         // When a cursor reaches its end, that is indicated by having undefined keys/values
</span><del>-        m_currentKey = IDBKeyData();
-        m_currentPrimaryKey = IDBKeyData();
-        m_currentValue = nullptr;
</del><ins>+        m_currentRecord = { };
</ins><span class="cx">         m_currentRecordRowID = 0;
</span><span class="cx"> 
</span><span class="cx">         return AdvanceResult::Success;
</span><span class="lines">@@ -383,7 +381,7 @@
</span><span class="cx">     Vector&lt;uint8_t&gt; keyData;
</span><span class="cx">     m_statement-&gt;getColumnBlobAsVector(1, keyData);
</span><span class="cx"> 
</span><del>-    if (!deserializeIDBKeyData(keyData.data(), keyData.size(), m_currentKey)) {
</del><ins>+    if (!deserializeIDBKeyData(keyData.data(), keyData.size(), m_currentRecord.key)) {
</ins><span class="cx">         LOG_ERROR(&quot;Unable to deserialize key data from database while advancing cursor&quot;);
</span><span class="cx">         markAsErrored();
</span><span class="cx">         return AdvanceResult::Failure;
</span><span class="lines">@@ -393,7 +391,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The primaryKey of an ObjectStore cursor is the same as its key.
</span><span class="cx">     if (m_indexID == IDBIndexInfo::InvalidId) {
</span><del>-        m_currentPrimaryKey = m_currentKey;
</del><ins>+        m_currentRecord.primaryKey = m_currentRecord.key;
</ins><span class="cx"> 
</span><span class="cx">         Vector&lt;String&gt; blobURLs, blobFilePaths;
</span><span class="cx">         auto error = m_transaction-&gt;backingStore().getBlobRecordsForObjectStoreRecord(m_currentRecordRowID, blobURLs, blobFilePaths);
</span><span class="lines">@@ -404,9 +402,9 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (m_cursorType == IndexedDB::CursorType::KeyAndValue)
</span><del>-            m_currentValue = std::make_unique&lt;IDBValue&gt;(ThreadSafeDataBuffer::adoptVector(keyData), blobURLs, blobFilePaths);
</del><ins>+            m_currentRecord.value = std::make_unique&lt;IDBValue&gt;(ThreadSafeDataBuffer::adoptVector(keyData), blobURLs, blobFilePaths);
</ins><span class="cx">     } else {
</span><del>-        if (!deserializeIDBKeyData(keyData.data(), keyData.size(), m_currentPrimaryKey)) {
</del><ins>+        if (!deserializeIDBKeyData(keyData.data(), keyData.size(), m_currentRecord.primaryKey)) {
</ins><span class="cx">             LOG_ERROR(&quot;Unable to deserialize value data from database while advancing index cursor&quot;);
</span><span class="cx">             markAsErrored();
</span><span class="cx">             return AdvanceResult::Failure;
</span><span class="lines">@@ -426,7 +424,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (result == SQLITE_ROW) {
</span><span class="cx">             objectStoreStatement.getColumnBlobAsVector(0, keyData);
</span><del>-            m_currentValue = std::make_unique&lt;IDBValue&gt;(ThreadSafeDataBuffer::adoptVector(keyData));
</del><ins>+            m_currentRecord.value = std::make_unique&lt;IDBValue&gt;(ThreadSafeDataBuffer::adoptVector(keyData));
</ins><span class="cx">         } else if (result == SQLITE_DONE) {
</span><span class="cx">             // This indicates that the record we're trying to retrieve has been removed from the object store.
</span><span class="cx">             // Skip over it.
</span><span class="lines">@@ -459,9 +457,9 @@
</span><span class="cx"> 
</span><span class="cx">         // Search for the next key &gt;= the target if the cursor is a Next cursor, or the next key &lt;= if the cursor is a Previous cursor.
</span><span class="cx">         if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate) {
</span><del>-            if (m_currentKey.compare(targetKey) &gt;= 0)
</del><ins>+            if (m_currentRecord.key.compare(targetKey) &gt;= 0)
</ins><span class="cx">                 break;
</span><del>-        } else if (m_currentKey.compare(targetKey) &lt;= 0)
</del><ins>+        } else if (m_currentRecord.key.compare(targetKey) &lt;= 0)
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         result = advance(1);
</span><span class="lines">@@ -468,15 +466,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (targetPrimaryKey.isValid()) {
</span><del>-        while (!m_completed &amp;&amp; !m_currentKey.compare(targetKey)) {
</del><ins>+        while (!m_completed &amp;&amp; !m_currentRecord.key.compare(targetKey)) {
</ins><span class="cx">             if (!result)
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">             // Search for the next primary key &gt;= the primary target if the cursor is a Next cursor, or the next key &lt;= if the cursor is a Previous cursor.
</span><span class="cx">             if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate) {
</span><del>-                if (m_currentPrimaryKey.compare(targetPrimaryKey) &gt;= 0)
</del><ins>+                if (m_currentRecord.primaryKey.compare(targetPrimaryKey) &gt;= 0)
</ins><span class="cx">                     break;
</span><del>-            } else if (m_currentPrimaryKey.compare(targetPrimaryKey) &lt;= 0)
</del><ins>+            } else if (m_currentRecord.primaryKey.compare(targetPrimaryKey) &lt;= 0)
</ins><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">             result = advance(1);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h (209892 => 209893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h        2016-12-16 01:14:40 UTC (rev 209892)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h        2016-12-16 01:20:24 UTC (rev 209893)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;IDBCursorRecord.h&quot;
</ins><span class="cx"> #include &quot;IDBIndexInfo.h&quot;
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="lines">@@ -61,9 +62,9 @@
</span><span class="cx">     int64_t objectStoreID() const { return m_objectStoreID; }
</span><span class="cx">     int64_t currentRecordRowID() const { return m_currentRecordRowID; }
</span><span class="cx"> 
</span><del>-    const IDBKeyData&amp; currentKey() const { return m_currentKey; }
-    const IDBKeyData&amp; currentPrimaryKey() const { return m_currentPrimaryKey; }
-    IDBValue* currentValue() const { return m_currentValue.get(); }
</del><ins>+    const IDBKeyData&amp; currentKey() const { return m_currentRecord.key; }
+    const IDBKeyData&amp; currentPrimaryKey() const { return m_currentRecord.primaryKey; }
+    IDBValue* currentValue() const { return m_currentRecord.value.get(); }
</ins><span class="cx"> 
</span><span class="cx">     bool advance(uint64_t count);
</span><span class="cx">     bool iterate(const IDBKeyData&amp; targetKey, const IDBKeyData&amp; targetPrimaryKey);
</span><span class="lines">@@ -105,9 +106,7 @@
</span><span class="cx">     IDBKeyData m_currentLowerKey;
</span><span class="cx">     IDBKeyData m_currentUpperKey;
</span><span class="cx"> 
</span><del>-    IDBKeyData m_currentKey;
-    IDBKeyData m_currentPrimaryKey;
-    std::unique_ptr&lt;IDBValue&gt; m_currentValue;
</del><ins>+    IDBCursorRecord m_currentRecord;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;SQLiteStatement&gt; m_statement;
</span><span class="cx">     bool m_statementNeedsReset { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBCursorRecordh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorRecord.h (0 => 209893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorRecord.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorRecord.h        2016-12-16 01:20:24 UTC (rev 209893)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKeyData.h&quot;
+#include &quot;IDBValue.h&quot;
+
+namespace WebCore {
+
+struct IDBCursorRecord {
+    IDBKeyData key;
+    IDBKeyData primaryKey;
+    std::unique_ptr&lt;IDBValue&gt; value;
+
+    template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
+    template&lt;class Decoder&gt; static bool decode(Decoder&amp;, IDBCursorRecord&amp;);
+};
+
+template&lt;class Encoder&gt;
+void IDBCursorRecord::encode(Encoder&amp; encoder) const
+{
+    encoder &lt;&lt; key &lt;&lt; primaryKey &lt;&lt; value;
+}
+
+template&lt;class Decoder&gt;
+bool IDBCursorRecord::decode(Decoder&amp; decoder, IDBCursorRecord&amp; record)
+{
+    if (!decoder.decode(record.key))
+        return false;
+
+    if (!decoder.decode(record.primaryKey))
+        return false;
+
+    if (!decoder.decode(record.value))
+        return false;
+
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209892 => 209893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-16 01:14:40 UTC (rev 209892)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-16 01:20:24 UTC (rev 209893)
</span><span class="lines">@@ -1992,6 +1992,7 @@
</span><span class="cx">                 510D4A36103165EE0049EA54 /* SocketStreamHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510D4A30103165EE0049EA54 /* SocketStreamHandle.cpp */; };
</span><span class="cx">                 510D4A37103165EE0049EA54 /* SocketStreamHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A31103165EE0049EA54 /* SocketStreamHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                5110FCFC1E03641D006F8D0B /* IDBCursorRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 5110FCFB1E0362A5006F8D0B /* IDBCursorRecord.h */; };
</ins><span class="cx">                 511EC1271C50AACA0032F983 /* IDBSerialization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC1251C50AA570032F983 /* IDBSerialization.cpp */; };
</span><span class="cx">                 511EC1281C50AACA0032F983 /* IDBSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 511EC1261C50AA570032F983 /* IDBSerialization.h */; };
</span><span class="cx">                 511EC12B1C50ABBF0032F983 /* SQLiteIDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC1291C50ABBA0032F983 /* SQLiteIDBTransaction.cpp */; };
</span><span class="lines">@@ -9184,6 +9185,7 @@
</span><span class="cx">                 510D4A30103165EE0049EA54 /* SocketStreamHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamHandle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 510D4A31103165EE0049EA54 /* SocketStreamHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandleClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5110FCFB1E0362A5006F8D0B /* IDBCursorRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorRecord.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 511EC1251C50AA570032F983 /* IDBSerialization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBSerialization.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EC1261C50AA570032F983 /* IDBSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBSerialization.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511EC1291C50ABBA0032F983 /* SQLiteIDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteIDBTransaction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17004,6 +17006,7 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 517138F91BF3ADAC000D5F01 /* IDBCursorInfo.cpp */,
</span><span class="cx">                                 517138FA1BF3ADAC000D5F01 /* IDBCursorInfo.h */,
</span><ins>+                                5110FCFB1E0362A5006F8D0B /* IDBCursorRecord.h */,
</ins><span class="cx">                                 51BA4AC11BBB5CBF00DF3D6D /* IDBDatabaseInfo.cpp */,
</span><span class="cx">                                 51BA4AC21BBB5CBF00DF3D6D /* IDBDatabaseInfo.h */,
</span><span class="cx">                                 5148453C1BB9D076006A72ED /* IDBError.cpp */,
</span><span class="lines">@@ -27205,6 +27208,7 @@
</span><span class="cx">                                 AB247A6D0AFD6383003FA5FD /* RenderSlider.h in Headers */,
</span><span class="cx">                                 31955A88160D199200858025 /* RenderSnapshottedPlugIn.h in Headers */,
</span><span class="cx">                                 BC8C8FAE0DDCD31B00B592F4 /* RenderStyle.h in Headers */,
</span><ins>+                                5110FCFC1E03641D006F8D0B /* IDBCursorRecord.h in Headers */,
</ins><span class="cx">                                 BC5EB6680E81CB7100B25965 /* RenderStyleConstants.h in Headers */,
</span><span class="cx">                                 436708C112D9CA4B00044234 /* RenderSVGBlock.h in Headers */,
</span><span class="cx">                                 436708C312D9CA4B00044234 /* RenderSVGContainer.h in Headers */,
</span></span></pre>
</div>
</div>

</body>
</html>