<!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>[192396] trunk</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/192396">192396</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-11-12 16:24:11 -0800 (Thu, 12 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: Pipe through cursor functions from client to server.
https://bugs.webkit.org/show_bug.cgi?id=151197

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/cursor-1.html
       storage/indexeddb/modern/opencursor-failures.html

This patch implements most IDBCursor considerations at the IDL level, as well as pipes the
appropriate messages through from client to server.

All operations currently end in errors. Bug 151196 will fix that by making cursors functional.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::isKeyCursor): Deleted.
* Modules/indexeddb/IDBCursorWithValue.h:

* Modules/indexeddb/IDBGetResult.h:

* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::string):
(WebCore::IDBKeyData::date):
(WebCore::IDBKeyData::number):
(WebCore::IDBKeyData::array):

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/client/IDBAnyImpl.cpp:
(WebCore::IDBClient::IDBAny::IDBAny):
(WebCore::IDBClient::IDBAny::idbCursor):
(WebCore::IDBClient::IDBAny::idbCursorWithValue):
(WebCore::IDBClient::IDBAny::idbIndex):
(WebCore::IDBClient::IDBAny::idbObjectStore):
(WebCore::IDBClient::IDBAny::modernIDBCursor):
* Modules/indexeddb/client/IDBAnyImpl.h:
(WebCore::IDBClient::IDBAny::create):

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::openCursor):
(WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
(WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
(WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::create):
(WebCore::IDBClient::IDBCursor::IDBCursor):
(WebCore::IDBClient::IDBCursor::sourcesDeleted):
(WebCore::IDBClient::IDBCursor::effectiveObjectStore):
(WebCore::IDBClient::IDBCursor::transaction):
(WebCore::IDBClient::IDBCursor::direction):
(WebCore::IDBClient::IDBCursor::key):
(WebCore::IDBClient::IDBCursor::primaryKey):
(WebCore::IDBClient::IDBCursor::value):
(WebCore::IDBClient::IDBCursor::source):
(WebCore::IDBClient::IDBCursor::update):
(WebCore::IDBClient::IDBCursor::advance):
(WebCore::IDBClient::IDBCursor::continueFunction):
(WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor):
(WebCore::IDBClient::IDBCursor::deleteFunction):
(WebCore::IDBClient::IDBCursor::setGetResult):
* Modules/indexeddb/client/IDBCursorImpl.h:
(WebCore::IDBClient::IDBCursor::info):
(WebCore::IDBClient::IDBCursor::setRequest):
(WebCore::IDBClient::IDBCursor::clearRequest):
(WebCore::IDBClient::IDBCursor::request):

* Modules/indexeddb/client/IDBCursorWithValueImpl.cpp:
(WebCore::IDBClient::IDBCursorWithValue::create):
(WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue):
(WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue):
* Modules/indexeddb/client/IDBCursorWithValueImpl.h:

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::openCursor):
(WebCore::IDBClient::IDBIndex::openKeyCursor):
* Modules/indexeddb/client/IDBIndexImpl.h:
(WebCore::IDBClient::IDBIndex::modernObjectStore):
(WebCore::IDBClient::IDBIndex::isDeleted):

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::openCursor):
(WebCore::IDBClient::IDBObjectStore::deleteFunction):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::create):
(WebCore::IDBClient::IDBRequest::IDBRequest):
(WebCore::IDBClient::IDBRequest::~IDBRequest):
(WebCore::IDBClient::IDBRequest::source):
(WebCore::IDBClient::IDBRequest::resultCursor):
(WebCore::IDBClient::IDBRequest::willIterateCursor):
(WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBClient::IDBRequest::requestCompleted):
* Modules/indexeddb/client/IDBRequestImpl.h:
(WebCore::IDBClient::IDBRequest::modernResult):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::requestOpenCursor):
(WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBClient::IDBTransaction::openCursorOnServer):
(WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer):
(WebCore::IDBClient::IDBTransaction::iterateCursor):
(WebCore::IDBClient::IDBTransaction::iterateCursorOnServer):
(WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::createTransactionOperation):

* Modules/indexeddb/legacy/LegacyCursor.cpp:
(WebCore::LegacyCursor::source):
* Modules/indexeddb/legacy/LegacyCursor.h:
(WebCore::LegacyCursor::continueFunction): Deleted.
(WebCore::LegacyCursor::isKeyCursor): Deleted.
* Modules/indexeddb/legacy/LegacyCursorWithValue.h:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
(WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::openCursor):
(WebCore::IDBServer::IDBServer::iterateCursor):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::openCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor):
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/IDBCursorInfo.cpp: Added.
(WebCore::IDBCursorInfo::objectStoreCursor):
(WebCore::IDBCursorInfo::indexCursor):
(WebCore::IDBCursorInfo::IDBCursorInfo):
(WebCore::IDBCursorInfo::isDirectionForward):
(WebCore::IDBCursorInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBCursorInfo.h: Added.
(WebCore::IDBCursorInfo::identifier):
(WebCore::IDBCursorInfo::sourceIdentifier):
(WebCore::IDBCursorInfo::cursorSource):
(WebCore::IDBCursorInfo::cursorDirection):
(WebCore::IDBCursorInfo::cursorType):

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::openCursorSuccess):
(WebCore::IDBResultData::iterateCursorSuccess):
* Modules/indexeddb/shared/IDBResultData.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didOpenCursor):
(WebCore::InProcessIDBServer::didIterateCursor):
(WebCore::InProcessIDBServer::openCursor):
(WebCore::InProcessIDBServer::iterateCursor):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyDataToJSValue):
* bindings/js/IDBBindingUtilities.h:

* platform/CrossThreadCopier.cpp:
(WebCore::IDBCursorInfo&gt;::copy):
* platform/CrossThreadCopier.h:

LayoutTests:

