<!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>[162633] trunk/Source</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>IDB: Implement cross-thread and IPC plumbing for 'get' support
https://bugs.webkit.org/show_bug.cgi?id=127501

Reviewed by Anders Carlsson.

Source/WebCore:

Add isolatedCopy to the IDBGetResult object:
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::isolatedCopy):

Add a cross-thread and cross-IPC appropriate object for IDBKeyRanges:
* Modules/indexeddb/IDBKeyRangeData.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBGetResult.h.
(WebCore::IDBKeyRangeData::isolatedCopy):
* Modules/indexeddb/IDBKeyRangeData.h: Copied from Source/WebCore/Modules/indexeddb/IDBGetResult.h.
(WebCore::IDBKeyRangeData::IDBKeyRangeData):

Add a few more cross-thread copiers:
* platform/CrossThreadCopier.cpp:
(WebCore::IDBGetResult&gt;::copy):
(WebCore::IDBKeyRangeData&gt;::copy):
* platform/CrossThreadCopier.h:

Project file gunk:
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Make the WebProcess call out to the DatabaseProcess with a get request, and handle the
response from the DatabaseProcess:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::get):
(WebKit::WebIDBServerConnection::didGetRecord):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

Get the request from the WebProcess and forward it to the appropriate unique IDB database:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::getRecord):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

