<!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>[209197] 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/209197">209197</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-12-01 13:33:17 -0800 (Thu, 01 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>IndexedDB 2.0: Implement IDBObjectStore.getKey().
https://bugs.webkit.org/show_bug.cgi?id=165256
Reviewed by Alex Christensen.
Source/WebCore:
Tests: storage/indexeddb/modern/idbobjectstore-getkey-1-private.html
storage/indexeddb/modern/idbobjectstore-getkey-1.html
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::getKey):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::createObjectStoreGet):
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::requestedObjectStoreRecordType):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::didGetRecordOnServer):
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::isolatedCopy):
* Modules/indexeddb/shared/IDBGetRecordData.h:
(WebCore::IDBGetRecordData::encode):
(WebCore::IDBGetRecordData::decode):
LayoutTests:
* storage/indexeddb/modern/idbobjectstore-getkey-1-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getkey-1-private-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getkey-1-private.html: Added.
* storage/indexeddb/modern/idbobjectstore-getkey-1.html: Added.
* storage/indexeddb/modern/resources/idbobjectstore-getkey-1.js: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIndexedDBh">trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.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="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.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="#trunkSourceWebCoreModulesindexeddbsharedIDBGetRecordDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBGetRecordDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1privateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1privatehtml">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1html">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernresourcesidbobjectstoregetkey1js">trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getkey-1.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/LayoutTests/ChangeLog        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-12-01 Brady Eidson <beidson@apple.com>
+
+ IndexedDB 2.0: Implement IDBObjectStore.getKey().
+ https://bugs.webkit.org/show_bug.cgi?id=165256
+
+ Reviewed by Alex Christensen.
+
+ * storage/indexeddb/modern/idbobjectstore-getkey-1-expected.txt: Added.
+ * storage/indexeddb/modern/idbobjectstore-getkey-1-private-expected.txt: Added.
+ * storage/indexeddb/modern/idbobjectstore-getkey-1-private.html: Added.
+ * storage/indexeddb/modern/idbobjectstore-getkey-1.html: Added.
+ * storage/indexeddb/modern/resources/idbobjectstore-getkey-1.js: Added.
+
</ins><span class="cx"> 2016-12-01 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> [Modern Media Controls] Turn off text selection
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-expected.txt (0 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-expected.txt        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test IDBObjectStore.getKey()
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+getKey(6) result is: undefined
+getKey(3) result is: 3
+getKey(IDBKeyRange.only(5)) result is: 5
+getKey(IDBKeyRange.lowerBound(2)) result is: 2
+getKey(IDBKeyRange.upperBound(2)) result is: 1
+getKey(IDBKeyRange.bound(2, 4)) result is: 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1privateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private-expected.txt (0 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private-expected.txt        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test IDBObjectStore.getKey()
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+getKey(6) result is: undefined
+getKey(3) result is: 3
+getKey(IDBKeyRange.only(5)) result is: 5
+getKey(IDBKeyRange.lowerBound(2)) result is: 2
+getKey(IDBKeyRange.upperBound(2)) result is: 1
+getKey(IDBKeyRange.bound(2, 4)) result is: 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1privatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private.html (0 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1-private.html        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/shared.js"></script>
+</head>
+<body>
+
+<script src="resources/idbobjectstore-getkey-1.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetkey1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1.html (0 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getkey-1.html        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/shared.js"></script>
+</head>
+<body>
+
+<script src="resources/idbobjectstore-getkey-1.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernresourcesidbobjectstoregetkey1js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getkey-1.js (0 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getkey-1.js         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getkey-1.js        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+description("Test IDBObjectStore.getKey()");
+
+indexedDBTest(prepareDatabase);
+
+function done()
+{
+ finishJSTest();
+}
+
+function log(message)
+{
+ debug(message);
+}
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+ testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+ setTimeout("testGenerator.next();", 0);
+}
+
+function idbRequest(request)
+{
+ request.onerror = continueWithEvent;
+ request.onsuccess = continueWithEvent;
+        return request;
+}
+
+var db;
+
+function prepareDatabase(event)
+{
+ debug("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ db = event.target.result;
+ os = db.createObjectStore("foo");
+        os.add(false, 1);
+        os.add(-10, 2);
+        os.add(10, 3);
+        os.add("hello", 4);
+        os.add("hellothere", 5);
+
+ event.target.transaction.oncomplete = function() {
+ testGenerator = testSteps();
+ testGenerator.next();
+ };
+}
+
+function* testSteps()
+{
+ objectStore = db.transaction("foo").objectStore("foo");
+        
+        // Non-existent key
+ req = idbRequest(objectStore.getKey(6));
+ event = yield;
+        debug("getKey(6) result is: " + req.result);
+
+        // Existent key
+ req = idbRequest(objectStore.getKey(3));
+ event = yield;
+        debug("getKey(3) result is: " + req.result);
+        
+        // Key range only
+ req = idbRequest(objectStore.getKey(IDBKeyRange.only(5)));
+ event = yield;
+        debug("getKey(IDBKeyRange.only(5)) result is: " + req.result);
+
+        // Key range lower bound
+ req = idbRequest(objectStore.getKey(IDBKeyRange.lowerBound(2)));
+ event = yield;
+        debug("getKey(IDBKeyRange.lowerBound(2)) result is: " + req.result);
+
+        // Key range upper bound
+ req = idbRequest(objectStore.getKey(IDBKeyRange.upperBound(2)));
+ event = yield;
+        debug("getKey(IDBKeyRange.upperBound(2)) result is: " + req.result);
+
+        // Key range bound
+ req = idbRequest(objectStore.getKey(IDBKeyRange.bound(2, 4)));
+ event = yield;
+        debug("getKey(IDBKeyRange.bound(2, 4)) result is: " + req.result);
+
+ finishJSTest();
+ }
+
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/ChangeLog        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-12-01 Brady Eidson <beidson@apple.com>
+
+ IndexedDB 2.0: Implement IDBObjectStore.getKey().
+ https://bugs.webkit.org/show_bug.cgi?id=165256
+
+ Reviewed by Alex Christensen.
+
+ Tests: storage/indexeddb/modern/idbobjectstore-getkey-1-private.html
+ storage/indexeddb/modern/idbobjectstore-getkey-1.html
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::get):
+ (WebCore::IDBObjectStore::getKey):
+ * Modules/indexeddb/IDBObjectStore.h:
+ * Modules/indexeddb/IDBObjectStore.idl:
+
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::createObjectStoreGet):
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::requestedObjectStoreRecordType):
+ * Modules/indexeddb/IDBRequest.h:
+
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::requestGetRecord):
+ (WebCore::IDBTransaction::requestIndexRecord):
+ (WebCore::IDBTransaction::didGetRecordOnServer):
+
+ * Modules/indexeddb/IndexedDB.h:
+
+ * Modules/indexeddb/server/IDBBackingStore.h:
+
+ * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+ (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
+ * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+ * Modules/indexeddb/server/MemoryObjectStore.h:
+
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+ (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
+ (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+ * Modules/indexeddb/shared/IDBGetRecordData.cpp:
+ (WebCore::IDBGetRecordData::isolatedCopy):
+ * Modules/indexeddb/shared/IDBGetRecordData.h:
+ (WebCore::IDBGetRecordData::encode):
+ (WebCore::IDBGetRecordData::decode):
+
</ins><span class="cx"> 2016-12-01 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Misc. cleanup in Modules/fetch
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> if (!idbKey->isValid())
</span><span class="cx"> return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.") };
</span><span class="cx">
</span><del>- return m_transaction.requestGetRecord(execState, *this, { idbKey.ptr() });
</del><ins>+ return m_transaction.requestGetRecord(execState, *this, { idbKey.ptr(), IDBGetRecordDataType::KeyAndValue });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> IDBObjectStore::get(ExecState& execState, IDBKeyRange* keyRange)
</span><span class="lines">@@ -238,9 +238,45 @@
</span><span class="cx"> if (!keyRangeData.isValid())
</span><span class="cx"> return Exception { IDBDatabaseException::DataError };
</span><span class="cx">
</span><del>- return m_transaction.requestGetRecord(execState, *this, { keyRangeData });
</del><ins>+ return m_transaction.requestGetRecord(execState, *this, { keyRangeData, IDBGetRecordDataType::KeyAndValue });
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getKey(ExecState& execState, JSValue key)
+{
+ LOG(IndexedDB, "IDBObjectStore::getKey");
+ ASSERT(currentThread() == m_transaction.database().originThreadID());
+
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'getKey' on 'IDBObjectStore': The object store has been deleted.") };
+
+ if (!m_transaction.isActive())
+ return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'getKey' on 'IDBObjectStore': The transaction is inactive or finished.") };
+
+ auto idbKey = scriptValueToIDBKey(execState, key);
+ if (!idbKey->isValid())
+ return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'getKey' on 'IDBObjectStore': The parameter is not a valid key.") };
+
+ return m_transaction.requestGetRecord(execState, *this, { idbKey.ptr(), IDBGetRecordDataType::KeyOnly });
+}
+
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getKey(ExecState& execState, IDBKeyRange* keyRange)
+{
+ LOG(IndexedDB, "IDBObjectStore::getKey");
+ ASSERT(currentThread() == m_transaction.database().originThreadID());
+
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'getKey' on 'IDBObjectStore': The object store has been deleted.") };
+
+ if (!m_transaction.isActive())
+ return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'getKey' on 'IDBObjectStore': The transaction is inactive or finished.") };
+
+ IDBKeyRangeData keyRangeData(keyRange);
+ if (!keyRangeData.isValid())
+ return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'getKey' on 'IDBObjectStore': The parameter is not a valid key range.") };
+
+ return m_transaction.requestGetRecord(execState, *this, { keyRangeData, IDBGetRecordDataType::KeyOnly });
+}
+
</ins><span class="cx"> ExceptionOr<Ref<IDBRequest>> IDBObjectStore::add(ExecState& execState, JSValue value, JSValue key)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<IDBKey> idbKey;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -77,6 +77,8 @@
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, JSC::JSValue key, const String& direction);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> get(JSC::ExecState&, JSC::JSValue key);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> get(JSC::ExecState&, IDBKeyRange*);
</span><ins>+ ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, JSC::JSValue key);
+ ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, IDBKeyRange*);
</ins><span class="cx"> ExceptionOr<Ref<IDBRequest>> add(JSC::ExecState&, JSC::JSValue, JSC::JSValue key);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> put(JSC::ExecState&, JSC::JSValue, JSC::JSValue key);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> deleteFunction(JSC::ExecState&, IDBKeyRange*);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx"> [CallWith=ScriptState, ImplementedAs=deleteFunction, MayThrowException] IDBRequest delete(any key);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest get(IDBKeyRange? key);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest get(any key);
</span><ins>+ [CallWith=ScriptState, MayThrowException] IDBRequest getKey(IDBKeyRange? key);
+ [CallWith=ScriptState, MayThrowException] IDBRequest getKey(any key);
</ins><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest clear();
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = "next");
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional DOMString direction = "next");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -68,6 +68,11 @@
</span><span class="cx"> return adoptRef(*new IDBRequest(context, index, transaction));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Ref<IDBRequest> IDBRequest::createObjectStoreGet(ScriptExecutionContext& context, IDBObjectStore& objectStore, IndexedDB::ObjectStoreRecordType type, IDBTransaction& transaction)
+{
+ return adoptRef(*new IDBRequest(context, objectStore, type, transaction));
+}
+
</ins><span class="cx"> Ref<IDBRequest> IDBRequest::createIndexGet(ScriptExecutionContext& context, IDBIndex& index, IndexedDB::IndexRecordType requestedRecordType, IDBTransaction& transaction)
</span><span class="cx"> {
</span><span class="cx"> return adoptRef(*new IDBRequest(context, index, requestedRecordType, transaction));
</span><span class="lines">@@ -115,6 +120,17 @@
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBRequest::IDBRequest(ScriptExecutionContext& context, IDBObjectStore& objectStore, IndexedDB::ObjectStoreRecordType type, IDBTransaction& transaction)
+ : IDBActiveDOMObject(&context)
+ , m_transaction(&transaction)
+ , m_resourceIdentifier(transaction.connectionProxy())
+ , m_objectStoreSource(&objectStore)
+ , m_requestedObjectStoreRecordType(type)
+ , m_connectionProxy(transaction.database().connectionProxy())
+{
+ suspendIfNeeded();
+}
+
</ins><span class="cx"> IDBRequest::IDBRequest(ScriptExecutionContext& context, IDBIndex& index, IndexedDB::IndexRecordType requestedRecordType, IDBTransaction& transaction)
</span><span class="cx"> : IDBRequest(context, index, transaction)
</span><span class="cx"> {
</span><span class="lines">@@ -198,6 +214,13 @@
</span><span class="cx"> return m_indexSource->info().identifier();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IndexedDB::ObjectStoreRecordType IDBRequest::requestedObjectStoreRecordType() const
+{
+ ASSERT(currentThread() == originThreadID());
+
+ return m_requestedObjectStoreRecordType;
+}
+
</ins><span class="cx"> IndexedDB::IndexRecordType IDBRequest::requestedIndexRecordType() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> static Ref<IDBRequest> create(ScriptExecutionContext&, IDBObjectStore&, IDBTransaction&);
</span><span class="cx"> static Ref<IDBRequest> create(ScriptExecutionContext&, IDBCursor&, IDBTransaction&);
</span><span class="cx"> static Ref<IDBRequest> create(ScriptExecutionContext&, IDBIndex&, IDBTransaction&);
</span><ins>+ static Ref<IDBRequest> createObjectStoreGet(ScriptExecutionContext&, IDBObjectStore&, IndexedDB::ObjectStoreRecordType, IDBTransaction&);
</ins><span class="cx"> static Ref<IDBRequest> createIndexGet(ScriptExecutionContext&, IDBIndex&, IndexedDB::IndexRecordType, IDBTransaction&);
</span><span class="cx">
</span><span class="cx"> const IDBResourceIdentifier& resourceIdentifier() const { return m_resourceIdentifier; }
</span><span class="lines">@@ -80,6 +81,7 @@
</span><span class="cx">
</span><span class="cx"> uint64_t sourceObjectStoreIdentifier() const;
</span><span class="cx"> uint64_t sourceIndexIdentifier() const;
</span><ins>+ IndexedDB::ObjectStoreRecordType requestedObjectStoreRecordType() const;
</ins><span class="cx"> IndexedDB::IndexRecordType requestedIndexRecordType() const;
</span><span class="cx">
</span><span class="cx"> ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
</span><span class="lines">@@ -132,6 +134,7 @@
</span><span class="cx"> IDBRequest(ScriptExecutionContext&, IDBObjectStore&, IDBTransaction&);
</span><span class="cx"> IDBRequest(ScriptExecutionContext&, IDBCursor&, IDBTransaction&);
</span><span class="cx"> IDBRequest(ScriptExecutionContext&, IDBIndex&, IDBTransaction&);
</span><ins>+ IDBRequest(ScriptExecutionContext&, IDBObjectStore&, IndexedDB::ObjectStoreRecordType, IDBTransaction&);
</ins><span class="cx"> IDBRequest(ScriptExecutionContext&, IDBIndex&, IndexedDB::IndexRecordType, IDBTransaction&);
</span><span class="cx">
</span><span class="cx"> void clearResult();
</span><span class="lines">@@ -168,7 +171,8 @@
</span><span class="cx"> RefPtr<IDBCursor> m_cursorSource;
</span><span class="cx">
</span><span class="cx"> bool m_hasPendingActivity { true };
</span><del>- IndexedDB::IndexRecordType m_requestedIndexRecordType;
</del><ins>+ IndexedDB::ObjectStoreRecordType m_requestedObjectStoreRecordType { IndexedDB::ObjectStoreRecordType::ValueOnly };
+ IndexedDB::IndexRecordType m_requestedIndexRecordType { IndexedDB::IndexRecordType::Key };
</ins><span class="cx">
</span><span class="cx"> RefPtr<IDBCursor> m_pendingCursor;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -952,7 +952,9 @@
</span><span class="cx">
</span><span class="cx"> ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
</span><span class="cx">
</span><del>- auto request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
</del><ins>+ IndexedDB::ObjectStoreRecordType type = getRecordData.type == IDBGetRecordDataType::KeyAndValue ? IndexedDB::ObjectStoreRecordType::ValueOnly : IndexedDB::ObjectStoreRecordType::KeyOnly;
+
+ auto request = IDBRequest::createObjectStoreGet(*scriptExecutionContext(), objectStore, type, *this);
</ins><span class="cx"> addRequest(request.get());
</span><span class="cx">
</span><span class="cx"> scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData));
</span><span class="lines">@@ -988,7 +990,7 @@
</span><span class="cx"> auto request = IDBRequest::createIndexGet(*scriptExecutionContext(), index, type, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="cx">
</span><del>- IDBGetRecordData getRecordData = { range };
</del><ins>+ IDBGetRecordData getRecordData = { range, IDBGetRecordDataType::KeyAndValue };
</ins><span class="cx"> scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData));
</span><span class="cx">
</span><span class="cx"> return request;
</span><span class="lines">@@ -1014,9 +1016,13 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(resultData.type() == IDBResultType::GetRecordSuccess);
</span><span class="cx">
</span><ins>+ bool useResultKey = request.sourceIndexIdentifier() && request.requestedIndexRecordType() == IndexedDB::IndexRecordType::Key;
+ if (!useResultKey)
+ useResultKey = request.requestedObjectStoreRecordType() == IndexedDB::ObjectStoreRecordType::KeyOnly;
+
</ins><span class="cx"> const IDBGetResult& result = resultData.getResult();
</span><span class="cx">
</span><del>- if (request.sourceIndexIdentifier() && request.requestedIndexRecordType() == IndexedDB::IndexRecordType::Key) {
</del><ins>+ if (useResultKey) {
</ins><span class="cx"> if (!result.keyData().isNull())
</span><span class="cx"> request.setResult(result.keyData());
</span><span class="cx"> else
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIndexedDBh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -74,6 +74,11 @@
</span><span class="cx"> Value,
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+enum class ObjectStoreRecordType {
+ ValueOnly,
+ KeyOnly,
+};
+
</ins><span class="cx"> // In order of the least to the highest precedent in terms of sort order.
</span><span class="cx"> enum KeyType {
</span><span class="cx"> Max = -1,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -43,6 +43,8 @@
</span><span class="cx"> class IDBValue;
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx">
</span><ins>+enum class IDBGetRecordDataType;
+
</ins><span class="cx"> struct IDBGetAllRecordsData;
</span><span class="cx"> struct IDBIterateCursorData;
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="lines">@@ -80,7 +82,7 @@
</span><span class="cx"> virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) = 0;
</span><span class="cx"> virtual IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&) = 0;
</span><del>- virtual IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetResult& outValue) = 0;
</del><ins>+ virtual IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetRecordDataType, IDBGetResult& outValue) = 0;
</ins><span class="cx"> virtual IDBError getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&, IDBGetAllResult& outValue) = 0;
</span><span class="cx"> virtual IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) = 0;
</span><span class="cx"> virtual IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "IDBCursorInfo.h"
</span><span class="cx"> #include "IDBGetAllRecordsData.h"
</span><ins>+#include "IDBGetRecordData.h"
</ins><span class="cx"> #include "IDBGetResult.h"
</span><span class="cx"> #include "IDBIndexInfo.h"
</span><span class="cx"> #include "IDBIterateCursorData.h"
</span><span class="lines">@@ -350,7 +351,7 @@
</span><span class="cx"> return objectStore->addRecord(*transaction, keyData, value);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IDBError MemoryIDBBackingStore::getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& range, IDBGetResult& outValue)
</del><ins>+IDBError MemoryIDBBackingStore::getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& range, IDBGetRecordDataType type, IDBGetResult& outValue)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::getRecord");
</span><span class="cx">
</span><span class="lines">@@ -363,7 +364,15 @@
</span><span class="cx"> if (!objectStore)
</span><span class="cx"> return { IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found") };
</span><span class="cx">
</span><del>- outValue = objectStore->valueForKeyRange(range);
</del><ins>+ switch (type) {
+ case IDBGetRecordDataType::KeyAndValue:
+ outValue = objectStore->valueForKeyRange(range);
+ break;
+ case IDBGetRecordDataType::KeyOnly:
+ outValue = objectStore->lowestKeyWithRecordInRange(range);
+ break;
+ }
+
</ins><span class="cx"> return { };
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) final;
</span><span class="cx"> IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) final;
</span><span class="cx"> IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&) final;
</span><del>- IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</del><ins>+ IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetRecordDataType, IDBGetResult& outValue) final;
</ins><span class="cx"> IDBError getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&, IDBGetAllResult& outValue) final;
</span><span class="cx"> IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</span><span class="cx"> IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx">
</span><span class="cx"> ThreadSafeDataBuffer valueForKey(const IDBKeyData&) const;
</span><span class="cx"> ThreadSafeDataBuffer valueForKeyRange(const IDBKeyRangeData&) const;
</span><ins>+ IDBKeyData lowestKeyWithRecordInRange(const IDBKeyRangeData&) const;
</ins><span class="cx"> IDBGetResult indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
</span><span class="cx"> uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&) const;
</span><span class="cx">
</span><span class="lines">@@ -106,7 +107,6 @@
</span><span class="cx"> private:
</span><span class="cx"> MemoryObjectStore(const IDBObjectStoreInfo&);
</span><span class="cx">
</span><del>- IDBKeyData lowestKeyWithRecordInRange(const IDBKeyRangeData&) const;
</del><span class="cx"> std::set<IDBKeyData>::iterator lowestIteratorInRange(const IDBKeyRangeData&, bool reverse) const;
</span><span class="cx">
</span><span class="cx"> IDBError populateIndexWithExistingRecords(MemoryIndex&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "IDBDatabaseException.h"
</span><span class="cx"> #include "IDBGetAllRecordsData.h"
</span><span class="cx"> #include "IDBGetAllResult.h"
</span><ins>+#include "IDBGetRecordData.h"
</ins><span class="cx"> #include "IDBGetResult.h"
</span><span class="cx"> #include "IDBIterateCursorData.h"
</span><span class="cx"> #include "IDBKeyData.h"
</span><span class="lines">@@ -1785,7 +1786,7 @@
</span><span class="cx"> return { };
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IDBError SQLiteIDBBackingStore::getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, const IDBKeyRangeData& keyRange, IDBGetResult& resultValue)
</del><ins>+IDBError SQLiteIDBBackingStore::getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, const IDBKeyRangeData& keyRange, IDBGetRecordDataType type, IDBGetResult& resultValue)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "SQLiteIDBBackingStore::getRecord - key range %s, object store %" PRIu64, keyRange.loggingString().utf8().data(), objectStoreID);
</span><span class="cx">
</span><span class="lines">@@ -1824,17 +1825,39 @@
</span><span class="cx"> static NeverDestroyed<ASCIILiteral> lowerClosedUpperOpen("SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
</span><span class="cx"> static NeverDestroyed<ASCIILiteral> lowerClosedUpperClosed("SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
</span><span class="cx">
</span><ins>+ static NeverDestroyed<ASCIILiteral> lowerOpenUpperOpenKeyOnly("SELECT key FROM Records WHERE objectStoreID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<ASCIILiteral> lowerOpenUpperClosedKeyOnly("SELECT key FROM Records WHERE objectStoreID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<ASCIILiteral> lowerClosedUpperOpenKeyOnly("SELECT key FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<ASCIILiteral> lowerClosedUpperClosedKeyOnly("SELECT key FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
+
</ins><span class="cx"> SQLiteStatement* sql = nullptr;
</span><del>- if (keyRange.lowerOpen) {
- if (keyRange.upperOpen)
- sql = cachedStatement(SQL::GetValueRecordsLowerOpenUpperOpen, lowerOpenUpperOpen.get());
- else
- sql = cachedStatement(SQL::GetValueRecordsLowerOpenUpperClosed, lowerOpenUpperClosed.get());
- } else {
- if (keyRange.upperOpen)
- sql = cachedStatement(SQL::GetValueRecordsLowerClosedUpperOpen, lowerClosedUpperOpen.get());
- else
- sql = cachedStatement(SQL::GetValueRecordsLowerClosedUpperClosed, lowerClosedUpperClosed.get());
</del><ins>+
+ switch (type) {
+ case IDBGetRecordDataType::KeyAndValue:
+ if (keyRange.lowerOpen) {
+ if (keyRange.upperOpen)
+ sql = cachedStatement(SQL::GetValueRecordsLowerOpenUpperOpen, lowerOpenUpperOpen.get());
+ else
+ sql = cachedStatement(SQL::GetValueRecordsLowerOpenUpperClosed, lowerOpenUpperClosed.get());
+ } else {
+ if (keyRange.upperOpen)
+ sql = cachedStatement(SQL::GetValueRecordsLowerClosedUpperOpen, lowerClosedUpperOpen.get());
+ else
+ sql = cachedStatement(SQL::GetValueRecordsLowerClosedUpperClosed, lowerClosedUpperClosed.get());
+ }
+ break;
+ case IDBGetRecordDataType::KeyOnly:
+ if (keyRange.lowerOpen) {
+ if (keyRange.upperOpen)
+ sql = cachedStatement(SQL::GetKeyRecordsLowerOpenUpperOpen, lowerOpenUpperOpenKeyOnly.get());
+ else
+ sql = cachedStatement(SQL::GetKeyRecordsLowerOpenUpperClosed, lowerOpenUpperClosedKeyOnly.get());
+ } else {
+ if (keyRange.upperOpen)
+ sql = cachedStatement(SQL::GetKeyRecordsLowerClosedUpperOpen, lowerClosedUpperOpenKeyOnly.get());
+ else
+ sql = cachedStatement(SQL::GetKeyRecordsLowerClosedUpperClosed, lowerClosedUpperClosedKeyOnly.get());
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!sql
</span><span class="lines">@@ -1861,9 +1884,27 @@
</span><span class="cx"> sql->getColumnBlobAsVector(0, buffer);
</span><span class="cx"> resultBuffer = ThreadSafeDataBuffer::adoptVector(buffer);
</span><span class="cx">
</span><del>- recordID = sql->getColumnInt64(1);
</del><ins>+ if (type == IDBGetRecordDataType::KeyAndValue)
+ recordID = sql->getColumnInt64(1);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (type == IDBGetRecordDataType::KeyOnly) {
+ auto* vector = resultBuffer.data();
+ if (!vector) {
+ LOG_ERROR("Unable to deserialize key data from database for IDBObjectStore.getKey()");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Error extracting key data from database executing IDBObjectStore.getKey()") };
+ }
+
+ IDBKeyData keyData;
+ if (!deserializeIDBKeyData(vector->data(), vector->size(), keyData)) {
+ LOG_ERROR("Unable to deserialize key data from database for IDBObjectStore.getKey()");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Error extracting key data from database executing IDBObjectStore.getKey()") };
+ }
+
+ resultValue = { keyData };
+ return { };
+ }
+
</ins><span class="cx"> ASSERT(recordID);
</span><span class="cx"> Vector<String> blobURLs, blobFilePaths;
</span><span class="cx"> auto error = getBlobRecordsForObjectStoreRecord(recordID, blobURLs, blobFilePaths);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) final;
</span><span class="cx"> IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) final;
</span><span class="cx"> IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&) final;
</span><del>- IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</del><ins>+ IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetRecordDataType, IDBGetResult& outValue) final;
</ins><span class="cx"> IDBError getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&, IDBGetAllResult& outValue) final;
</span><span class="cx"> IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</span><span class="cx"> IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) final;
</span><span class="lines">@@ -159,6 +159,10 @@
</span><span class="cx"> GetValueRecordsLowerOpenUpperClosed,
</span><span class="cx"> GetValueRecordsLowerClosedUpperOpen,
</span><span class="cx"> GetValueRecordsLowerClosedUpperClosed,
</span><ins>+ GetKeyRecordsLowerOpenUpperOpen,
+ GetKeyRecordsLowerOpenUpperClosed,
+ GetKeyRecordsLowerClosedUpperOpen,
+ GetKeyRecordsLowerClosedUpperClosed,
</ins><span class="cx"> Count
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -1051,7 +1051,7 @@
</span><span class="cx"> if (uint64_t indexIdentifier = requestData.indexIdentifier())
</span><span class="cx"> postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performGetIndexRecord, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), indexIdentifier, requestData.indexRecordType(), getRecordData.keyRangeData));
</span><span class="cx"> else
</span><del>- postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performGetRecord, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), getRecordData.keyRangeData));
</del><ins>+ postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performGetRecord, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), getRecordData.keyRangeData, getRecordData.type));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void UniqueIDBDatabase::getAllRecords(const IDBRequestData& requestData, const IDBGetAllRecordsData& getAllRecordsData, GetAllResultsCallback callback)
</span><span class="lines">@@ -1066,7 +1066,7 @@
</span><span class="cx"> postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performGetAllRecords, callbackID, requestData.transactionIdentifier(), getAllRecordsData));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& keyRangeData)
</del><ins>+void UniqueIDBDatabase::performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& keyRangeData, IDBGetRecordDataType type)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(db) UniqueIDBDatabase::performGetRecord");
</span><span class="lines">@@ -1074,7 +1074,7 @@
</span><span class="cx"> ASSERT(m_backingStore);
</span><span class="cx">
</span><span class="cx"> IDBGetResult result;
</span><del>- IDBError error = m_backingStore->getRecord(transactionIdentifier, objectStoreIdentifier, keyRangeData, result);
</del><ins>+ IDBError error = m_backingStore->getRecord(transactionIdentifier, objectStoreIdentifier, keyRangeData, type, result);
</ins><span class="cx">
</span><span class="cx"> postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformGetRecord, callbackIdentifier, error, result));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBTransactionInfo;
</span><span class="cx">
</span><ins>+enum class IDBGetRecordDataType;
+
</ins><span class="cx"> namespace IndexedDB {
</span><span class="cx"> enum class IndexRecordType;
</span><span class="cx"> }
</span><span class="lines">@@ -156,7 +158,7 @@
</span><span class="cx"> void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</span><span class="cx"> void performRenameIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
</span><span class="cx"> void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><del>- void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</del><ins>+ void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetRecordDataType);
</ins><span class="cx"> void performGetAllRecords(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&);
</span><span class="cx"> void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&);
</span><span class="cx"> void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBGetRecordDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.cpp (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.cpp        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.cpp        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">
</span><span class="cx"> IDBGetRecordData IDBGetRecordData::isolatedCopy() const
</span><span class="cx"> {
</span><del>- return { keyRangeData.isolatedCopy() };
</del><ins>+ return { keyRangeData.isolatedCopy(), type };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBGetRecordDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.h (209196 => 209197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.h        2016-12-01 21:23:27 UTC (rev 209196)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.h        2016-12-01 21:33:17 UTC (rev 209197)
</span><span class="lines">@@ -31,8 +31,14 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+enum class IDBGetRecordDataType {
+ KeyOnly,
+ KeyAndValue,
+};
+
</ins><span class="cx"> struct IDBGetRecordData {
</span><span class="cx"> IDBKeyRangeData keyRangeData;
</span><ins>+ IDBGetRecordDataType type;
</ins><span class="cx">
</span><span class="cx"> IDBGetRecordData isolatedCopy() const;
</span><span class="cx">
</span><span class="lines">@@ -44,6 +50,7 @@
</span><span class="cx"> void IDBGetRecordData::encode(Encoder& encoder) const
</span><span class="cx"> {
</span><span class="cx"> encoder << keyRangeData;
</span><ins>+ encoder.encodeEnum(type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<class Decoder>
</span><span class="lines">@@ -52,6 +59,9 @@
</span><span class="cx"> if (!decoder.decode(getRecordData.keyRangeData))
</span><span class="cx"> return false;
</span><span class="cx">
</span><ins>+ if (!decoder.decodeEnum(getRecordData.type))
+ return false;
+
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>