* storage/indexeddb/modern/cursor-1-expected.txt: Added.
* storage/indexeddb/modern/cursor-1.html: Added.
* storage/indexeddb/modern/opencursor-failures-expected.txt: Added.
* storage/indexeddb/modern/opencursor-failures.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorWithValueh">trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBGetResulth">trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyDatah">trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIndexedDBh">trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBAnyImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBAnyImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBCursorImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBCursorImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBCursorWithValueImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBCursorWithValueImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBIndexImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBIndexImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientTransactionOperationh">trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyLegacyCursorcpp">trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyLegacyCursorh">trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyLegacyCursorWithValueh">trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServerh">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiesh">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopiercpp">trunk/Source/WebCore/platform/CrossThreadCopier.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopierh">trunk/Source/WebCore/platform/CrossThreadCopier.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderncursor1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderncursor1html">trunk/LayoutTests/storage/indexeddb/modern/cursor-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopencursorfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopencursorfailureshtml">trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures.html</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBCursorInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBCursorInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/LayoutTests/ChangeLog        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-11-12  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Pipe through cursor functions from client to server.
+        https://bugs.webkit.org/show_bug.cgi?id=151197
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/cursor-1-expected.txt: Added.
+        * storage/indexeddb/modern/cursor-1.html: Added.
+        * storage/indexeddb/modern/opencursor-failures-expected.txt: Added.
+        * storage/indexeddb/modern/opencursor-failures.html: Added.
+
</ins><span class="cx"> 2015-11-12  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Layout Test js/regress/ftl-object-sub.html is flaky.
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderncursor1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt (0 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/cursor-1-expected.txt        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+This tests basic IDBCursor functionality
+Initial upgrade needed: Old version - 0 New version - 1
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: next
+Cursor source is: [object IDBObjectStore] (TestObjectStore)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: next
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursor]
+Cursor direction is: next
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: nextunique
+Cursor source is: [object IDBObjectStore] (TestObjectStore)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: nextunique
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursor]
+Cursor direction is: nextunique
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: prev
+Cursor source is: [object IDBObjectStore] (TestObjectStore)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: prev
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursor]
+Cursor direction is: prev
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: prevunique
+Cursor source is: [object IDBObjectStore] (TestObjectStore)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursorWithValue]
+Cursor direction is: prevunique
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Error opening cursor (expected for now)
+Cursor is: [object IDBCursor]
+Cursor direction is: prevunique
+Cursor source is: [object IDBIndex] (TestIndex1)
+Cursor key is: null
+Cursor primary key is: null
+Initial upgrade versionchange transaction complete
+Done
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderncursor1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/cursor-1.html (0 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/cursor-1.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/cursor-1.html        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+This tests basic IDBCursor functionality&lt;br&gt;
+&lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    log(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function log(message)
+{
+    document.getElementById(&quot;logger&quot;).innerHTML += message + &quot;&lt;br&gt;&quot;;
+}
+
+var createRequest = window.indexedDB.open(&quot;Cursor1Database&quot;, 1);
+
+function logCursor(cursor)
+{
+    log(&quot;Cursor is: &quot; + cursor);
+    log(&quot;Cursor direction is: &quot; + cursor.direction);
+    log(&quot;Cursor source is: &quot; + cursor.source + &quot; (&quot; + cursor.source.name + &quot;)&quot;);    
+    log(&quot;Cursor key is: &quot; + cursor.key);    
+    log(&quot;Cursor primary key is: &quot; + cursor.primaryKey);    
+}
+
+function setupRequest(request)
+{
+    // FIXME: Right now (until https://bugs.webkit.org/show_bug.cgi?id=151196 is resolved) what should be successful cursor operations will actually always fail.
+    request.onsuccess = function() {
+        log(&quot;Success opening cursor&quot;);
+        logCursor(request.result);  
+    }
+    request.onerror = function(e) {
+        log(&quot;Error opening cursor (expected for now)&quot;);
+        logCursor(request.result);
+        e.stopPropagation();
+    } 
+}
+
+var objectStore;
+var index;
+
+function testCursorDirection(direction)
+{
+    var range = IDBKeyRange.lowerBound(-Infinity);
+    var request = objectStore.openCursor(range, direction);
+    setupRequest(request);
+    request = index.openCursor(range, direction);
+    setupRequest(request);
+    request = index.openKeyCursor(range, direction);
+    setupRequest(request);
+}
+
+createRequest.onupgradeneeded = function(event) {
+    log(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    var database = event.target.result;
+    objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    index = objectStore.createIndex(&quot;TestIndex1&quot;, &quot;bar&quot;);
+
+    for (var i = 0; i &lt; 10; ++i) {
+        objectStore.put(&quot;Record &quot; + i, i);
+    }
+    objectStore.put({ bar: &quot;Hello&quot; }, &quot;foo&quot;);
+
+    testCursorDirection(&quot;next&quot;);
+    testCursorDirection(&quot;nextunique&quot;);
+    testCursorDirection(&quot;prev&quot;);
+    testCursorDirection(&quot;prevunique&quot;);
+      
+    versionTransaction.onabort = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        log(&quot;Initial upgrade versionchange transaction complete&quot;);
+        done();
+    }
+
+    versionTransaction.onerror = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopencursorfailuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures-expected.txt (0 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures-expected.txt        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+This tests some obvious failures that can happen while opening cursors.
+Initial upgrade needed: Old version - 0 New version - 1
+Failed to open object store cursor with invalid keypath
+Failed to open object store cursor with invalid direction
+Failed to open index cursor with invalid keypath
+Failed to open index cursor with invalid direction
+Failed to open index key cursor with invalid keypath
+Failed to open index key cursor with invalid direction
+Failed to open object store cursor on deleted object store
+Failed to open index cursor on deleted object store
+Failed to open index key cursor on deleted object store
+Initial upgrade versionchange transaction complete
+Failed to open object store cursor from completed transaction
+Failed to open index cursor from completed transaction
+Failed to open index key cursor from completed transaction
+Failed to open object store cursor from inactive transaction
+Failed to open index cursor from inactive transaction
+Failed to open index key cursor from inactive transaction
+readonly transaction complete
+Done
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopencursorfailureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures.html (0 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/opencursor-failures.html        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -0,0 +1,188 @@
</span><ins>+This tests some obvious failures that can happen while opening cursors.&lt;br&gt;
+&lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    log(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function log(message)
+{
+    document.getElementById(&quot;logger&quot;).innerHTML += message + &quot;&lt;br&gt;&quot;;
+}
+
+var createRequest = window.indexedDB.open(&quot;OpenCursorFailuresDatabase&quot;, 1);
+var database;
+var objectStore;
+var index;
+
+createRequest.onupgradeneeded = function(event) {
+    log(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    database = event.target.result;
+    objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    index = objectStore.createIndex(&quot;TestIndex&quot;, &quot;bar&quot;);
+    var request = objectStore.put({ bar: &quot;bar&quot; }, &quot;foo&quot;);
+
+    request.onsuccess = function() {
+        try {
+            objectStore.openCursor(NaN);
+        } catch(e) {
+            log(&quot;Failed to open object store cursor with invalid keypath&quot;);
+        }
+        
+        try {
+            objectStore.openCursor(&quot;foo&quot;, &quot;invalid direction&quot;);
+        } catch(e) {
+            log(&quot;Failed to open object store cursor with invalid direction&quot;);
+        }
+        
+        try {
+            index.openCursor(NaN);
+        } catch(e) {
+            log(&quot;Failed to open index cursor with invalid keypath&quot;);
+        }
+
+        try {
+            index.openCursor(&quot;foo&quot;, &quot;invalid direction&quot;);
+        } catch(e) {
+            log(&quot;Failed to open index cursor with invalid direction&quot;);
+        }
+
+        try {
+            index.openKeyCursor(NaN);
+        } catch(e) {
+            log(&quot;Failed to open index key cursor with invalid keypath&quot;);
+        }
+
+        try {
+            index.openKeyCursor(&quot;foo&quot;, &quot;invalid direction&quot;);
+        } catch(e) {
+            log(&quot;Failed to open index key cursor with invalid direction&quot;);
+        }
+        
+        database.deleteObjectStore(&quot;TestObjectStore&quot;);
+        
+        try {
+            objectStore.openCursor();
+        } catch(e) {
+            log(&quot;Failed to open object store cursor on deleted object store&quot;);
+        }
+        
+        try {
+            index.openCursor();
+        } catch(e) {
+            log(&quot;Failed to open index cursor on deleted object store&quot;);
+        }
+
+        try {
+            index.openKeyCursor();
+        } catch(e) {
+            log(&quot;Failed to open index key cursor on deleted object store&quot;);
+        }
+        
+        // Recreate the objectstore because we'll need it in phase 2.
+        objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+        index = objectStore.createIndex(&quot;TestIndex&quot;, &quot;bar&quot;);
+        objectStore.put({ bar: &quot;bar&quot; }, &quot;foo&quot;);
+    }
+    
+    versionTransaction.onabort = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        log(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+    }
+
+    versionTransaction.onerror = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest1()
+{
+    try {
+        objectStore.openCursor();
+    } catch(e) {
+        log(&quot;Failed to open object store cursor from completed transaction&quot;);
+    }
+    
+    try {
+        index.openCursor();
+    } catch(e) {
+        log(&quot;Failed to open index cursor from completed transaction&quot;);
+    }
+
+    try {
+        index.openKeyCursor();
+    } catch(e) {
+        log(&quot;Failed to open index key cursor from completed transaction&quot;);
+    }
+        
+    var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readonly&quot;);
+    objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+    index = objectStore.index(&quot;TestIndex&quot;);
+
+    // Spin the transaction with get requests to keep it alive long enough for the setTimeout to fire.
+    var canFinish = false;
+    var spinGet = function() { 
+        objectStore.get(&quot;foo&quot;).onsuccess = function() {
+            if (!canFinish)
+                spinGet();
+        }
+    }
+    spinGet();
+
+    var getWhileInactive = function() {
+        try {
+            objectStore.openCursor();
+        } catch(e) {
+            log(&quot;Failed to open object store cursor from inactive transaction&quot;);
+        }
+    
+        try {
+            index.openCursor();
+        } catch(e) {
+            log(&quot;Failed to open index cursor from inactive transaction&quot;);
+        }
+
+        try {
+            index.openKeyCursor();
+        } catch(e) {
+            log(&quot;Failed to open index key cursor from inactive transaction&quot;);
+        }
+        canFinish = true;
+    }
+    
+    setTimeout(getWhileInactive, 0);
+    
+    transaction.onabort = function(event) {
+        log(&quot;readonly transaction unexpected abort&quot; + event);
+        done();
+    }
+
+    transaction.oncomplete = function(event) {
+        log(&quot;readonly transaction complete&quot;);
+        done();
+    }
+
+    transaction.onerror = function(event) {
+        log(&quot;readonly transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -912,6 +912,7 @@
</span><span class="cx">     Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
</span><span class="cx">     Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
</span><span class="cx"> 
</span><ins>+    Modules/indexeddb/shared/IDBCursorInfo.cpp
</ins><span class="cx">     Modules/indexeddb/shared/IDBDatabaseInfo.cpp
</span><span class="cx">     Modules/indexeddb/shared/IDBError.cpp
</span><span class="cx">     Modules/indexeddb/shared/IDBIndexInfo.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/ChangeLog        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -1,3 +1,192 @@
</span><ins>+2015-11-12  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Pipe through cursor functions from client to server.
+        https://bugs.webkit.org/show_bug.cgi?id=151197
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/cursor-1.html
+               storage/indexeddb/modern/opencursor-failures.html
+
+        This patch implements most IDBCursor considerations at the IDL level, as well as pipes the
+        appropriate messages through from client to server.
+        
+        All operations currently end in errors. Bug 151196 will fix that by making cursors functional.
+        
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * Modules/indexeddb/IDBCursor.h:
+        (WebCore::IDBCursor::isKeyCursor): Deleted.
+        * Modules/indexeddb/IDBCursorWithValue.h:
+
+        * Modules/indexeddb/IDBGetResult.h:
+
+        * Modules/indexeddb/IDBKeyData.h:
+        (WebCore::IDBKeyData::string):
+        (WebCore::IDBKeyData::date):
+        (WebCore::IDBKeyData::number):
+        (WebCore::IDBKeyData::array):
+
+        * Modules/indexeddb/IndexedDB.h:
+
+        * Modules/indexeddb/client/IDBAnyImpl.cpp:
+        (WebCore::IDBClient::IDBAny::IDBAny):
+        (WebCore::IDBClient::IDBAny::idbCursor):
+        (WebCore::IDBClient::IDBAny::idbCursorWithValue):
+        (WebCore::IDBClient::IDBAny::idbIndex):
+        (WebCore::IDBClient::IDBAny::idbObjectStore):
+        (WebCore::IDBClient::IDBAny::modernIDBCursor):
+        * Modules/indexeddb/client/IDBAnyImpl.h:
+        (WebCore::IDBClient::IDBAny::create):
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::openCursor):
+        (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
+        (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
+        (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+        * Modules/indexeddb/client/IDBCursorImpl.cpp:
+        (WebCore::IDBClient::IDBCursor::create):
+        (WebCore::IDBClient::IDBCursor::IDBCursor):
+        (WebCore::IDBClient::IDBCursor::sourcesDeleted):
+        (WebCore::IDBClient::IDBCursor::effectiveObjectStore):
+        (WebCore::IDBClient::IDBCursor::transaction):
+        (WebCore::IDBClient::IDBCursor::direction):
+        (WebCore::IDBClient::IDBCursor::key):
+        (WebCore::IDBClient::IDBCursor::primaryKey):
+        (WebCore::IDBClient::IDBCursor::value):
+        (WebCore::IDBClient::IDBCursor::source):
+        (WebCore::IDBClient::IDBCursor::update):
+        (WebCore::IDBClient::IDBCursor::advance):
+        (WebCore::IDBClient::IDBCursor::continueFunction):
+        (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor):
+        (WebCore::IDBClient::IDBCursor::deleteFunction):
+        (WebCore::IDBClient::IDBCursor::setGetResult):
+        * Modules/indexeddb/client/IDBCursorImpl.h:
+        (WebCore::IDBClient::IDBCursor::info):
+        (WebCore::IDBClient::IDBCursor::setRequest):
+        (WebCore::IDBClient::IDBCursor::clearRequest):
+        (WebCore::IDBClient::IDBCursor::request):
+
+        * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp:
+        (WebCore::IDBClient::IDBCursorWithValue::create):
+        (WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue):
+        (WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue):
+        * Modules/indexeddb/client/IDBCursorWithValueImpl.h:
+
+        * Modules/indexeddb/client/IDBIndexImpl.cpp:
+        (WebCore::IDBClient::IDBIndex::openCursor):
+        (WebCore::IDBClient::IDBIndex::openKeyCursor):
+        * Modules/indexeddb/client/IDBIndexImpl.h:
+        (WebCore::IDBClient::IDBIndex::modernObjectStore):
+        (WebCore::IDBClient::IDBIndex::isDeleted):
+
+        * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+        (WebCore::IDBClient::IDBObjectStore::openCursor):
+        (WebCore::IDBClient::IDBObjectStore::deleteFunction):
+        * Modules/indexeddb/client/IDBObjectStoreImpl.h:
+
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::create):
+        (WebCore::IDBClient::IDBRequest::IDBRequest):
+        (WebCore::IDBClient::IDBRequest::~IDBRequest):
+        (WebCore::IDBClient::IDBRequest::source):
+        (WebCore::IDBClient::IDBRequest::resultCursor):
+        (WebCore::IDBClient::IDBRequest::willIterateCursor):
+        (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
+        (WebCore::IDBClient::IDBRequest::requestCompleted):
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+        (WebCore::IDBClient::IDBRequest::modernResult):
+
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::requestOpenCursor):
+        (WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
+        (WebCore::IDBClient::IDBTransaction::openCursorOnServer):
+        (WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer):
+        (WebCore::IDBClient::IDBTransaction::iterateCursor):
+        (WebCore::IDBClient::IDBTransaction::iterateCursorOnServer):
+        (WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+
+        * Modules/indexeddb/client/TransactionOperation.h:
+        (WebCore::IDBClient::createTransactionOperation):
+
+        * Modules/indexeddb/legacy/LegacyCursor.cpp:
+        (WebCore::LegacyCursor::source):
+        * Modules/indexeddb/legacy/LegacyCursor.h:
+        (WebCore::LegacyCursor::continueFunction): Deleted.
+        (WebCore::LegacyCursor::isKeyCursor): Deleted.
+        * Modules/indexeddb/legacy/LegacyCursorWithValue.h:
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
+        (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::openCursor):
+        (WebCore::IDBServer::IDBServer::iterateCursor):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
+        (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
+        (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor):
+        (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
+        (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+        * Modules/indexeddb/shared/IDBCursorInfo.cpp: Added.
+        (WebCore::IDBCursorInfo::objectStoreCursor):
+        (WebCore::IDBCursorInfo::indexCursor):
+        (WebCore::IDBCursorInfo::IDBCursorInfo):
+        (WebCore::IDBCursorInfo::isDirectionForward):
+        (WebCore::IDBCursorInfo::isolatedCopy):
+        * Modules/indexeddb/shared/IDBCursorInfo.h: Added.
+        (WebCore::IDBCursorInfo::identifier):
+        (WebCore::IDBCursorInfo::sourceIdentifier):
+        (WebCore::IDBCursorInfo::cursorSource):
+        (WebCore::IDBCursorInfo::cursorDirection):
+        (WebCore::IDBCursorInfo::cursorType):
+
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::openCursorSuccess):
+        (WebCore::IDBResultData::iterateCursorSuccess):
+        * Modules/indexeddb/shared/IDBResultData.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::didOpenCursor):
+        (WebCore::InProcessIDBServer::didIterateCursor):
+        (WebCore::InProcessIDBServer::openCursor):
+        (WebCore::InProcessIDBServer::iterateCursor):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::idbKeyDataToJSValue):
+        * bindings/js/IDBBindingUtilities.h:
+
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::IDBCursorInfo&gt;::copy):
+        * platform/CrossThreadCopier.h:
+
</ins><span class="cx"> 2015-11-12  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Delete PlatformMenuDescription.h
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     virtual const Deprecated::ScriptValue&amp; key() const = 0;
</span><span class="cx">     virtual const Deprecated::ScriptValue&amp; primaryKey() const = 0;
</span><span class="cx">     virtual const Deprecated::ScriptValue&amp; value() const = 0;
</span><del>-    virtual IDBAny* source() const = 0;
</del><ins>+    virtual IDBAny* source() = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual RefPtr&lt;IDBRequest&gt; update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCode&amp;) = 0;
</span><span class="cx">     virtual void advance(unsigned long, ExceptionCode&amp;) = 0;
</span><span class="lines">@@ -72,10 +72,10 @@
</span><span class="cx">     virtual void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) = 0;
</span><span class="cx">     virtual RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext*, ExceptionCode&amp;) = 0;
</span><span class="cx"> 
</span><ins>+    virtual bool isKeyCursor() const = 0;
+
</ins><span class="cx"> protected:
</span><span class="cx">     IDBCursor();
</span><del>-
-    virtual bool isKeyCursor() const { return true; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorWithValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -38,8 +38,6 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     IDBCursorWithValue();
</span><del>-
-    virtual bool isKeyCursor() const override { return false; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBGetResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx"> 
</span><span class="cx">     ThreadSafeDataBuffer valueBuffer;
</span><span class="cx">     IDBKeyData keyData;
</span><ins>+    IDBKeyData primaryKeyData;
</ins><span class="cx">     IDBKeyPath keyPath;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -128,6 +128,30 @@
</span><span class="cx">     static IDBKeyData deletedValue();
</span><span class="cx">     bool isDeletedValue() const { return m_isDeletedValue; }
</span><span class="cx"> 
</span><ins>+    String string() const
+    {
+        ASSERT(m_type == KeyType::String);
+        return m_stringValue;
+    }
+
+    double date() const
+    {
+        ASSERT(m_type == KeyType::Date);
+        return m_numberValue;
+    }
+
+    double number() const
+    {
+        ASSERT(m_type == KeyType::Number);
+        return m_numberValue;
+    }
+
+    const Vector&lt;IDBKeyData&gt;&amp; array() const
+    {
+        ASSERT(m_type == KeyType::Array);
+        return m_arrayValue;
+    }
+
</ins><span class="cx"> private:
</span><span class="cx">     KeyType m_type;
</span><span class="cx">     Vector&lt;IDBKeyData&gt; m_arrayValue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIndexedDBh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -61,6 +61,11 @@
</span><span class="cx"> };
</span><span class="cx"> const unsigned CursorTypeMaximum = 1;
</span><span class="cx"> 
</span><ins>+enum class CursorSource {
+    Index,
+    ObjectStore,
+};
+
</ins><span class="cx"> enum class VersionNullness {
</span><span class="cx">     Null,
</span><span class="cx">     NonNull,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBAnyImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBAny.h&quot;
</span><del>-#include &quot;IDBCursorWithValue.h&quot;
</del><ins>+#include &quot;IDBCursorImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBFactory.h&quot;
</span><span class="cx"> #include &quot;IDBIndex.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -59,6 +59,17 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBAny::IDBAny(Ref&lt;IDBCursor&gt;&amp;&amp; cursor)
+{
+    if (cursor-&gt;isKeyCursor()) {
+        m_type = IDBAny::Type::IDBCursor;
+        m_cursor = WTF::move(cursor);
+    } else {
+        m_type = IDBAny::Type::IDBCursorWithValue;
+        m_cursorWithValue = WTF::move(cursor);
+    }
+}
+
</ins><span class="cx"> IDBAny::IDBAny(const IDBKeyPath&amp; keyPath)
</span><span class="cx">     : m_type(IDBAny::Type::KeyPath)
</span><span class="cx">     , m_idbKeyPath(keyPath)
</span><span class="lines">@@ -88,12 +99,14 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBCursor&gt; IDBAny::idbCursor()
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    ASSERT(m_type == IDBAny::Type::IDBCursor || m_type == IDBAny::Type::IDBCursorWithValue);
+    return m_cursor.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBCursorWithValue&gt; IDBAny::idbCursorWithValue()
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    ASSERT(m_type == IDBAny::Type::IDBCursorWithValue);
+    return m_cursorWithValue.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBFactory&gt; IDBAny::idbFactory()
</span><span class="lines">@@ -103,12 +116,14 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBIndex&gt; IDBAny::idbIndex()
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    ASSERT(m_type == IDBAny::Type::IDBIndex);
+    return m_index.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBObjectStore&gt; IDBAny::idbObjectStore()
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    ASSERT(m_type == IDBAny::Type::IDBObjectStore);
+    return m_objectStore.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBObjectStore* IDBAny::modernIDBObjectStore()
</span><span class="lines">@@ -123,6 +138,12 @@
</span><span class="cx">     return m_index.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBCursor* IDBAny::modernIDBCursor()
+{
+    ASSERT(m_type == IDBAny::Type::IDBCursor || m_type == IDBAny::Type::IDBCursorWithValue);
+    return m_cursor.get();
+}
+
</ins><span class="cx"> RefPtr&lt;WebCore::IDBTransaction&gt; IDBAny::idbTransaction()
</span><span class="cx"> {
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBAnyImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -43,16 +43,21 @@
</span><span class="cx">         return adoptRef(new IDBAny(WTF::move(database)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBAny&gt; create(Ref&lt;IDBObjectStore&gt;&amp;&amp; objectStore)
</del><ins>+    static Ref&lt;IDBAny&gt; create(Ref&lt;IDBObjectStore&gt;&amp;&amp; objectStore)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new IDBAny(WTF::move(objectStore)));
</del><ins>+        return adoptRef(*new IDBAny(WTF::move(objectStore)));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static RefPtr&lt;IDBAny&gt; create(Ref&lt;IDBIndex&gt;&amp;&amp; index)
</del><ins>+    static Ref&lt;IDBAny&gt; create(Ref&lt;IDBIndex&gt;&amp;&amp; index)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new IDBAny(WTF::move(index)));
</del><ins>+        return adoptRef(*new IDBAny(WTF::move(index)));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static RefPtr&lt;IDBAny&gt; create(Ref&lt;IDBCursor&gt;&amp;&amp; cursor)
+    {
+        return adoptRef(new IDBAny(WTF::move(cursor)));
+    }
+
</ins><span class="cx">     static RefPtr&lt;IDBAny&gt; create(const IDBKeyPath&amp; keyPath)
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(new IDBAny(keyPath));
</span><span class="lines">@@ -86,12 +91,14 @@
</span><span class="cx"> 
</span><span class="cx">     IDBObjectStore* modernIDBObjectStore();
</span><span class="cx">     IDBIndex* modernIDBIndex();
</span><ins>+    IDBCursor* modernIDBCursor();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit IDBAny(IDBAny::Type);
</span><span class="cx">     explicit IDBAny(Ref&lt;IDBDatabase&gt;&amp;&amp;);
</span><span class="cx">     explicit IDBAny(Ref&lt;IDBObjectStore&gt;&amp;&amp;);
</span><span class="cx">     explicit IDBAny(Ref&lt;IDBIndex&gt;&amp;&amp;);
</span><ins>+    explicit IDBAny(Ref&lt;IDBCursor&gt;&amp;&amp;);
</ins><span class="cx">     explicit IDBAny(const IDBKeyPath&amp;);
</span><span class="cx">     explicit IDBAny(const Deprecated::ScriptValue&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -99,6 +106,8 @@
</span><span class="cx">     RefPtr&lt;IDBDatabase&gt; m_database;
</span><span class="cx">     RefPtr&lt;IDBObjectStore&gt; m_objectStore;
</span><span class="cx">     RefPtr&lt;IDBIndex&gt; m_index;
</span><ins>+    RefPtr&lt;IDBCursor&gt; m_cursor;
+    RefPtr&lt;IDBCursor&gt; m_cursorWithValue;
</ins><span class="cx"> 
</span><span class="cx">     const IDBKeyPath m_idbKeyPath;
</span><span class="cx">     const Deprecated::ScriptValue m_scriptValue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -217,6 +217,34 @@
</span><span class="cx">     completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToServer::openCursor(TransactionOperation&amp; operation, const IDBCursorInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::openCursor&quot;);
+
+    saveOperation(operation);
+    m_delegate-&gt;openCursor(IDBRequestData(operation), info);
+}
+
+void IDBConnectionToServer::didOpenCursor(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didOpenCursor&quot;);
+    completeOperation(resultData);
+}
+
+void IDBConnectionToServer::iterateCursor(TransactionOperation&amp; operation, const IDBKeyData&amp; key, unsigned long count)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::iterateCursor&quot;);
+
+    saveOperation(operation);
+    m_delegate-&gt;iterateCursor(IDBRequestData(operation), key, count);
+}
+
+void IDBConnectionToServer::didIterateCursor(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didIterateCursor&quot;);
+    completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::establishTransaction(IDBTransaction&amp; transaction)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBConnectionToServer::establishTransaction&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBError;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBResultData;
</span><span class="lines">@@ -85,6 +86,12 @@
</span><span class="cx">     void deleteRecord(TransactionOperation&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void didDeleteRecord(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void openCursor(TransactionOperation&amp;, const IDBCursorInfo&amp;);
+    void didOpenCursor(const IDBResultData&amp;);
+
+    void iterateCursor(TransactionOperation&amp;, const IDBKeyData&amp;, unsigned long count);
+    void didIterateCursor(const IDBResultData&amp;);
+
</ins><span class="cx">     void commitTransaction(IDBTransaction&amp;);
</span><span class="cx">     void didCommitTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -32,8 +32,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBIndexInfo;
</span><span class="cx"> class IDBKey;
</span><ins>+class IDBKeyData;
</ins><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBResourceIdentifier;
</span><span class="lines">@@ -65,6 +67,9 @@
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><ins>+    virtual void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;) = 0;
+    virtual void iterateCursor(const IDBRequestData&amp;, const IDBKeyData&amp;, unsigned long count) = 0;
+
</ins><span class="cx">     virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp;) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBCursorImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -28,63 +28,263 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;DOMRequestState.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;IDBBindingUtilities.h&quot;
+#include &quot;IDBDatabaseException.h&quot;
+#include &quot;IDBGetResult.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;ScriptExecutionContext.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBCursor&gt; IDBCursor::create(IDBTransaction&amp; transaction, IDBIndex&amp; index, const IDBCursorInfo&amp; info)
+{
+    return adoptRef(*new IDBCursor(transaction, index, info));
+}
+
+IDBCursor::IDBCursor(IDBTransaction&amp;, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
+    : m_info(info)
+    , m_source(IDBAny::create(objectStore).leakRef())
+    , m_objectStore(&amp;objectStore)
+{
+}
+
+IDBCursor::IDBCursor(IDBTransaction&amp;, IDBIndex&amp; index, const IDBCursorInfo&amp; info)
+    : m_info(info)
+    , m_source(IDBAny::create(index).leakRef())
+    , m_index(&amp;index)
+{
+}
+
</ins><span class="cx"> IDBCursor::~IDBCursor()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool IDBCursor::sourcesDeleted() const
+{
+    if (m_objectStore)
+        return m_objectStore-&gt;isDeleted();
+
+    ASSERT(m_index);
+    return m_index-&gt;isDeleted() || m_index-&gt;modernObjectStore().isDeleted();
+}
+
+IDBObjectStore&amp; IDBCursor::effectiveObjectStore() const
+{
+    if (m_objectStore)
+        return *m_objectStore;
+
+    ASSERT(m_index);
+    return m_index-&gt;modernObjectStore();
+}
+
+IDBTransaction&amp; IDBCursor::transaction() const
+{
+    return effectiveObjectStore().modernTransaction();
+}
+
</ins><span class="cx"> const String&amp; IDBCursor::direction() const
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return IDBCursor::directionToString(m_info.cursorDirection());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const Deprecated::ScriptValue&amp; IDBCursor::key() const
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return m_deprecatedCurrentKey;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const Deprecated::ScriptValue&amp; IDBCursor::primaryKey() const
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return m_deprecatedCurrentPrimaryKey;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const Deprecated::ScriptValue&amp; IDBCursor::value() const
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return m_deprecatedCurrentValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBAny* IDBCursor::source() const
</del><ins>+IDBAny* IDBCursor::source()
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return &amp;m_source.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBCursor::update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBCursor::update(JSC::ExecState&amp; exec, Deprecated::ScriptValue&amp; value, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBCursor::advance&quot;);
+
+    if (sourcesDeleted()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (!transaction().isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return nullptr;
+    }
+
+    if (transaction().isReadOnly()) {
+        ec = IDBDatabaseException::ReadOnlyError;
+        return nullptr;
+    }
+
+    if (!m_gotValue) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (isKeyCursor()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    return effectiveObjectStore().put(exec, value.jsValue(), m_deprecatedCurrentPrimaryKey.jsValue(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::advance(unsigned long, ExceptionCode&amp;)
</del><ins>+void IDBCursor::advance(unsigned long count, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBCursor::advance&quot;);
+
+    if (!m_request) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+    
+    if (!count) {
+        ec = TypeError;
+        return;
+    }
+
+    if (sourcesDeleted()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    if (!transaction().isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return;
+    }
+
+    if (!m_gotValue) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    uncheckedIteratorCursor(IDBKeyData(), count);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::continueFunction(ScriptExecutionContext*, ExceptionCode&amp;)
</del><ins>+void IDBCursor::continueFunction(ScriptExecutionContext* context, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    if (!context) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    continueFunction(IDBKeyData(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBCursor::continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</del><ins>+void IDBCursor::continueFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; keyValue, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    if (!context) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    DOMRequestState requestState(context);
+    RefPtr&lt;IDBKey&gt; key = scriptValueToIDBKey(&amp;requestState, keyValue);
+    continueFunction(key.get(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBCursor::deleteFunction(ScriptExecutionContext*, ExceptionCode&amp;)
</del><ins>+void IDBCursor::continueFunction(const IDBKeyData&amp; key, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBCursor::continueFunction&quot;);
+
+    if (!m_request) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    if (sourcesDeleted()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    if (!transaction().isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return;
+    }
+
+    if (!m_gotValue) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return;
+    }
+
+    if (!key.isValid()) {
+        ec = IDBDatabaseException::DataError;
+        return;
+    }
+
+    if (m_info.isDirectionForward()) {
+        if (key.compare(m_currentPrimaryKeyData) &lt;= 0) {
+            ec = IDBDatabaseException::DataError;
+            return;
+        }
+    } else if (key.compare(m_currentPrimaryKeyData) &gt;= 0) {
+        ec = IDBDatabaseException::DataError;
+        return;
+    }
+
+    uncheckedIteratorCursor(key, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBCursor::uncheckedIteratorCursor(const IDBKeyData&amp; key, unsigned long count)
+{
+    m_request-&gt;willIterateCursor(*this);
+    transaction().iterateCursor(*this, key, count);
+}
+
+RefPtr&lt;WebCore::IDBRequest&gt; IDBCursor::deleteFunction(ScriptExecutionContext* context, ExceptionCode&amp; ec)
+{
+    LOG(IndexedDB, &quot;IDBCursor::deleteFunction&quot;);
+
+    if (!context) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (sourcesDeleted()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (!transaction().isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return nullptr;
+    }
+
+    if (transaction().isReadOnly()) {
+        ec = IDBDatabaseException::ReadOnlyError;
+        return nullptr;
+    }
+
+    if (!m_gotValue) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    return effectiveObjectStore().deleteFunction(context, m_deprecatedCurrentPrimaryKey.jsValue(), ec);
+}
+
+void IDBCursor::setGetResult(const IDBGetResult&amp;)
+{
+    LOG(IndexedDB, &quot;IDBCursor::setGetResult&quot;);
+
+    // FIXME: Implement.
+
+    m_gotValue = true;
+}
+
</ins><span class="cx"> } // namespace IDBClient
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBCursorImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -28,13 +28,24 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;IDBAnyImpl.h&quot;
+#include &quot;IDBCursorInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBCursorWithValue.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+
+struct IDBGetResult;
+
</ins><span class="cx"> namespace IDBClient {
</span><span class="cx"> 
</span><ins>+class IDBIndex;
+class IDBObjectStore;
+class IDBTransaction;
+
</ins><span class="cx"> class IDBCursor : public WebCore::IDBCursorWithValue {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;IDBCursor&gt; create(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
+
</ins><span class="cx">     virtual ~IDBCursor();
</span><span class="cx"> 
</span><span class="cx">     // Implement the IDL
</span><span class="lines">@@ -42,16 +53,52 @@
</span><span class="cx">     virtual const Deprecated::ScriptValue&amp; key() const override final;
</span><span class="cx">     virtual const Deprecated::ScriptValue&amp; primaryKey() const override final;
</span><span class="cx">     virtual const Deprecated::ScriptValue&amp; value() const override final;
</span><del>-    virtual IDBAny* source() const override final;
</del><ins>+    virtual IDBAny* source() override final;
</ins><span class="cx"> 
</span><del>-    virtual RefPtr&lt;IDBRequest&gt; update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCode&amp;) override final;
</del><ins>+    virtual RefPtr&lt;WebCore::IDBRequest&gt; update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCode&amp;) override final;
</ins><span class="cx">     virtual void advance(unsigned long, ExceptionCode&amp;) override final;
</span><span class="cx">     virtual void continueFunction(ScriptExecutionContext*, ExceptionCode&amp;) override final;
</span><span class="cx">     virtual void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
</span><del>-    virtual RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext*, ExceptionCode&amp;) override final;
</del><ins>+    virtual RefPtr&lt;WebCore::IDBRequest&gt; deleteFunction(ScriptExecutionContext*, ExceptionCode&amp;) override final;
</ins><span class="cx"> 
</span><ins>+    void continueFunction(const IDBKeyData&amp;, ExceptionCode&amp;);
+
+    const IDBCursorInfo&amp; info() const { return m_info; }
+
+    void setRequest(IDBRequest&amp; request) { m_request = &amp;request; }
+    void clearRequest() { m_request = nullptr; }
+    IDBRequest* request() { return m_request; }
+
+    void setGetResult(const IDBGetResult&amp;);
+
+    virtual bool isKeyCursor() const override { return true; }
+
</ins><span class="cx"> protected:
</span><del>-    IDBCursor();
</del><ins>+    IDBCursor(IDBTransaction&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
+    IDBCursor(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
+
+private:
+    IDBCursorInfo m_info;
+    Ref&lt;IDBAny&gt; m_source;
+    IDBObjectStore* m_objectStore { nullptr };
+    IDBIndex* m_index { nullptr };
+    IDBRequest* m_request;
+
+    bool sourcesDeleted() const;
+    IDBObjectStore&amp; effectiveObjectStore() const;
+    IDBTransaction&amp; transaction() const;
+
+    void uncheckedIteratorCursor(const IDBKeyData&amp;, unsigned long count);
+
+    bool m_gotValue { false };
+
+    IDBKeyData m_currentPrimaryKeyData;
+
+    // FIXME: When ditching Legacy IDB and combining this implementation with the abstract IDBCursor,
+    // these Deprecated::ScriptValue members should be JSValues instead.
+    Deprecated::ScriptValue m_deprecatedCurrentKey;
+    Deprecated::ScriptValue m_deprecatedCurrentPrimaryKey;
+    Deprecated::ScriptValue m_deprecatedCurrentValue;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBCursorWithValueImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -29,7 +29,33 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+namespace IDBClient {
</ins><span class="cx"> 
</span><ins>+Ref&lt;IDBCursorWithValue&gt; IDBCursorWithValue::create(IDBTransaction&amp; transaction, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
+{
+    return adoptRef(*new IDBCursorWithValue(transaction, objectStore, info));
+}
+
+Ref&lt;IDBCursorWithValue&gt; IDBCursorWithValue::create(IDBTransaction&amp; transaction, IDBIndex&amp; index, const IDBCursorInfo&amp; info)
+{
+    return adoptRef(*new IDBCursorWithValue(transaction, index, info));
+}
+
+IDBCursorWithValue::IDBCursorWithValue(IDBTransaction&amp; transaction, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
+    : IDBCursor(transaction, objectStore, info)
+{
+}
+
+IDBCursorWithValue::IDBCursorWithValue(IDBTransaction&amp; transaction, IDBIndex&amp; index, const IDBCursorInfo&amp; info)
+    : IDBCursor(transaction, index, info)
+{
+}
+
+IDBCursorWithValue::~IDBCursorWithValue()
+{
+}
+
+} // namespace IDBClient
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBCursorWithValueImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -35,10 +35,16 @@
</span><span class="cx"> 
</span><span class="cx"> class IDBCursorWithValue : public IDBCursor {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;IDBCursorWithValue&gt; create(IDBTransaction&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
+    static Ref&lt;IDBCursorWithValue&gt; create(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
+
</ins><span class="cx">     virtual ~IDBCursorWithValue();
</span><span class="cx"> 
</span><ins>+    virtual bool isKeyCursor() const override final { return false; }
+
</ins><span class="cx"> private:
</span><del>-    IDBCursorWithValue();
</del><ins>+    IDBCursorWithValue(IDBTransaction&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
+    IDBCursorWithValue(IDBTransaction&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBIndexImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> #include &quot;DOMRequestState.h&quot;
</span><span class="cx"> #include &quot;IDBAnyImpl.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><ins>+#include &quot;IDBCursorImpl.h&quot;
+#include &quot;IDBDatabaseException.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStoreImpl.h&quot;
</span><span class="cx"> #include &quot;IDBTransactionImpl.h&quot;
</span><span class="lines">@@ -84,14 +86,37 @@
</span><span class="cx">     return m_info.multiEntry();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext* context, IDBKeyRange* range, const String&amp; directionString, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBIndex::openCursor&quot;);
+
+    if (m_deleted || m_objectStore-&gt;isDeleted()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (!m_objectStore-&gt;modernTransaction().isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return nullptr;
+    }
+
+    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
+    if (ec)
+        return nullptr;
+
+    auto info = IDBCursorInfo::indexCursor(m_objectStore-&gt;modernTransaction(), m_info.identifier(), range, direction, IndexedDB::CursorType::KeyAndValue);
+    Ref&lt;IDBRequest&gt; request = m_objectStore-&gt;modernTransaction().requestOpenCursor(*context, *this, info);
+    return WTF::move(request);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBIndex::openCursor&quot;);
+    RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(context, key, ec);
+    if (ec)
+        return nullptr;
+
+    return openCursor(context, keyRange.get(), direction, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::count(ScriptExecutionContext* context, ExceptionCode&amp; ec)
</span><span class="lines">@@ -159,14 +184,37 @@
</span><span class="cx">     return transaction.requestCount(context, *this, range);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext* context, IDBKeyRange* range, const String&amp; directionString, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBIndex::openKeyCursor&quot;);
+
+    if (m_deleted || m_objectStore-&gt;isDeleted()) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (!m_objectStore-&gt;modernTransaction().isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return nullptr;
+    }
+
+    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
+    if (ec)
+        return nullptr;
+
+    auto info = IDBCursorInfo::indexCursor(m_objectStore-&gt;modernTransaction(), m_info.identifier(), range, direction, IndexedDB::CursorType::KeyOnly);
+    Ref&lt;IDBRequest&gt; request = m_objectStore-&gt;modernTransaction().requestOpenCursor(*context, *this, info);
+    return WTF::move(request);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBIndex::openKeyCursor&quot;);
+    RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(context, key, ec);
+    if (ec)
+        return nullptr;
+
+    return openKeyCursor(context, keyRange.get(), direction, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::get(ScriptExecutionContext* context, IDBKeyRange* range, ExceptionCode&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBIndexImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -77,6 +77,9 @@
</span><span class="cx"> 
</span><span class="cx">     const IDBIndexInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><ins>+    IDBObjectStore&amp; modernObjectStore() { return m_objectStore.get(); }
+    bool isDeleted() const { return m_deleted; }
+
</ins><span class="cx"> private:
</span><span class="cx">     IDBIndex(const IDBIndexInfo&amp;, IDBObjectStore&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMRequestState.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><ins>+#include &quot;IDBCursorImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBIndexImpl.h&quot;
</span><span class="lines">@@ -89,29 +90,51 @@
</span><span class="cx">     return m_info.autoIncrement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext*, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext* context, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return openCursor(context, static_cast&lt;IDBKeyRange*&gt;(nullptr), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return openCursor(context, keyRange, IDBCursor::directionNext(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return openCursor(context, key, IDBCursor::directionNext(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext* context, IDBKeyRange* range, const String&amp; directionString, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBObjectStore::openCursor&quot;);
+
+    if (m_deleted) {
+        ec = IDBDatabaseException::InvalidStateError;
+        return nullptr;
+    }
+
+    if (!m_transaction-&gt;isActive()) {
+        ec = IDBDatabaseException::TransactionInactiveError;
+        return nullptr;
+    }
+
+    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec);
+    if (ec)
+        return nullptr;
+
+    auto info = IDBCursorInfo::objectStoreCursor(m_transaction.get(), m_info.identifier(), range, direction);
+    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestOpenCursor(*context, *this, info);
+    return WTF::move(request);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    RefPtr&lt;IDBKeyRange&gt; keyRange = IDBKeyRange::only(context, key, ec);
+    if (ec)
+        return 0;
+
+    return openCursor(context, keyRange.get(), direction, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::get(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp; ec)
</span><span class="lines">@@ -308,6 +331,11 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::deleteFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><ins>+    return deleteFunction(context, key.jsValue(), ec);
+}
+
+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::deleteFunction(ScriptExecutionContext* context, JSC::JSValue key, ExceptionCode&amp; ec)
+{
</ins><span class="cx">     DOMRequestState requestState(context);
</span><span class="cx">     RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(&amp;requestState, key);
</span><span class="cx">     if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx">     virtual RefPtr&lt;WebCore::IDBRequest&gt; count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
</span><span class="cx">     virtual RefPtr&lt;WebCore::IDBRequest&gt; count(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;WebCore::IDBRequest&gt; deleteFunction(ScriptExecutionContext*, JSC::JSValue key, ExceptionCode&amp;);
+
</ins><span class="cx">     void markAsDeleted();
</span><span class="cx">     bool isDeleted() const { return m_deleted; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;DOMRequestState.h&quot;
</span><span class="cx"> #include &quot;EventQueue.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><ins>+#include &quot;IDBCursorImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBEventDispatcher.h&quot;
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="lines">@@ -47,6 +48,11 @@
</span><span class="cx">     return adoptRef(*new IDBRequest(context, objectStore, transaction));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBRequest&gt; IDBRequest::create(ScriptExecutionContext&amp; context, IDBCursor&amp; cursor, IDBTransaction&amp; transaction)
+{
+    return adoptRef(*new IDBRequest(context, cursor, transaction));
+}
+
</ins><span class="cx"> Ref&lt;IDBRequest&gt; IDBRequest::createCount(ScriptExecutionContext&amp; context, IDBIndex&amp; index, IDBTransaction&amp; transaction)
</span><span class="cx"> {
</span><span class="cx">     return adoptRef(*new IDBRequest(context, index, transaction));
</span><span class="lines">@@ -75,6 +81,23 @@
</span><span class="cx">     suspendIfNeeded();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBRequest::IDBRequest(ScriptExecutionContext&amp; context, IDBCursor&amp; cursor, IDBTransaction&amp; transaction)
+    : IDBOpenDBRequest(&amp;context)
+    , m_transaction(&amp;transaction)
+    , m_connection(transaction.serverConnection())
+    , m_resourceIdentifier(transaction.serverConnection())
+    , m_pendingCursor(&amp;cursor)
+{
+    suspendIfNeeded();
+
+    cursor.setRequest(*this);
+
+    auto* cursorSource = cursor.source();
+    ASSERT(cursorSource);
+    ASSERT(cursorSource-&gt;type() == IDBAny::Type::IDBObjectStore || cursorSource-&gt;type() == IDBAny::Type::IDBIndex);
+    m_source = cursorSource;
+}
+
</ins><span class="cx"> IDBRequest::IDBRequest(ScriptExecutionContext&amp; context, IDBIndex&amp; index, IDBTransaction&amp; transaction)
</span><span class="cx">     : IDBOpenDBRequest(&amp;context)
</span><span class="cx">     , m_transaction(&amp;transaction)
</span><span class="lines">@@ -93,6 +116,11 @@
</span><span class="cx"> 
</span><span class="cx"> IDBRequest::~IDBRequest()
</span><span class="cx"> {
</span><ins>+    if (m_result) {
+        auto type = m_result-&gt;type();
+        if (type == IDBAny::Type::IDBCursor || type == IDBAny::Type::IDBCursorWithValue)
+            m_result-&gt;modernIDBCursor()-&gt;clearRequest();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBAny&gt; IDBRequest::result(ExceptionCode&amp;) const
</span><span class="lines">@@ -112,7 +140,7 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBAny&gt; IDBRequest::source() const
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    return m_source;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBTransaction&gt; IDBRequest::transaction() const
</span><span class="lines">@@ -261,8 +289,46 @@
</span><span class="cx">     m_result = IDBAny::createUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBCursor* IDBRequest::resultCursor()
+{
+    if (!m_result)
+        return nullptr;
+    if (m_result-&gt;type() == IDBAny::Type::IDBCursor || m_result-&gt;type() == IDBAny::Type::IDBCursorWithValue)
+        return m_result-&gt;modernIDBCursor();
+    return nullptr;
+}
+
+void IDBRequest::willIterateCursor(IDBCursor&amp; cursor)
+{
+    ASSERT(m_readyState == IDBRequestReadyState::Done);
+    ASSERT(scriptExecutionContext());
+    ASSERT(m_transaction);
+    ASSERT(!m_pendingCursor);
+    ASSERT(&amp;cursor == resultCursor());
+
+    m_pendingCursor = &amp;cursor;
+    m_result = nullptr;
+    m_readyState = IDBRequestReadyState::Pending;
+    m_domError = nullptr;
+    m_idbError = { };
+}
+
+void IDBRequest::didOpenOrIterateCursor(const IDBResultData&amp; resultData)
+{
+    ASSERT(m_pendingCursor);
+    if (resultData.type() == IDBResultType::IterateCursorSuccess)
+        m_pendingCursor-&gt;setGetResult(resultData.getResult());
+
+    m_result = IDBAny::create(*m_pendingCursor);
+    m_pendingCursor = nullptr;
+
+    requestCompleted(resultData);
+}
+
</ins><span class="cx"> void IDBRequest::requestCompleted(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><ins>+    m_readyState = IDBRequestReadyState::Done;
+
</ins><span class="cx">     m_idbError = resultData.error();
</span><span class="cx">     if (!m_idbError.isNull())
</span><span class="cx">         onError();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> class IDBRequest : public WebCore::IDBOpenDBRequest, public RefCounted&lt;IDBRequest&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBRequest&gt; create(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBTransaction&amp;);
</span><ins>+    static Ref&lt;IDBRequest&gt; create(ScriptExecutionContext&amp;, IDBCursor&amp;, IDBTransaction&amp;);
</ins><span class="cx">     static Ref&lt;IDBRequest&gt; createCount(ScriptExecutionContext&amp;, IDBIndex&amp;, IDBTransaction&amp;);
</span><span class="cx">     static Ref&lt;IDBRequest&gt; createGet(ScriptExecutionContext&amp;, IDBIndex&amp;, IndexedDB::IndexRecordType, IDBTransaction&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -89,9 +90,15 @@
</span><span class="cx">     void setResultToStructuredClone(const ThreadSafeDataBuffer&amp;);
</span><span class="cx">     void setResultToUndefined();
</span><span class="cx"> 
</span><ins>+    IDBAny* modernResult() { return m_result.get(); }
+
+    void willIterateCursor(IDBCursor&amp;);
+    void didOpenOrIterateCursor(const IDBResultData&amp;);
+
</ins><span class="cx"> protected:
</span><span class="cx">     IDBRequest(IDBConnectionToServer&amp;, ScriptExecutionContext*);
</span><span class="cx">     IDBRequest(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBTransaction&amp;);
</span><ins>+    IDBRequest(ScriptExecutionContext&amp;, IDBCursor&amp;, IDBTransaction&amp;);
</ins><span class="cx">     IDBRequest(ScriptExecutionContext&amp;, IDBIndex&amp;, IDBTransaction&amp;);
</span><span class="cx">     IDBRequest(ScriptExecutionContext&amp;, IDBIndex&amp;, IndexedDB::IndexRecordType, IDBTransaction&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -114,11 +121,15 @@
</span><span class="cx">     void onError();
</span><span class="cx">     void onSuccess();
</span><span class="cx"> 
</span><ins>+    IDBCursor* resultCursor();
+
</ins><span class="cx">     IDBConnectionToServer&amp; m_connection;
</span><span class="cx">     IDBResourceIdentifier m_resourceIdentifier;
</span><span class="cx">     RefPtr&lt;IDBAny&gt; m_source;
</span><span class="cx">     bool m_hasPendingActivity { true };
</span><span class="cx">     IndexedDB::IndexRecordType m_requestedIndexRecordType;
</span><ins>+
+    RefPtr&lt;IDBCursor&gt; m_pendingCursor;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -30,9 +30,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMError.h&quot;
</span><span class="cx"> #include &quot;EventQueue.h&quot;
</span><ins>+#include &quot;IDBCursorWithValueImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBDatabaseImpl.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBEventDispatcher.h&quot;
</span><ins>+#include &quot;IDBKeyData.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStore.h&quot;
</span><span class="cx"> #include &quot;IDBRequestImpl.h&quot;
</span><span class="lines">@@ -431,6 +433,76 @@
</span><span class="cx">     ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateIndexSuccess);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBRequest&gt; IDBTransaction::requestOpenCursor(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::requestOpenCursor&quot;);
+
+    return doRequestOpenCursor(context, IDBCursorWithValue::create(*this, objectStore, info));
+}
+
+Ref&lt;IDBRequest&gt; IDBTransaction::requestOpenCursor(ScriptExecutionContext&amp; context, IDBIndex&amp; index, const IDBCursorInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::requestOpenCursor&quot;);
+
+    if (info.cursorType() == IndexedDB::CursorType::KeyOnly)
+        return doRequestOpenCursor(context, IDBCursor::create(*this, index, info));
+
+    return doRequestOpenCursor(context, IDBCursorWithValue::create(*this, index, info));
+}
+
+Ref&lt;IDBRequest&gt; IDBTransaction::doRequestOpenCursor(ScriptExecutionContext&amp; context, Ref&lt;IDBCursor&gt;&amp;&amp; cursor)
+{
+    ASSERT(isActive());
+
+    Ref&lt;IDBRequest&gt; request = IDBRequest::create(context, cursor.get(), *this);
+    addRequest(request.get());
+
+    auto operation = createTransactionOperation(*this, request.get(), &amp;IDBTransaction::didOpenCursorOnServer, &amp;IDBTransaction::openCursorOnServer, cursor-&gt;info());
+    scheduleOperation(WTF::move(operation));
+
+    return WTF::move(request);
+}
+
+void IDBTransaction::openCursorOnServer(TransactionOperation&amp; operation, const IDBCursorInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::openCursorOnServer&quot;);
+
+    m_database-&gt;serverConnection().openCursor(operation, info);
+}
+
+void IDBTransaction::didOpenCursorOnServer(IDBRequest&amp; request, const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didOpenCursorOnServer&quot;);
+
+    request.didOpenOrIterateCursor(resultData);
+}
+
+void IDBTransaction::iterateCursor(IDBCursor&amp; cursor, const IDBKeyData&amp; key, unsigned long count)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::iterateCursor&quot;);
+    ASSERT(isActive());
+    ASSERT(cursor.request());
+
+    addRequest(*cursor.request());
+
+    auto operation = createTransactionOperation(*this, *cursor.request(), &amp;IDBTransaction::didIterateCursorOnServer, &amp;IDBTransaction::iterateCursorOnServer, key, count);
+    scheduleOperation(WTF::move(operation));
+}
+
+void IDBTransaction::iterateCursorOnServer(TransactionOperation&amp; operation, const IDBKeyData&amp; key, const unsigned long&amp; count)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::iterateCursorOnServer&quot;);
+
+    serverConnection().iterateCursor(operation, key, count);
+}
+
+void IDBTransaction::didIterateCursorOnServer(IDBRequest&amp; request, const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didIterateCursorOnServer&quot;);
+
+    request.didOpenOrIterateCursor(resultData);
+}
+
</ins><span class="cx"> Ref&lt;IDBRequest&gt; IDBTransaction::requestGetRecord(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::requestGetRecord&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -41,7 +41,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBIndexInfo;
</span><ins>+class IDBKeyData;
</ins><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBResultData;
</span><span class="cx"> 
</span><span class="lines">@@ -49,6 +51,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> 
</span><ins>+class IDBCursor;
</ins><span class="cx"> class IDBDatabase;
</span><span class="cx"> class IDBIndex;
</span><span class="cx"> class TransactionOperation;
</span><span class="lines">@@ -101,6 +104,9 @@
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestCount(ScriptExecutionContext&amp;, IDBIndex&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestGetValue(ScriptExecutionContext&amp;, IDBIndex&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestGetKey(ScriptExecutionContext&amp;, IDBIndex&amp;, const IDBKeyRangeData&amp;);
</span><ins>+    Ref&lt;IDBRequest&gt; requestOpenCursor(ScriptExecutionContext&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
+    Ref&lt;IDBRequest&gt; requestOpenCursor(ScriptExecutionContext&amp;, IDBIndex&amp;, const IDBCursorInfo&amp;);
+    void iterateCursor(IDBCursor&amp;, const IDBKeyData&amp;, unsigned long count);
</ins><span class="cx"> 
</span><span class="cx">     void deleteObjectStore(const String&amp; objectStoreName);
</span><span class="cx"> 
</span><span class="lines">@@ -159,6 +165,13 @@
</span><span class="cx">     void deleteObjectStoreOnServer(TransactionOperation&amp;, const String&amp; objectStoreName);
</span><span class="cx">     void didDeleteObjectStoreOnServer(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    Ref&lt;IDBRequest&gt; doRequestOpenCursor(ScriptExecutionContext&amp;, Ref&lt;IDBCursor&gt;&amp;&amp;);
+    void openCursorOnServer(TransactionOperation&amp;, const IDBCursorInfo&amp;);
+    void didOpenCursorOnServer(IDBRequest&amp;, const IDBResultData&amp;);
+
+    void iterateCursorOnServer(TransactionOperation&amp;, const IDBKeyData&amp;, const unsigned long&amp; count);
+    void didIterateCursorOnServer(IDBRequest&amp;, const IDBResultData&amp;);
+
</ins><span class="cx">     void establishOnServer();
</span><span class="cx"> 
</span><span class="cx">     void scheduleOperationTimer();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientTransactionOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -148,6 +148,19 @@
</span><span class="cx">     return adoptRef(operation);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename MP1, typename P1, typename MP2, typename P2&gt;
+RefPtr&lt;TransactionOperation&gt; createTransactionOperation(
+    IDBTransaction&amp; transaction,
+    IDBRequest&amp; request,
+    void (IDBTransaction::*complete)(IDBRequest&amp;, const IDBResultData&amp;),
+    void (IDBTransaction::*perform)(TransactionOperation&amp;, MP1, MP2),
+    const P1&amp; parameter1,
+    const P2&amp; parameter2)
+{
+    auto operation = new TransactionOperationImpl&lt;MP1, MP2&gt;(transaction, request, complete, perform, parameter1, parameter2);
+    return adoptRef(operation);
+}
+
</ins><span class="cx"> template&lt;typename MP1, typename MP2, typename MP3, typename P1, typename P2, typename P3&gt;
</span><span class="cx"> RefPtr&lt;TransactionOperation&gt; createTransactionOperation(
</span><span class="cx">     IDBTransaction&amp; transaction,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyLegacyCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">     return m_currentValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBAny* LegacyCursor::source() const
</del><ins>+IDBAny* LegacyCursor::source()
</ins><span class="cx"> {
</span><span class="cx">     return m_source.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyLegacyCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -55,18 +55,18 @@
</span><span class="cx">     virtual ~LegacyCursor();
</span><span class="cx"> 
</span><span class="cx">     // Implement the IDL
</span><del>-    const String&amp; direction() const;
-    const Deprecated::ScriptValue&amp; key() const;
-    const Deprecated::ScriptValue&amp; primaryKey() const;
-    const Deprecated::ScriptValue&amp; value() const;
-    IDBAny* source() const;
</del><ins>+    const String&amp; direction() const override;
+    const Deprecated::ScriptValue&amp; key() const override;
+    const Deprecated::ScriptValue&amp; primaryKey() const override;
+    const Deprecated::ScriptValue&amp; value() const override;
+    IDBAny* source() override;
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;IDBRequest&gt; update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCode&amp;);
-    void advance(unsigned long, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; update(JSC::ExecState&amp;, Deprecated::ScriptValue&amp;, ExceptionCode&amp;) override;
+    void advance(unsigned long, ExceptionCode&amp;) override;
</ins><span class="cx">     // FIXME: Try to modify the code generator so this overload is unneeded.
</span><del>-    void continueFunction(ScriptExecutionContext*, ExceptionCode&amp; ec) { continueFunction(static_cast&lt;IDBKey*&gt;(nullptr), ec); }
-    void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;);
-    RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext*, ExceptionCode&amp;);
</del><ins>+    void continueFunction(ScriptExecutionContext*, ExceptionCode&amp; ec) override { continueFunction(static_cast&lt;IDBKey*&gt;(nullptr), ec); }
+    void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override;
+    RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext*, ExceptionCode&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     void continueFunction(PassRefPtr&lt;IDBKey&gt;, ExceptionCode&amp;);
</span><span class="cx">     void postSuccessHandlerCallback();
</span><span class="lines">@@ -74,9 +74,10 @@
</span><span class="cx">     void setValueReady(DOMRequestState*, PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBKey&gt; primaryKey, Deprecated::ScriptValue&amp;);
</span><span class="cx">     PassRefPtr&lt;IDBKey&gt; idbPrimaryKey() { return m_currentPrimaryKey; }
</span><span class="cx"> 
</span><ins>+    virtual bool isKeyCursor() const override { return true; }
+
</ins><span class="cx"> protected:
</span><span class="cx">     LegacyCursor(PassRefPtr&lt;IDBCursorBackend&gt;, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
</span><del>-    virtual bool isKeyCursor() const { return true; }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PassRefPtr&lt;LegacyObjectStore&gt; effectiveObjectStore();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyLegacyCursorWithValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -41,8 +41,7 @@
</span><span class="cx">     // The value attribute defined in the IDL is simply implemented in LegacyCursor (but not exposed via
</span><span class="cx">     // its IDL). This is to make the implementation more simple while matching what the spec says.
</span><span class="cx"> 
</span><del>-protected:
-    virtual bool isKeyCursor() const override { return false; }
</del><ins>+    virtual bool isKeyCursor() const override final { return false; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     LegacyCursorWithValue(PassRefPtr&lt;IDBCursorBackend&gt;, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBIndexInfo;
</span><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="lines">@@ -70,7 +71,8 @@
</span><span class="cx">     virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) = 0;
</span><span class="cx">     virtual IDBError getCount(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, uint64_t&amp; outCount) = 0;
</span><span class="cx">     virtual IDBError generateKeyNumber(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t&amp; keyNumber) = 0;
</span><del>-
</del><ins>+    virtual IDBError openCursor(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBCursorInfo&amp;, IDBGetResult&amp; outResult) = 0;
+    virtual IDBError iterateCursor(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBKeyData&amp;, unsigned long count, IDBGetResult&amp; outResult) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBServer
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -103,6 +103,16 @@
</span><span class="cx">     m_delegate-&gt;didDeleteRecord(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::didOpenCursor(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didOpenCursor(result);
+}
+
+void IDBConnectionToClient::didIterateCursor(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didIterateCursor(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didCommitTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp; error)
</span><span class="cx"> {
</span><span class="cx">     m_delegate-&gt;didCommitTransaction(transactionIdentifier, error);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -60,6 +60,8 @@
</span><span class="cx">     void didGetRecord(const IDBResultData&amp;);
</span><span class="cx">     void didGetCount(const IDBResultData&amp;);
</span><span class="cx">     void didDeleteRecord(const IDBResultData&amp;);
</span><ins>+    void didOpenCursor(const IDBResultData&amp;);
+    void didIterateCursor(const IDBResultData&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void fireVersionChangeEvent(UniqueIDBDatabaseConnection&amp;, uint64_t requestedVersion);
</span><span class="cx">     void didStartTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -56,6 +56,8 @@
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didGetCount(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didDeleteRecord(const IDBResultData&amp;) = 0;
</span><ins>+    virtual void didOpenCursor(const IDBResultData&amp;) = 0;
+    virtual void didIterateCursor(const IDBResultData&amp;) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void fireVersionChangeEvent(UniqueIDBDatabaseConnection&amp;, uint64_t requestedVersion) = 0;
</span><span class="cx">     virtual void didStartTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -247,6 +247,28 @@
</span><span class="cx">     transaction-&gt;deleteRecord(requestData, keyRangeData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBServer::openCursor(const IDBRequestData&amp; requestData, const IDBCursorInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBServer::openCursor&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    transaction-&gt;openCursor(requestData, info);
+}
+
+void IDBServer::iterateCursor(const IDBRequestData&amp; requestData, const IDBKeyData&amp; key, unsigned long count)
+{
+    LOG(IndexedDB, &quot;IDBServer::iterateCursor&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    transaction-&gt;iterateCursor(requestData, key, count);
+}
+
</ins><span class="cx"> void IDBServer::establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBServer::establishTransaction&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CrossThreadTask;
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBRequestData;
</span><span class="cx"> 
</span><span class="cx"> namespace IDBServer {
</span><span class="lines">@@ -67,6 +68,9 @@
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><ins>+    void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;);
+    void iterateCursor(const IDBRequestData&amp;, const IDBKeyData&amp;, unsigned long count);
+
</ins><span class="cx">     void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp;);
</span><span class="cx">     void databaseConnectionClosed(uint64_t databaseConnectionIdentifier);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -329,6 +329,24 @@
</span><span class="cx">     return IDBError();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBError MemoryIDBBackingStore::openCursor(const IDBResourceIdentifier&amp;, const IDBCursorInfo&amp;, IDBGetResult&amp;)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::openCursor&quot;);
+
+    // FIXME: Implement.
+
+    return { IDBExceptionCode::Unknown };
+}
+
+IDBError MemoryIDBBackingStore::iterateCursor(const IDBResourceIdentifier&amp;, const IDBKeyData&amp;, unsigned long, IDBGetResult&amp;)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::iterateCursor&quot;);
+
+    // FIXME: Implement.
+
+    return { IDBExceptionCode::Unknown };
+}
+
</ins><span class="cx"> void MemoryIDBBackingStore::registerObjectStore(std::unique_ptr&lt;MemoryObjectStore&gt;&amp;&amp; objectStore)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(objectStore);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">     virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) override final;
</span><span class="cx">     virtual IDBError getCount(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, uint64_t&amp; outCount) override final;
</span><span class="cx">     virtual IDBError generateKeyNumber(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t&amp; keyNumber) override final;
</span><ins>+    virtual IDBError openCursor(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBCursorInfo&amp;, IDBGetResult&amp; outResult) override final;
+    virtual IDBError iterateCursor(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBKeyData&amp;, unsigned long count, IDBGetResult&amp; outResult) override final;
</ins><span class="cx"> 
</span><span class="cx">     void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&amp;);
</span><span class="cx">     void restoreObjectStoreForVersionChangeAbort(std::unique_ptr&lt;MemoryObjectStore&gt;&amp;&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;IDBCursorInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="cx"> #include &quot;IDBServer.h&quot;
</span><span class="lines">@@ -552,6 +553,62 @@
</span><span class="cx">     performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::openCursor(const IDBRequestData&amp; requestData, const IDBCursorInfo&amp; info, GetResultCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::openCursor&quot;);
+
+    uint64_t callbackID = storeCallback(callback);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performOpenCursor, callbackID, requestData.transactionIdentifier(), info));
+}
+
+void UniqueIDBDatabase::performOpenCursor(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBCursorInfo&amp; info)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performOpenCursor&quot;);
+
+    IDBGetResult result;
+    IDBError error = m_backingStore-&gt;openCursor(transactionIdentifier, info, result);
+
+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformOpenCursor, callbackIdentifier, error, result));
+}
+
+void UniqueIDBDatabase::didPerformOpenCursor(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBGetResult&amp; result)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformOpenCursor&quot;);
+
+    performGetResultCallback(callbackIdentifier, error, result);
+}
+
+void UniqueIDBDatabase::iterateCursor(const IDBRequestData&amp; requestData, const IDBKeyData&amp; key, unsigned long count, GetResultCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::iterateCursor&quot;);
+
+    uint64_t callbackID = storeCallback(callback);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performIterateCursor, callbackID, requestData.transactionIdentifier(), key, count));
+}
+
+void UniqueIDBDatabase::performIterateCursor(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBKeyData&amp; key, unsigned long count)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performIterateCursor&quot;);
+
+    IDBGetResult result;
+    IDBError error = m_backingStore-&gt;iterateCursor(transactionIdentifier, key, count, result);
+
+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformIterateCursor, callbackIdentifier, error, result));
+}
+
+void UniqueIDBDatabase::didPerformIterateCursor(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBGetResult&amp; result)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformIterateCursor&quot;);
+
+    performGetResultCallback(callbackIdentifier, error, result);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::commitTransaction(UniqueIDBDatabaseTransaction&amp; transaction, ErrorCallback callback)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -83,6 +83,8 @@
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, GetResultCallback);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, CountCallback);
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, ErrorCallback);
</span><ins>+    void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;, GetResultCallback);
+    void iterateCursor(const IDBRequestData&amp;, const IDBKeyData&amp;, unsigned long count, GetResultCallback);
</ins><span class="cx">     void commitTransaction(UniqueIDBDatabaseTransaction&amp;, ErrorCallback);
</span><span class="cx">     void abortTransaction(UniqueIDBDatabaseTransaction&amp;, ErrorCallback);
</span><span class="cx">     void transactionDestroyed(UniqueIDBDatabaseTransaction&amp;);
</span><span class="lines">@@ -117,6 +119,8 @@
</span><span class="cx">     void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performDeleteRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><ins>+    void performOpenCursor(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBCursorInfo&amp;);
+    void performIterateCursor(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBKeyData&amp;, unsigned long count);
</ins><span class="cx">     void performActivateTransactionInBackingStore(uint64_t callbackIdentifier, const IDBTransactionInfo&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Main thread callbacks
</span><span class="lines">@@ -129,6 +133,8 @@
</span><span class="cx">     void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</span><span class="cx">     void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t);
</span><span class="cx">     void didPerformDeleteRecord(uint64_t callbackIdentifier, const IDBError&amp;);
</span><ins>+    void didPerformOpenCursor(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
+    void didPerformIterateCursor(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</ins><span class="cx">     void didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError&amp;, const IDBResourceIdentifier&amp; transactionIdentifier);
</span><span class="cx">     void didPerformAbortTransaction(uint64_t callbackIdentifier, const IDBError&amp;, const IDBResourceIdentifier&amp; transactionIdentifier);
</span><span class="cx">     void didPerformActivateTransactionInBackingStore(uint64_t callbackIdentifier, const IDBError&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -232,6 +232,40 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseTransaction::openCursor(const IDBRequestData&amp; requestData, const IDBCursorInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::openCursor&quot;);
+
+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; protectedThis(this);
+    m_databaseConnection-&gt;database().openCursor(requestData, info, [this, protectedThis, requestData](const IDBError&amp; error, const IDBGetResult&amp; result) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::openCursor (callback)&quot;);
+
+        if (error.isNull())
+            m_databaseConnection-&gt;connectionToClient().didOpenCursor(IDBResultData::openCursorSuccess(requestData.requestIdentifier(), result));
+        else
+            m_databaseConnection-&gt;connectionToClient().didOpenCursor(IDBResultData::error(requestData.requestIdentifier(), error));
+    });
+}
+
+void UniqueIDBDatabaseTransaction::iterateCursor(const IDBRequestData&amp; requestData, const IDBKeyData&amp; key, unsigned long count)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::iterateCursor&quot;);
+
+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; protectedThis(this);
+    m_databaseConnection-&gt;database().iterateCursor(requestData, key, count, [this, protectedThis, requestData](const IDBError&amp; error, const IDBGetResult&amp; result) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::openCursor (callback)&quot;);
+
+        if (error.isNull())
+            m_databaseConnection-&gt;connectionToClient().didIterateCursor(IDBResultData::iterateCursorSuccess(requestData.requestIdentifier(), result));
+        else
+            m_databaseConnection-&gt;connectionToClient().didIterateCursor(IDBResultData::error(requestData.requestIdentifier(), error));
+    });
+}
+
</ins><span class="cx"> const Vector&lt;uint64_t&gt;&amp; UniqueIDBDatabaseTransaction::objectStoreIdentifiers()
</span><span class="cx"> {
</span><span class="cx">     if (!m_objectStoreIdentifiers.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IDBCursorInfo;
</ins><span class="cx"> class IDBDatabaseInfo;
</span><span class="cx"> class IDBError;
</span><span class="cx"> class IDBIndexInfo;
</span><span class="lines">@@ -73,6 +74,8 @@
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><ins>+    void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;);
+    void iterateCursor(const IDBRequestData&amp;, const IDBKeyData&amp;, unsigned long count);
</ins><span class="cx"> 
</span><span class="cx">     void didActivateInBackingStore(const IDBError&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBCursorInfocpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp (0 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;IDBCursorInfo.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBTransactionImpl.h&quot;
+#include &quot;IndexedDB.h&quot;
+
+namespace WebCore {
+
+IDBCursorInfo IDBCursorInfo::objectStoreCursor(IDBClient::IDBTransaction&amp; transaction, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp; range, IndexedDB::CursorDirection direction)
+{
+    return { transaction, IndexedDB::CursorSource::ObjectStore, objectStoreIdentifier, range, direction, IndexedDB::CursorType::KeyAndValue };
+}
+
+IDBCursorInfo IDBCursorInfo::indexCursor(IDBClient::IDBTransaction&amp; transaction, uint64_t indexIdentifier, const IDBKeyRangeData&amp; range, IndexedDB::CursorDirection direction, IndexedDB::CursorType type)
+{
+    return { transaction, IndexedDB::CursorSource::Index, indexIdentifier, range, direction, type };
+}
+
+IDBCursorInfo::IDBCursorInfo(IDBClient::IDBTransaction&amp; transaction, IndexedDB::CursorSource source, uint64_t sourceIdentifier, const IDBKeyRangeData&amp; range, IndexedDB::CursorDirection direction, IndexedDB::CursorType type)
+    : m_cursorIdentifier(transaction.serverConnection())
+    , m_transactionIdentifier(transaction.info().identifier())
+    , m_sourceIdentifier(sourceIdentifier)
+    , m_range(range)
+    , m_source(source)
+    , m_direction(direction)
+    , m_type(type)
+{
+}
+
+IDBCursorInfo::IDBCursorInfo(const IDBResourceIdentifier&amp; cursorIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t sourceIdentifier, const IDBKeyRangeData&amp; range, IndexedDB::CursorSource source, IndexedDB::CursorDirection direction, IndexedDB::CursorType type)
+    : m_cursorIdentifier(cursorIdentifier)
+    , m_transactionIdentifier(transactionIdentifier)
+    , m_sourceIdentifier(sourceIdentifier)
+    , m_range(range)
+    , m_source(source)
+    , m_direction(direction)
+    , m_type(type)
+{
+}
+
+bool IDBCursorInfo::isDirectionForward() const
+{
+    return m_direction == IndexedDB::CursorDirection::Next || m_direction == IndexedDB::CursorDirection::NextNoDuplicate;
+}
+
+IDBCursorInfo IDBCursorInfo::isolatedCopy() const
+{
+    return { m_cursorIdentifier.isolatedCopy(), m_transactionIdentifier.isolatedCopy(), m_sourceIdentifier, m_range.isolatedCopy(), m_source, m_direction, m_type };
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBCursorInfoh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h (0 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef IDBCursorInfo_h
+#define IDBCursorInfo_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKeyRangeData.h&quot;
+#include &quot;IDBResourceIdentifier.h&quot;
+
+namespace WebCore {
+
+namespace IDBClient {
+class IDBTransaction;
+}
+
+namespace IndexedDB {
+enum class CursorDirection;
+enum class CursorSource;
+enum class CursorType;
+}
+
+struct IDBKeyRangeData;
+
+class IDBCursorInfo {
+public:
+    static IDBCursorInfo objectStoreCursor(IDBClient::IDBTransaction&amp;, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;, IndexedDB::CursorDirection);
+    static IDBCursorInfo indexCursor(IDBClient::IDBTransaction&amp;, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, IndexedDB::CursorDirection, IndexedDB::CursorType);
+
+    IDBResourceIdentifier identifier() const { return m_cursorIdentifier; }
+    uint64_t sourceIdentifier() const { return m_sourceIdentifier; }
+
+    IndexedDB::CursorSource cursorSource() const { return m_source; }
+    IndexedDB::CursorDirection cursorDirection() const { return m_direction; }
+    IndexedDB::CursorType cursorType() const { return m_type; }
+
+    bool isDirectionForward() const;
+
+    IDBCursorInfo isolatedCopy() const;
+
+private:
+    IDBCursorInfo(IDBClient::IDBTransaction&amp;, IndexedDB::CursorSource, uint64_t sourceIdentifier, const IDBKeyRangeData&amp;, IndexedDB::CursorDirection, IndexedDB::CursorType);
+    IDBCursorInfo(const IDBResourceIdentifier&amp;, const IDBResourceIdentifier&amp;, uint64_t, const IDBKeyRangeData&amp;, IndexedDB::CursorSource, IndexedDB::CursorDirection, IndexedDB::CursorType);
+
+    IDBResourceIdentifier m_cursorIdentifier;
+    IDBResourceIdentifier m_transactionIdentifier;
+    uint64_t m_sourceIdentifier;
+
+    IDBKeyRangeData m_range;
+
+    IndexedDB::CursorSource m_source;
+    IndexedDB::CursorDirection m_direction;
+    IndexedDB::CursorType m_type;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBCursorInfo_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -136,6 +136,20 @@
</span><span class="cx">     return { IDBResultType::DeleteRecordSuccess, requestIdentifier };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBResultData IDBResultData::openCursorSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const IDBGetResult&amp; getResult)
+{
+    IDBResultData result(IDBResultType::OpenCursorSuccess, requestIdentifier);
+    result.m_getResult = std::make_unique&lt;IDBGetResult&gt;(getResult);
+    return result;
+}
+
+IDBResultData IDBResultData::iterateCursorSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const IDBGetResult&amp; getResult)
+{
+    IDBResultData result(IDBResultType::IterateCursorSuccess, requestIdentifier);
+    result.m_getResult = std::make_unique&lt;IDBGetResult&gt;(getResult);
+    return result;
+}
+
</ins><span class="cx"> const IDBDatabaseInfo&amp; IDBResultData::databaseInfo() const
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(m_databaseInfo);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx">     GetCountSuccess,
</span><span class="cx">     DeleteRecordSuccess,
</span><span class="cx">     CreateIndexSuccess,
</span><ins>+    OpenCursorSuccess,
+    IterateCursorSuccess,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> namespace IDBServer {
</span><span class="lines">@@ -73,6 +75,8 @@
</span><span class="cx">     static IDBResultData getRecordSuccess(const IDBResourceIdentifier&amp;, const IDBGetResult&amp;);
</span><span class="cx">     static IDBResultData getCountSuccess(const IDBResourceIdentifier&amp;, uint64_t count);
</span><span class="cx">     static IDBResultData deleteRecordSuccess(const IDBResourceIdentifier&amp;);
</span><ins>+    static IDBResultData openCursorSuccess(const IDBResourceIdentifier&amp;, const IDBGetResult&amp;);
+    static IDBResultData iterateCursorSuccess(const IDBResourceIdentifier&amp;, const IDBGetResult&amp;);
</ins><span class="cx"> 
</span><span class="cx">     IDBResultData(const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBConnectionToClient.h&quot;
</span><span class="cx"> #include &quot;IDBConnectionToServer.h&quot;
</span><ins>+#include &quot;IDBCursorInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBOpenDBRequestImpl.h&quot;
</span><span class="cx"> #include &quot;IDBRequestData.h&quot;
</span><span class="lines">@@ -183,6 +184,22 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::didOpenCursor(const IDBResultData&amp; resultData)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, resultData] {
+        m_connectionToServer-&gt;didOpenCursor(resultData);
+    });
+}
+
+void InProcessIDBServer::didIterateCursor(const IDBResultData&amp; resultData)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, resultData] {
+        m_connectionToServer-&gt;didIterateCursor(resultData);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::abortTransaction(IDBResourceIdentifier&amp; resourceIdentifier)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; self(this);
</span><span class="lines">@@ -268,6 +285,24 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::openCursor(const IDBRequestData&amp; requestData, const IDBCursorInfo&amp; info)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+
+    RunLoop::current().dispatch([this, self, requestData, info] {
+        m_server-&gt;openCursor(requestData, info);
+    });
+}
+
+void InProcessIDBServer::iterateCursor(const IDBRequestData&amp; requestData, const IDBKeyData&amp; key, unsigned long count)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+
+    RunLoop::current().dispatch([this, self, requestData, key, count] {
+        m_server-&gt;iterateCursor(requestData, key, count);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; self(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -66,6 +66,8 @@
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) override final;
</span><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) override final;
</span><span class="cx">     virtual void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) override final;
</span><ins>+    virtual void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;) override final;
+    virtual void iterateCursor(const IDBRequestData&amp;, const IDBKeyData&amp;, unsigned long count) override final;
</ins><span class="cx">     virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp;) override final;
</span><span class="cx">     virtual void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) override final;
</span><span class="cx"> 
</span><span class="lines">@@ -83,6 +85,8 @@
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didGetCount(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didDeleteRecord(const IDBResultData&amp;) override final;
</span><ins>+    virtual void didOpenCursor(const IDBResultData&amp;) override final;
+    virtual void didIterateCursor(const IDBResultData&amp;) override final;
</ins><span class="cx">     virtual void fireVersionChangeEvent(IDBServer::UniqueIDBDatabaseConnection&amp;, uint64_t requestedVersion) override final;
</span><span class="cx">     virtual void didStartTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;) override final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -2054,6 +2054,8 @@
</span><span class="cx">                 517138F01BED1D1A000D5F01 /* IndexKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 517138EE1BED1D17000D5F01 /* IndexKey.h */; };
</span><span class="cx">                 517138F71BF128BB000D5F01 /* IndexValueStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517138F51BF12262000D5F01 /* IndexValueStore.cpp */; };
</span><span class="cx">                 517138F81BF128BB000D5F01 /* IndexValueStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 517138F61BF12262000D5F01 /* IndexValueStore.h */; };
</span><ins>+                517138FB1BF3ADF4000D5F01 /* IDBCursorInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517138F91BF3ADAC000D5F01 /* IDBCursorInfo.cpp */; };
+                517138FC1BF3ADF4000D5F01 /* IDBCursorInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 517138FA1BF3ADAC000D5F01 /* IDBCursorInfo.h */; };
</ins><span class="cx">                 51741D0F0B07259A00ED442C /* BackForwardClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0B0B07259A00ED442C /* BackForwardClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; };
</span><span class="lines">@@ -9511,6 +9513,8 @@
</span><span class="cx">                 517138EE1BED1D17000D5F01 /* IndexKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517138F51BF12262000D5F01 /* IndexValueStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndexValueStore.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517138F61BF12262000D5F01 /* IndexValueStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexValueStore.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                517138F91BF3ADAC000D5F01 /* IDBCursorInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                517138FA1BF3ADAC000D5F01 /* IDBCursorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 51741D0B0B07259A00ED442C /* BackForwardClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51741D0D0B07259A00ED442C /* HistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HistoryItem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16876,6 +16880,8 @@
</span><span class="cx">                 510A58E11BAA409800C19282 /* shared */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                517138F91BF3ADAC000D5F01 /* IDBCursorInfo.cpp */,
+                                517138FA1BF3ADAC000D5F01 /* IDBCursorInfo.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">@@ -25159,6 +25165,7 @@
</span><span class="cx">                                 854075200AD6C5FB00620C57 /* DOMEventTarget.h in Headers */,
</span><span class="cx">                                 85C78A680ABDE1B40044FC16 /* DOMException.h in Headers */,
</span><span class="cx">                                 BC1A37B5097C715F0019F3D8 /* DOMExtensions.h in Headers */,
</span><ins>+                                517138FC1BF3ADF4000D5F01 /* IDBCursorInfo.h in Headers */,
</ins><span class="cx">                                 BC00F0040E0A185500FD04E3 /* DOMFile.h in Headers */,
</span><span class="cx">                                 2E3BC108117D479800B9409A /* DOMFileError.h in Headers */,
</span><span class="cx">                                 2E3BC10B117D47C800B9409A /* DOMFileErrorInternal.h in Headers */,
</span><span class="lines">@@ -29626,6 +29633,7 @@
</span><span class="cx">                                 316FE0730E6CCBEE00BF6088 /* JSCSSKeyframesRule.cpp in Sources */,
</span><span class="cx">                                 BC46C2000C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp in Sources */,
</span><span class="cx">                                 BC46C2020C0DDC8F0020CFC3 /* JSCSSPageRule.cpp in Sources */,
</span><ins>+                                517138FB1BF3ADF4000D5F01 /* IDBCursorInfo.cpp in Sources */,
</ins><span class="cx">                                 930705E909E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp in Sources */,
</span><span class="cx">                                 14CF7B3309F6ECD700EB3665 /* JSCSSRule.cpp in Sources */,
</span><span class="cx">                                 BC46C1EE0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -78,6 +78,43 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue idbKeyDataToJSValue(JSC::ExecState&amp; exec, const IDBKeyData&amp; keyData)
+{
+    if (keyData.isNull())
+        return jsUndefined();
+
+    Locker&lt;JSLock&gt; locker(exec.vm().apiLock());
+
+    switch (keyData.type()) {
+    case KeyType::Array:
+        {
+            const Vector&lt;IDBKeyData&gt;&amp; inArray = keyData.array();
+            size_t size = inArray.size();
+            JSArray* outArray = constructEmptyArray(&amp;exec, 0, exec.lexicalGlobalObject(), size);
+            for (size_t i = 0; i &lt; size; ++i) {
+                auto&amp; arrayKey = inArray.at(i);
+                outArray-&gt;putDirectIndex(&amp;exec, i, idbKeyDataToJSValue(exec, arrayKey));
+            }
+            return JSValue(outArray);
+        }
+    case KeyType::String:
+        return jsStringWithCache(&amp;exec, keyData.string());
+    case KeyType::Date:
+        return jsDateOrNull(&amp;exec, keyData.date());
+    case KeyType::Number:
+        return jsNumber(keyData.number());
+    case KeyType::Min:
+    case KeyType::Max:
+    case KeyType::Invalid:
+        ASSERT_NOT_REACHED();
+        return jsUndefined();
+    }
+
+    ASSERT_NOT_REACHED();
+    return jsUndefined();
+
+}
+
</ins><span class="cx"> static JSValue idbKeyToJSValue(ExecState* exec, JSDOMGlobalObject* globalObject, IDBKey* key)
</span><span class="cx"> {
</span><span class="cx">     if (!key || !exec) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue idbValueDataToJSValue(JSC::ExecState&amp;, const ThreadSafeDataBuffer&amp; valueData);
</span><span class="cx"> void generateIndexKeyForValue(JSC::ExecState&amp;, const IDBIndexInfo&amp;, JSC::JSValue, IndexKey&amp; outKey);
</span><ins>+JSC::JSValue idbKeyDataToJSValue(JSC::ExecState&amp;, const IDBKeyData&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><ins>+#include &quot;IDBCursorInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBDatabaseIdentifier.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseInfo.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseMetadata.h&quot;
</span><span class="lines">@@ -175,6 +176,11 @@
</span><span class="cx">     return info.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CrossThreadCopierBase&lt;false, false, IDBCursorInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBCursorInfo&gt;::copy(const IDBCursorInfo&amp; info)
+{
+    return info.isolatedCopy();
+}
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> // Test CrossThreadCopier using COMPILE_ASSERT.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (192395 => 192396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.h        2015-11-13 00:21:13 UTC (rev 192395)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h        2015-11-13 00:24:11 UTC (rev 192396)
</span><span class="lines">@@ -239,6 +239,12 @@
</span><span class="cx">         static Type copy(const IDBIndexInfo&amp;);
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    class IDBCursorInfo;
+    template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBCursorInfo&gt; {
+        typedef IDBCursorInfo Type;
+        static Type copy(const IDBCursorInfo&amp;);
+    };
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     template&lt;typename T&gt;
</span></span></pre>
</div>
</div>

</body>
</html>