Forward the request to the database thread, and response to the result from that thread:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::getRecord):
(WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
(WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

IPC and asynchronous request infrastructure:
* Scripts/webkit2/messages.py:
(struct_or_class):

* Shared/AsyncTask.h:
(WebKit::createAsyncTask):

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;IDBGetResult&gt;::encode):
(IPC::ArgumentCoder&lt;IDBGetResult&gt;::decode):
(IPC::ArgumentCoder&lt;IDBKeyRangeData&gt;::encode):
(IPC::ArgumentCoder&lt;IDBKeyRangeData&gt;::decode):
* Shared/WebCoreArgumentCoders.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBGetResulth">trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectioncpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectionh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectionmessagesin">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabasecpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebKit2Scriptswebkit2messagespy">trunk/Source/WebKit2/Scripts/webkit2/messages.py</a></li>
<li><a href="#trunkSourceWebKit2SharedAsyncTaskh">trunk/Source/WebKit2/Shared/AsyncTask.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectioncpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionmessagesin">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeDatacpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeDatah">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -814,6 +814,7 @@
</span><span class="cx">     Modules/indexeddb/IDBKeyData.cpp
</span><span class="cx">     Modules/indexeddb/IDBKeyPath.cpp
</span><span class="cx">     Modules/indexeddb/IDBKeyRange.cpp
</span><ins>+    Modules/indexeddb/IDBKeyRangeData.cpp
</ins><span class="cx">     Modules/indexeddb/IDBObjectStore.cpp
</span><span class="cx">     Modules/indexeddb/IDBOpenDBRequest.cpp
</span><span class="cx">     Modules/indexeddb/IDBPendingTransactionMonitor.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/ChangeLog        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-01-23  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IDB: Implement cross-thread and IPC plumbing for 'get' support
+        https://bugs.webkit.org/show_bug.cgi?id=127501
+
+        Reviewed by Anders Carlsson.
+
+        Add isolatedCopy to the IDBGetResult object:
+        * Modules/indexeddb/IDBGetResult.h:
+        (WebCore::IDBGetResult::isolatedCopy):
+
+        Add a cross-thread and cross-IPC appropriate object for IDBKeyRanges:
+        * Modules/indexeddb/IDBKeyRangeData.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBGetResult.h.
+        (WebCore::IDBKeyRangeData::isolatedCopy):
+        * Modules/indexeddb/IDBKeyRangeData.h: Copied from Source/WebCore/Modules/indexeddb/IDBGetResult.h.
+        (WebCore::IDBKeyRangeData::IDBKeyRangeData):
+
+        Add a few more cross-thread copiers:
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::IDBGetResult&gt;::copy):
+        (WebCore::IDBKeyRangeData&gt;::copy):
+        * platform/CrossThreadCopier.h:
+
+        Project file gunk:
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-01-23  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [MSE][Mac] Adopt new AVStreamDataParser delegate API
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -1840,6 +1840,7 @@
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBFactory.cpp \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBFactory.h \
</span><ins>+        Source/WebCore/Modules/indexeddb/IDBGetResult.h \
</ins><span class="cx">         Source/WebCore/Modules/indexeddb/IDBHistograms.h \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBIndex.cpp \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBIndex.h \
</span><span class="lines">@@ -1851,6 +1852,8 @@
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBKeyPath.h \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBKeyRange.h \
</span><ins>+        Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp \
+        Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h \
</ins><span class="cx">         Source/WebCore/Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/leveldb/IDBLevelDBCoding.h \
</span><span class="cx">         Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBGetResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -57,6 +57,17 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    IDBGetResult isolatedCopy() const
+    {
+        IDBGetResult result;
+        if (valueBuffer)
+            result.valueBuffer = valueBuffer-&gt;copy();
+
+        result.keyData = keyData.isolatedCopy();
+        result.keyPath = keyPath.isolatedCopy();
+        return result;
+    }
+
</ins><span class="cx">     RefPtr&lt;SharedBuffer&gt; valueBuffer;
</span><span class="cx">     IDBKeyData keyData;
</span><span class="cx">     IDBKeyPath keyPath;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeDatacppfromrev162632trunkSourceWebCoreModulesindexeddbIDBGetResulth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp (from rev 162632, trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h) (0 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2014 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;IDBKeyRangeData.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+IDBKeyRangeData IDBKeyRangeData::isolatedCopy() const
+{
+    IDBKeyRangeData result;
+
+    result.isNull = isNull;
+    result.lowerKey = lowerKey.isolatedCopy();
+    result.upperKey = upperKey.isolatedCopy();
+    result.lowerOpen = lowerOpen;
+    result.upperOpen = upperOpen;
+
+    return result;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeDatahfromrev162632trunkSourceWebCoreModulesindexeddbIDBGetResulth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h (from rev 162632, trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h) (0 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2014 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 IDBKeyRangeData_h
+#define IDBKeyRangeData_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKeyData.h&quot;
+#include &quot;IDBKeyRange.h&quot;
+
+namespace WebCore {
+
+struct IDBKeyRangeData {
+    IDBKeyRangeData()
+        : isNull(true)
+        , lowerOpen(false)
+        , upperOpen(false)
+    {
+    }
+
+    IDBKeyRangeData(IDBKeyRange* keyRange)
+        : isNull(!keyRange)
+        , lowerOpen(false)
+        , upperOpen(false)
+    {
+        if (isNull)
+            return;
+
+        lowerKey = keyRange-&gt;lower().get();
+        upperKey = keyRange-&gt;upper().get();
+        lowerOpen = keyRange-&gt;lowerOpen();
+        upperOpen = keyRange-&gt;upperOpen();
+    }
+
+    IDBKeyRangeData isolatedCopy() const;
+
+    bool isNull;
+
+    IDBKeyData lowerKey;
+    IDBKeyData upperKey;
+
+    bool lowerOpen;
+    bool upperOpen;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBKeyRangeData_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -3090,7 +3090,10 @@
</span><span class="cx"> __ZN7WebCore18IDBDatabaseBackend6createERKN3WTF6StringES4_PNS_26IDBFactoryBackendInterfaceERNS_19IDBServerConnectionE
</span><span class="cx"> __ZN7WebCore18IDBDatabaseBackendD1Ev
</span><span class="cx"> __ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_10IDBKeyDataEE4copyERKS1_
</span><ins>+__ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_12IDBGetResultEE4copyERKS1_
+__ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_15IDBKeyRangeDataEE4copyERKS1_
</ins><span class="cx"> __ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_22IDBObjectStoreMetadataEE4copyERKS1_
</span><ins>+__ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_9IndexedDB10CursorTypeEE4copyERKS2_
</ins><span class="cx"> __ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_9IndexedDB15TransactionModeEE4copyERKS2_
</span><span class="cx"> __ZN7WebCore6IDBKeyD1Ev
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -1798,6 +1798,8 @@
</span><span class="cx">                 511EF2D117F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */; };
</span><span class="cx">                 511F23190DC160DA004F0032 /* StorageThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511F23150DC160DA004F0032 /* StorageThread.cpp */; };
</span><span class="cx">                 511F231A0DC160DA004F0032 /* StorageThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F23160DC160DA004F0032 /* StorageThread.h */; };
</span><ins>+                5123AF181890A4CA0031CDC9 /* IDBKeyRangeData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5123AF161890A4CA0031CDC9 /* IDBKeyRangeData.cpp */; };
+                5123AF191890A4CA0031CDC9 /* IDBKeyRangeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123AF171890A4CA0031CDC9 /* IDBKeyRangeData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 5123AF1D18918AE40031CDC9 /* IDBGetResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123AF1C18918AE40031CDC9 /* IDBGetResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; };
</span><span class="cx">                 5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8753,6 +8755,8 @@
</span><span class="cx">                 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBObjectStoreCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511F23150DC160DA004F0032 /* StorageThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageThread.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511F23160DC160DA004F0032 /* StorageThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageThread.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5123AF161890A4CA0031CDC9 /* IDBKeyRangeData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBKeyRangeData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5123AF171890A4CA0031CDC9 /* IDBKeyRangeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBKeyRangeData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5123AF1C18918AE40031CDC9 /* IDBGetResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBGetResult.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IconDatabase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17718,6 +17722,8 @@
</span><span class="cx">                                 51D71995181106E00016DC51 /* IDBKeyRange.cpp */,
</span><span class="cx">                                 51D71996181106E00016DC51 /* IDBKeyRange.h */,
</span><span class="cx">                                 51D71997181106E00016DC51 /* IDBKeyRange.idl */,
</span><ins>+                                5123AF161890A4CA0031CDC9 /* IDBKeyRangeData.cpp */,
+                                5123AF171890A4CA0031CDC9 /* IDBKeyRangeData.h */,
</ins><span class="cx">                                 51D71999181106E00016DC51 /* IDBObjectStore.cpp */,
</span><span class="cx">                                 51D7199A181106E00016DC51 /* IDBObjectStore.h */,
</span><span class="cx">                                 51D7199B181106E00016DC51 /* IDBObjectStore.idl */,
</span><span class="lines">@@ -24702,6 +24708,7 @@
</span><span class="cx">                                 0F54DCDA1880F867003EEDBB /* DOMTouchInternal.h in Headers */,
</span><span class="cx">                                 B2FA3E0D0AB75A6F000E5AC4 /* JSSVGTransformList.h in Headers */,
</span><span class="cx">                                 07277E4F17D018CC0015534D /* JSMediaStreamAudioDestinationNode.h in Headers */,
</span><ins>+                                5123AF191890A4CA0031CDC9 /* IDBKeyRangeData.h in Headers */,
</ins><span class="cx">                                 B2FA3E0F0AB75A6F000E5AC4 /* JSSVGTRefElement.h in Headers */,
</span><span class="cx">                                 B2FA3E110AB75A6F000E5AC4 /* JSSVGTSpanElement.h in Headers */,
</span><span class="cx">                                 B2FA3E130AB75A6F000E5AC4 /* JSSVGUnitTypes.h in Headers */,
</span><span class="lines">@@ -26917,6 +26924,7 @@
</span><span class="cx">                                 A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */,
</span><span class="cx">                                 CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */,
</span><span class="cx">                                 076306DC17E15FB0005A7C4E /* JSMediaStreamTrackSourcesCallback.cpp in Sources */,
</span><ins>+                                5123AF181890A4CA0031CDC9 /* IDBKeyRangeData.cpp in Sources */,
</ins><span class="cx">                                 14947FFD12F80CD200A0F631 /* DocumentOrderedMap.cpp in Sources */,
</span><span class="cx">                                 A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */,
</span><span class="cx">                                 076306D217E1478D005A7C4E /* MediaStreamTrackSourcesRequest.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -42,7 +42,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> #include &quot;IDBDatabaseMetadata.h&quot;
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><ins>+#include &quot;IDBKeyRangeData.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -94,6 +96,11 @@
</span><span class="cx">     return metadata.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CrossThreadCopierBase&lt;false, false, IDBGetResult&gt;::Type CrossThreadCopierBase&lt;false, false, IDBGetResult&gt;::copy(const IDBGetResult&amp; result)
+{
+    return result.isolatedCopy();
+}
+
</ins><span class="cx"> CrossThreadCopierBase&lt;false, false, IDBIndexMetadata&gt;::Type CrossThreadCopierBase&lt;false, false, IDBIndexMetadata&gt;::copy(const IDBIndexMetadata&amp; metadata)
</span><span class="cx"> {
</span><span class="cx">     return metadata.isolatedCopy();
</span><span class="lines">@@ -104,6 +111,11 @@
</span><span class="cx">     return keyData.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CrossThreadCopierBase&lt;false, false, IDBKeyRangeData&gt;::Type CrossThreadCopierBase&lt;false, false, IDBKeyRangeData&gt;::copy(const IDBKeyRangeData&amp; keyRangeData)
+{
+    return keyRangeData.isolatedCopy();
+}
+
</ins><span class="cx"> CrossThreadCopierBase&lt;false, false, IDBObjectStoreMetadata&gt;::Type CrossThreadCopierBase&lt;false, false, IDBObjectStoreMetadata&gt;::copy(const IDBObjectStoreMetadata&amp; metadata)
</span><span class="cx"> {
</span><span class="cx">     return metadata.isolatedCopy();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -167,6 +167,12 @@
</span><span class="cx">         static Type copy(const IDBDatabaseMetadata&amp;);
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    struct IDBGetResult;
+    template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IDBGetResult&gt; {
+        typedef IDBGetResult Type;
+        static Type copy(const IDBGetResult&amp;);
+    };
+
</ins><span class="cx">     struct IDBIndexMetadata;
</span><span class="cx">     template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IDBIndexMetadata&gt; {
</span><span class="cx">         typedef IDBIndexMetadata Type;
</span><span class="lines">@@ -179,6 +185,12 @@
</span><span class="cx">         static Type copy(const IDBKeyData&amp;);
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    struct IDBKeyRangeData;
+    template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IDBKeyRangeData&gt; {
+        typedef IDBKeyRangeData Type;
+        static Type copy(const IDBKeyRangeData&amp;);
+    };
+
</ins><span class="cx">     struct IDBObjectStoreMetadata;
</span><span class="cx">     template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IDBObjectStoreMetadata&gt; {
</span><span class="cx">         typedef IDBObjectStoreMetadata Type;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/ChangeLog        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2014-01-23  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IDB: Implement cross-thread and IPC plumbing for 'get' support
+        https://bugs.webkit.org/show_bug.cgi?id=127501
+
+        Reviewed by Anders Carlsson.
+
+        Make the WebProcess call out to the DatabaseProcess with a get request, and handle the
+        response from the DatabaseProcess:
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
+        (WebKit::WebIDBServerConnection::get):
+        (WebKit::WebIDBServerConnection::didGetRecord):
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
+
+        Get the request from the WebProcess and forward it to the appropriate unique IDB database:
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
+        (WebKit::DatabaseProcessIDBConnection::getRecord):
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
+
+        Forward the request to the database thread, and response to the result from that thread:
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
+        (WebKit::UniqueIDBDatabase::getRecord):
+        (WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
+        (WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore):
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
+
+        IPC and asynchronous request infrastructure:
+        * Scripts/webkit2/messages.py:
+        (struct_or_class):
+
+        * Shared/AsyncTask.h:
+        (WebKit::createAsyncTask):
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;IDBGetResult&gt;::encode):
+        (IPC::ArgumentCoder&lt;IDBGetResult&gt;::decode):
+        (IPC::ArgumentCoder&lt;IDBKeyRangeData&gt;::encode):
+        (IPC::ArgumentCoder&lt;IDBKeyRangeData&gt;::decode):
+        * Shared/WebCoreArgumentCoders.h:
+
</ins><span class="cx"> 2014-01-23  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         PDFPlugin: Use PDFPlugin even if there's an external plugin installed, if it's blocked
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebIDBServerConnectionMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/IDBDatabaseMetadata.h&gt;
</span><ins>+#include &lt;WebCore/IDBServerConnection.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IndexedDB.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -188,7 +189,17 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void DatabaseProcessIDBConnection::getRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID, const IDBKeyRangeData&amp; keyRange, int64_t cursorType)
+{
+    ASSERT(m_uniqueIDBDatabase);
</ins><span class="cx"> 
</span><ins>+    LOG(IDB, &quot;DatabaseProcess getRecord request ID %llu, object store id %lli&quot;, requestID, objectStoreID);
+    RefPtr&lt;DatabaseProcessIDBConnection&gt; connection(this);
+    m_uniqueIDBDatabase-&gt;getRecord(IDBTransactionIdentifier(*this, transactionID), objectStoreID, indexID, keyRange, static_cast&lt;IndexedDB::CursorType&gt;(cursorType), [connection, requestID](const IDBGetResult&amp; getResult, uint32_t errorCode, const String&amp; errorMessage) {
+        connection-&gt;send(Messages::WebIDBServerConnection::DidGetRecord(requestID, getResult, errorCode, errorMessage));
+    });
+}
+
</ins><span class="cx"> IPC::Connection* DatabaseProcessIDBConnection::messageSenderConnection()
</span><span class="cx"> {
</span><span class="cx">     return m_connection-&gt;connection();
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> struct IDBKeyData;
</span><ins>+struct IDBKeyRangeData;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -76,6 +77,7 @@
</span><span class="cx">     void createObjectStore(uint64_t requestID, int64_t transactionID, WebCore::IDBObjectStoreMetadata);
</span><span class="cx">     void deleteObjectStore(uint64_t requestID, int64_t transactionID, int64_t objectStoreID);
</span><span class="cx">     void putRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp; value, int64_t putMode, const Vector&lt;int64_t&gt;&amp; indexIDs, const Vector&lt;Vector&lt;WebCore::IDBKeyData&gt;&gt;&amp; indexKeys);
</span><ins>+    void getRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, int64_t cursorType);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;DatabaseToWebProcessConnection&gt; m_connection;
</span><span class="cx">     uint64_t m_serverConnectionIdentifier;
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBDatabaseProcessIDBConnectionmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     CreateObjectStore(uint64_t requestID, int64_t transactionID, WebCore::IDBObjectStoreMetadata objectStoreMetadata)
</span><span class="cx">     DeleteObjectStore(uint64_t requestID, int64_t transactionID, int64_t objectStoreID)
</span><span class="cx">     PutRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, WebCore::IDBKeyData key, IPC::DataReference value, int64_t putMode, Vector&lt;int64_t&gt; indexIDs, Vector&lt;Vector&lt;WebCore::IDBKeyData&gt;&gt; indexKeys)
</span><ins>+    GetRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID, WebCore::IDBKeyRangeData keyRange, int64_t cursorType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE) &amp;&amp; ENABLE(DATABASE_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -38,7 +38,9 @@
</span><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBDatabaseBackend.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBDatabaseMetadata.h&gt;
</span><ins>+#include &lt;WebCore/IDBGetResult.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IDBKeyData.h&gt;
</span><ins>+#include &lt;WebCore/IDBKeyRangeData.h&gt;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -416,6 +418,29 @@
</span><span class="cx">     postDatabaseTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::putRecordInBackingStore, requestID, identifier, m_metadata-&gt;objectStores.get(objectStoreID), keyData, value.vector(), putMode, indexIDs, indexKeys));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::getRecord(const IDBTransactionIdentifier&amp; identifier, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp; keyRangeData, WebCore::IndexedDB::CursorType cursorType, std::function&lt;void(const WebCore::IDBGetResult&amp;, uint32_t, const String&amp;)&gt; callback)
+{
+    ASSERT(isMainThread());
+
+    if (!m_acceptingNewRequests) {
+        callback(IDBGetResult(), INVALID_STATE_ERR, &quot;Unable to get record from database because it has shut down&quot;);
+        return;
+    }
+
+    ASSERT(m_metadata-&gt;objectStores.contains(objectStoreID));
+
+    RefPtr&lt;AsyncRequest&gt; request = AsyncRequestImpl&lt;const IDBGetResult&amp;, uint32_t, const String&amp;&gt;::create([this, callback](const IDBGetResult&amp; result, uint32_t errorCode, const String&amp; errorMessage) {
+        callback(result, errorCode, errorMessage);
+    }, [this, callback]() {
+        callback(IDBGetResult(), INVALID_STATE_ERR, &quot;Unable to get record from database&quot;);
+    });
+
+    uint64_t requestID = request-&gt;requestID();
+    m_pendingDatabaseTasks.add(requestID, request.release());
+
+    postDatabaseTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::getRecordFromBackingStore, requestID, identifier, m_metadata-&gt;objectStores.get(objectStoreID), indexID, keyRangeData, cursorType));
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::openBackingStoreTransaction(const IDBTransactionIdentifier&amp; identifier, const Vector&lt;int64_t&gt;&amp; objectStoreIDs, IndexedDB::TransactionMode mode)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!isMainThread());
</span><span class="lines">@@ -552,6 +577,21 @@
</span><span class="cx">     request-&gt;completeRequest(keyData, errorCode, errorMessage);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBTransactionIdentifier&amp;, const WebCore::IDBObjectStoreMetadata&amp;, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, WebCore::IndexedDB::CursorType)
+{
+    // FIXME: Implement (https://bugs.webkit.org/show_bug.cgi?id=127502)
+
+    postMainThreadTask(createAsyncTask(*this, &amp;UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral(&quot;'get' support not yet implemented&quot;)));
+}
+
+void UniqueIDBDatabase::didGetRecordFromBackingStore(uint64_t requestID, const IDBGetResult&amp; result, uint32_t errorCode, const String&amp; errorMessage)
+{
+    RefPtr&lt;AsyncRequest&gt; request = m_pendingDatabaseTasks.take(requestID);
+    ASSERT(request);
+
+    request-&gt;completeRequest(result, errorCode, errorMessage);
+}
+
</ins><span class="cx"> String UniqueIDBDatabase::absoluteDatabaseDirectory() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx">     void createObjectStore(const IDBTransactionIdentifier&amp;, const WebCore::IDBObjectStoreMetadata&amp;, std::function&lt;void(bool)&gt; successCallback);
</span><span class="cx">     void deleteObjectStore(const IDBTransactionIdentifier&amp;, int64_t objectStoreID, std::function&lt;void(bool)&gt; successCallback);
</span><span class="cx">     void putRecord(const IDBTransactionIdentifier&amp;, int64_t objectStoreID, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp; value, int64_t putMode, const Vector&lt;int64_t&gt;&amp; indexIDs, const Vector&lt;Vector&lt;WebCore::IDBKeyData&gt;&gt;&amp; indexKeys, std::function&lt;void(const WebCore::IDBKeyData&amp;, uint32_t, const String&amp;)&gt; callback);
</span><ins>+    void getRecord(const IDBTransactionIdentifier&amp;, int64_t objectStoreID, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, WebCore::IndexedDB::CursorType, std::function&lt;void(const WebCore::IDBGetResult&amp;, uint32_t, const String&amp;)&gt; callback);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     UniqueIDBDatabase(const UniqueIDBDatabaseIdentifier&amp;);
</span><span class="lines">@@ -120,8 +121,8 @@
</span><span class="cx">     void createObjectStoreInBackingStore(uint64_t requestID, const IDBTransactionIdentifier&amp;, const WebCore::IDBObjectStoreMetadata&amp;);
</span><span class="cx">     void deleteObjectStoreInBackingStore(uint64_t requestID, const IDBTransactionIdentifier&amp;, int64_t objectStoreID);
</span><span class="cx">     void putRecordInBackingStore(uint64_t requestID, const IDBTransactionIdentifier&amp;, const WebCore::IDBObjectStoreMetadata&amp;, const WebCore::IDBKeyData&amp;, const Vector&lt;uint8_t&gt;&amp; value, int64_t putMode, const Vector&lt;int64_t&gt;&amp; indexIDs, const Vector&lt;Vector&lt;WebCore::IDBKeyData&gt;&gt;&amp; indexKeys);
</span><ins>+    void getRecordFromBackingStore(uint64_t requestID, const IDBTransactionIdentifier&amp;, const WebCore::IDBObjectStoreMetadata&amp;, int64_t indexID, const WebCore::IDBKeyRangeData&amp;, WebCore::IndexedDB::CursorType);
</ins><span class="cx"> 
</span><del>-
</del><span class="cx">     void shutdownBackingStore();
</span><span class="cx"> 
</span><span class="cx">     // Callbacks from the database workqueue thread, to be performed on the main thread only
</span><span class="lines">@@ -132,6 +133,7 @@
</span><span class="cx">     void didCreateObjectStore(uint64_t requestID, bool success);
</span><span class="cx">     void didDeleteObjectStore(uint64_t requestID, bool success);
</span><span class="cx">     void didPutRecordInBackingStore(uint64_t requestID, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
</span><ins>+    void didGetRecordFromBackingStore(uint64_t requestID, const WebCore::IDBGetResult&amp;, uint32_t errorCode, const String&amp; errorMessage);
</ins><span class="cx">     void didShutdownBackingStore();
</span><span class="cx">     void didCompleteBoolRequest(uint64_t requestID, bool success);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2Scriptswebkit2messagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Scripts/webkit2/messages.py (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Scripts/webkit2/messages.py        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/Scripts/webkit2/messages.py        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -177,7 +177,9 @@
</span><span class="cx">         'WebCore::FileChooserSettings',
</span><span class="cx">         'WebCore::GrammarDetail',
</span><span class="cx">         'WebCore::IDBDatabaseMetadata',
</span><ins>+        'WebCore::IDBGetResult',
</ins><span class="cx">         'WebCore::IDBKeyData',
</span><ins>+        'WebCore::IDBKeyRangeData',
</ins><span class="cx">         'WebCore::IDBObjectStoreMetadata',
</span><span class="cx">         'WebCore::IdentityTransformOperation',
</span><span class="cx">         'WebCore::KeypressCommand',
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAsyncTaskh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/AsyncTask.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/AsyncTask.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/Shared/AsyncTask.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -134,6 +134,28 @@
</span><span class="cx">         WebCore::CrossThreadCopier&lt;P4&gt;::copy(parameter4));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6&gt;
+std::unique_ptr&lt;AsyncTask&gt; createAsyncTask(
+    T&amp; callee,
+    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6),
+    const P1&amp; parameter1,
+    const P2&amp; parameter2,
+    const P3&amp; parameter3,
+    const P4&amp; parameter4,
+    const P5&amp; parameter5,
+    const P6&amp; parameter6)
+{
+    return std::make_unique&lt;AsyncTaskImpl&lt;T, MP1, MP2, MP3, MP4, MP5, MP6&gt;&gt;(
+        &amp;callee,
+        method,
+        WebCore::CrossThreadCopier&lt;P1&gt;::copy(parameter1),
+        WebCore::CrossThreadCopier&lt;P2&gt;::copy(parameter2),
+        WebCore::CrossThreadCopier&lt;P3&gt;::copy(parameter3),
+        WebCore::CrossThreadCopier&lt;P4&gt;::copy(parameter4),
+        WebCore::CrossThreadCopier&lt;P5&gt;::copy(parameter5),
+        WebCore::CrossThreadCopier&lt;P6&gt;::copy(parameter6));
+}
+
</ins><span class="cx"> template&lt;typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7, typename P8, typename MP8&gt;
</span><span class="cx"> std::unique_ptr&lt;AsyncTask&gt; createAsyncTask(
</span><span class="cx">     T&amp; callee,
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;DataReference.h&quot;
</ins><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><span class="cx"> #include &lt;WebCore/AuthenticationChallenge.h&gt;
</span><span class="cx"> #include &lt;WebCore/CertificateInfo.h&gt;
</span><span class="lines">@@ -42,8 +43,10 @@
</span><span class="cx"> #include &lt;WebCore/GraphicsContext.h&gt;
</span><span class="cx"> #include &lt;WebCore/GraphicsLayer.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBDatabaseMetadata.h&gt;
</span><ins>+#include &lt;WebCore/IDBGetResult.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IDBKeyData.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBKeyPath.h&gt;
</span><ins>+#include &lt;WebCore/IDBKeyRangeData.h&gt;
</ins><span class="cx"> #include &lt;WebCore/Image.h&gt;
</span><span class="cx"> #include &lt;WebCore/Length.h&gt;
</span><span class="cx"> #include &lt;WebCore/PluginData.h&gt;
</span><span class="lines">@@ -1623,6 +1626,42 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;IDBGetResult&gt;::encode(ArgumentEncoder&amp; encoder, const IDBGetResult&amp; result)
+{
+    bool nullData = !result.valueBuffer;
+    encoder &lt;&lt; nullData;
+
+    if (!nullData)
+        encoder &lt;&lt; DataReference(reinterpret_cast&lt;const uint8_t*&gt;(result.valueBuffer-&gt;data()), result.valueBuffer-&gt;size());
+
+    encoder &lt;&lt; result.keyData &lt;&lt; result.keyPath;
+}
+
+bool ArgumentCoder&lt;IDBGetResult&gt;::decode(ArgumentDecoder&amp; decoder, IDBGetResult&amp; result)
+{
+    bool nullData;
+    if (!decoder.decode(nullData))
+        return false;
+
+    if (nullData)
+        result.valueBuffer = nullptr;
+    else {
+        DataReference data;
+        if (!decoder.decode(data))
+            return false;
+
+        result.valueBuffer = SharedBuffer::create(data.data(), data.size());
+    }
+
+    if (!decoder.decode(result.keyData))
+        return false;
+
+    if (!decoder.decode(result.keyPath))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;IDBKeyData&gt;::encode(ArgumentEncoder&amp; encoder, const IDBKeyData&amp; keyData)
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; keyData.isNull;
</span><span class="lines">@@ -1735,6 +1774,38 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;IDBKeyRangeData&gt;::encode(ArgumentEncoder&amp; encoder, const IDBKeyRangeData&amp; keyRange)
+{
+    encoder &lt;&lt; keyRange.isNull;
+    if (keyRange.isNull)
+        return;
+
+    encoder &lt;&lt; keyRange.upperKey &lt;&lt; keyRange.lowerKey &lt;&lt; keyRange.upperOpen &lt;&lt; keyRange.lowerOpen;
+}
+
+bool ArgumentCoder&lt;IDBKeyRangeData&gt;::decode(ArgumentDecoder&amp; decoder, IDBKeyRangeData&amp; keyRange)
+{
+    if (!decoder.decode(keyRange.isNull))
+        return false;
+
+    if (keyRange.isNull)
+        return true;
+
+    if (!decoder.decode(keyRange.upperKey))
+        return false;
+
+    if (!decoder.decode(keyRange.lowerKey))
+        return false;
+
+    if (!decoder.decode(keyRange.upperOpen))
+        return false;
+
+    if (!decoder.decode(keyRange.lowerOpen))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;IDBObjectStoreMetadata&gt;::encode(ArgumentEncoder&amp; encoder, const IDBObjectStoreMetadata&amp; metadata)
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; metadata.name &lt;&lt; metadata.id &lt;&lt; metadata.keyPath &lt;&lt; metadata.autoIncrement &lt;&lt; metadata.maxIndexId &lt;&lt; metadata.indexes;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -65,8 +65,10 @@
</span><span class="cx"> struct DragSession;
</span><span class="cx"> struct FileChooserSettings;
</span><span class="cx"> struct IDBDatabaseMetadata;
</span><ins>+struct IDBGetResult;
</ins><span class="cx"> struct IDBIndexMetadata;
</span><span class="cx"> struct IDBKeyData;
</span><ins>+struct IDBKeyRangeData;
</ins><span class="cx"> struct IDBObjectStoreMetadata;
</span><span class="cx"> struct Length;
</span><span class="cx"> struct GrammarDetail;
</span><span class="lines">@@ -360,6 +362,11 @@
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::IDBDatabaseMetadata&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::IDBGetResult&gt; {
+    static void encode(ArgumentEncoder&amp;, const WebCore::IDBGetResult&amp;);
+    static bool decode(ArgumentDecoder&amp;, WebCore::IDBGetResult&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::IDBIndexMetadata&gt; {
</span><span class="cx">     static void encode(ArgumentEncoder&amp;, const WebCore::IDBIndexMetadata&amp;);
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::IDBIndexMetadata&amp;);
</span><span class="lines">@@ -375,6 +382,11 @@
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::IDBKeyPath&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::IDBKeyRangeData&gt; {
+    static void encode(ArgumentEncoder&amp;, const WebCore::IDBKeyRangeData&amp;);
+    static bool decode(ArgumentDecoder&amp;, WebCore::IDBKeyRangeData&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::IDBObjectStoreMetadata&gt; {
</span><span class="cx">     static void encode(ArgumentEncoder&amp;, const WebCore::IDBObjectStoreMetadata&amp;);
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::IDBObjectStoreMetadata&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><span class="cx"> #include &quot;WebToDatabaseProcessConnection.h&quot;
</span><span class="cx"> #include &lt;WebCore/IDBDatabaseMetadata.h&gt;
</span><ins>+#include &lt;WebCore/IDBKeyRangeData.h&gt;
</ins><span class="cx"> #include &lt;WebCore/SecurityOrigin.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -297,8 +298,23 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBServerConnection::get(IDBTransactionBackend&amp;, const GetOperation&amp;, std::function&lt;void(const IDBGetResult&amp;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</del><ins>+void WebIDBServerConnection::get(IDBTransactionBackend&amp; transaction, const GetOperation&amp; operation, std::function&lt;void(const IDBGetResult&amp;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;AsyncRequest&gt; serverRequest = AsyncRequestImpl&lt;const IDBGetResult&amp;, PassRefPtr&lt;IDBDatabaseError&gt;&gt;::create(completionCallback);
+
+    serverRequest-&gt;setAbortHandler([completionCallback]() {
+        completionCallback(IDBGetResult(), IDBDatabaseError::create(IDBDatabaseException::UnknownError, &quot;Unknown error occured getting record&quot;));
+    });
+
+    uint64_t requestID = serverRequest-&gt;requestID();
+    ASSERT(!m_serverRequests.contains(requestID));
+    m_serverRequests.add(requestID, serverRequest.release());
+
+    LOG(IDB, &quot;WebProcess get request ID %llu&quot;, requestID);
+
+    ASSERT(operation.keyRange());
+
+    send(Messages::DatabaseProcessIDBConnection::GetRecord(requestID, transaction.id(), operation.objectStoreID(), operation.indexID(), operation.keyRange(), static_cast&lt;int64_t&gt;(operation.cursorType())));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebIDBServerConnection::put(IDBTransactionBackend&amp; transaction, const PutOperation&amp; operation, std::function&lt;void(PassRefPtr&lt;IDBKey&gt;, PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</span><span class="lines">@@ -342,6 +358,18 @@
</span><span class="cx">     serverRequest-&gt;completeRequest(resultKey.isNull ? nullptr : resultKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBServerConnection::didGetRecord(uint64_t requestID, const WebCore::IDBGetResult&amp; getResult, uint32_t errorCode, const String&amp; errorMessage)
+{
+    LOG(IDB, &quot;WebProcess didGetRecord request ID %llu (error - %s)&quot;, requestID, errorMessage.utf8().data());
+
+    RefPtr&lt;AsyncRequest&gt; serverRequest = m_serverRequests.take(requestID);
+
+    if (!serverRequest)
+        return;
+
+    serverRequest-&gt;completeRequest(getResult, errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+}
+
</ins><span class="cx"> void WebIDBServerConnection::openCursor(IDBTransactionBackend&amp;, const OpenCursorOperation&amp;, std::function&lt;void(PassRefPtr&lt;IDBDatabaseError&gt;)&gt; completionCallback)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -107,6 +107,7 @@
</span><span class="cx">     void didCreateObjectStore(uint64_t requestID, bool success);
</span><span class="cx">     void didDeleteObjectStore(uint64_t requestID, bool success);
</span><span class="cx">     void didPutRecord(uint64_t requestID, const WebCore::IDBKeyData&amp;, uint32_t errorCode, const String&amp; errorMessage);
</span><ins>+    void didGetRecord(uint64_t requestID, const WebCore::IDBGetResult&amp;, uint32_t errorCode, const String&amp; errorMessage);
</ins><span class="cx"> 
</span><span class="cx">     uint64_t m_serverConnectionIdentifier;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectionmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in (162632 => 162633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in        2014-01-23 20:12:07 UTC (rev 162632)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in        2014-01-23 20:25:34 UTC (rev 162633)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">     DidCreateObjectStore(uint64_t requestID, bool success)
</span><span class="cx">     DidDeleteObjectStore(uint64_t requestID, bool success)
</span><span class="cx">     DidPutRecord(uint64_t requestID, WebCore::IDBKeyData resultKey, uint32_t errorCode, String errorMessage)
</span><ins>+    DidGetRecord(uint64_t requestID, WebCore::IDBGetResult getResult, uint32_t errorCode, String errorMessage)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE) &amp;&amp; ENABLE(DATABASE_PROCESS)
</span></span></pre>
</div>
</div>

</body>
</html>