<!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>[210148] 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/210148">210148</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-12-25 17:33:33 -0800 (Sun, 25 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebIDL] Remove (most) custom bindings for the IndexedDB code
https://bugs.webkit.org/show_bug.cgi?id=166451
Reviewed by Darin Adler.
Source/WebCore:
Removes the custom bindings for all but one attribute (IDBRequest.result) in
the IndexedDB code.
- Adds a new WebIDL extension type, IDBKey, to represent the complex key conversion
rules IndexedDB specifies.
- Replaces custom bindings for IDBCursor.source with use of a union.
- Replaces custom enum type checking for IDBCursor.direction with a WebIDL enum.
- Replaces custom code generation for IDBKeyPaths with a union.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::source):
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::directionNext): Deleted.
(WebCore::IDBCursor::directionNextUnique): Deleted.
(WebCore::IDBCursor::directionPrev): Deleted.
(WebCore::IDBCursor::directionPrevUnique): Deleted.
(WebCore::IDBCursor::stringToDirection): Deleted.
(WebCore::IDBCursor::directionToString): Deleted.
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::objectStore): Deleted.
(WebCore::IDBCursor::index): Deleted.
Replace custom enum checking with direct use of the enum, letting the generator
handle the checks. Also adds source function which returns a Variant.
* Modules/indexeddb/IDBCursor.idl:
Remove custom annotation and use correct types.
* Modules/indexeddb/IDBCursorDirection.h: Added.
* Modules/indexeddb/IDBCursorDirection.idl: Added.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
Replace Strings with IDBCursorDirection enums.
* Modules/indexeddb/IDBKeyRange.idl:
Remove annotation and use new IDBKey extension type.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onSuccess):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
Use ReadyState enum in place of the old m_isDone boolean.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::source):
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::completeRequestAndDispatchEvent):
(WebCore::IDBRequest::readyState): Deleted.
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::readyState):
(WebCore::IDBRequest::isDone):
(WebCore::IDBRequest::objectStoreSource): Deleted.
(WebCore::IDBRequest::indexSource): Deleted.
(WebCore::IDBRequest::cursorSource): Deleted.
* Modules/indexeddb/IDBRequest.idl:
Replace the readyState String with a enum, and the custom source binding with a
source function that returns a Variant.
* Modules/indexeddb/IndexedDB.h:
Add the missing values to CursorDirection to make it comply with the IDL definition.
* bindings/generic/IDLTypes.h:
* bindings/js/JSDOMConvert.h:
(WebCore::JSConverter<IDLIDBKey<T>>::convert):
Add new extension type IDLIDBKey.
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::source): Deleted.
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::source): Deleted.
Remove custom bindings.
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
* bindings/scripts/CodeGeneratorJS.pm:
(GetBaseIDLType):
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
(NativeToJSValue):
Add support for IDBKey, and remove custom code for IndexedDB in core conversion logic.
* bindings/scripts/IDLAttributes.txt:
Remove now unused ImplementationReturnType attribute.
* inspector/InspectorIndexedDBAgent.cpp:
Update to work with new functions taking enums rather than strings.
LayoutTests:
* storage/indexeddb/exceptions-expected.txt:
* storage/indexeddb/exceptions-private-expected.txt:
* storage/indexeddb/index-basics-expected.txt:
* storage/indexeddb/index-basics-private-expected.txt:
* storage/indexeddb/index-basics-workers-expected.txt:
* storage/indexeddb/objectstore-cursor-expected.txt:
* storage/indexeddb/objectstore-cursor-private-expected.txt:
Update results for improved exception messages.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbexceptionsexpectedtxt">trunk/LayoutTests/storage/indexeddb/exceptions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbexceptionsprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/exceptions-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbindexbasicsexpectedtxt">trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbindexbasicsprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbindexbasicsworkersexpectedtxt">trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbobjectstorecursorexpectedtxt">trunk/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbobjectstorecursorprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/objectstore-cursor-private-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursoridl">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexcpp">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexh">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexidl">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangeidl">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl</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="#trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp</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="#trunkSourceWebCoreModulesindexeddbIDBRequestidl">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIndexedDBh">trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBCursorInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericIDLTypesh">trunk/Source/WebCore/bindings/generic/IDLTypes.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBRequestCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorDirectionh">trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorDirectionidl">trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/ChangeLog        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-12-25 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove (most) custom bindings for the IndexedDB code
+ https://bugs.webkit.org/show_bug.cgi?id=166451
+
+ Reviewed by Darin Adler.
+
+ * storage/indexeddb/exceptions-expected.txt:
+ * storage/indexeddb/exceptions-private-expected.txt:
+ * storage/indexeddb/index-basics-expected.txt:
+ * storage/indexeddb/index-basics-private-expected.txt:
+ * storage/indexeddb/index-basics-workers-expected.txt:
+ * storage/indexeddb/objectstore-cursor-expected.txt:
+ * storage/indexeddb/objectstore-cursor-private-expected.txt:
+ Update results for improved exception messages.
+
</ins><span class="cx"> 2016-12-23 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbexceptionsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/exceptions-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/exceptions-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/exceptions-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx"> The value for the direction parameter is invalid.
</span><span class="cx"> Expecting TypeError exception from store.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS store.openCursor(0, 'invalid-direction') threw TypeError: Type error
</del><ins>+PASS store.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBObjectStore.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> IDBObjectStore.put()
</span><span class="cx"> This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly".
</span><span class="lines">@@ -390,7 +390,7 @@
</span><span class="cx"> The value for the direction parameter is invalid.
</span><span class="cx"> Expecting TypeError exception from index.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS index.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> IDBIndex.openKeyCursor()
</span><span class="cx"> If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError.
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx"> The value for the direction parameter is invalid.
</span><span class="cx"> Expecting TypeError exception from index.openKeyCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openKeyCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> 3.2.7 Cursor
</span><span class="cx"> transaction = db.transaction(['store', 'inlineKeyStore'], 'readwrite')
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbexceptionsprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/exceptions-private-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/exceptions-private-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/exceptions-private-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx"> The value for the direction parameter is invalid.
</span><span class="cx"> Expecting TypeError exception from store.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS store.openCursor(0, 'invalid-direction') threw TypeError: Type error
</del><ins>+PASS store.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBObjectStore.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> IDBObjectStore.put()
</span><span class="cx"> This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly".
</span><span class="lines">@@ -390,7 +390,7 @@
</span><span class="cx"> The value for the direction parameter is invalid.
</span><span class="cx"> Expecting TypeError exception from index.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS index.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> IDBIndex.openKeyCursor()
</span><span class="cx"> If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError.
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx"> The value for the direction parameter is invalid.
</span><span class="cx"> Expecting TypeError exception from index.openKeyCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openKeyCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> 3.2.7 Cursor
</span><span class="cx"> transaction = db.transaction(['store', 'inlineKeyStore'], 'readwrite')
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbindexbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openKeyCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> indexObject.openKeyCursor()
</span><span class="cx"> PASS event.target.source is indexObject
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> indexObject.openCursor()
</span><span class="cx"> PASS event.target.source is indexObject
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbindexbasicsprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openKeyCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> indexObject.openKeyCursor()
</span><span class="cx"> PASS event.target.source is indexObject
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> indexObject.openCursor()
</span><span class="cx"> PASS event.target.source is indexObject
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbindexbasicsworkersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> [Worker] Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> [Worker] Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-direction')
</span><span class="cx"> PASS [Worker] Exception was thrown.
</span><del>-PASS [Worker] indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS [Worker] indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openKeyCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx"> [Worker]
</span><span class="cx"> [Worker] indexObject.openKeyCursor()
</span><span class="cx"> PASS [Worker] event.target.source is indexObject
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> [Worker] Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> [Worker] Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS [Worker] Exception was thrown.
</span><del>-PASS [Worker] indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.
</del><ins>+PASS [Worker] indexObject.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBIndex.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx"> [Worker]
</span><span class="cx"> [Worker] indexObject.openCursor()
</span><span class="cx"> PASS [Worker] event.target.source is indexObject
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbobjectstorecursorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> Expecting TypeError exception from objectStore.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS objectStore.openCursor(0, 'invalid-direction') threw TypeError: Type error
</del><ins>+PASS objectStore.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBObjectStore.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> objectStore.add('', testData[nextToAdd])
</span><span class="cx"> objectStore.add('', testData[nextToAdd])
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbobjectstorecursorprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/objectstore-cursor-private-expected.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/objectstore-cursor-private-expected.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/LayoutTests/storage/indexeddb/objectstore-cursor-private-expected.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> Verify that specifying an invalid direction raises an exception:
</span><span class="cx"> Expecting TypeError exception from objectStore.openCursor(0, 'invalid-direction')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS objectStore.openCursor(0, 'invalid-direction') threw TypeError: Type error
</del><ins>+PASS objectStore.openCursor(0, 'invalid-direction') threw TypeError: Argument 2 ('direction') to IDBObjectStore.openCursor must be one of: "next", "nextunique", "prev", "prevunique"
</ins><span class="cx">
</span><span class="cx"> objectStore.add('', testData[nextToAdd])
</span><span class="cx"> objectStore.add('', testData[nextToAdd])
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -182,6 +182,7 @@
</span><span class="cx">
</span><span class="cx"> Modules/indexeddb/DOMWindowIndexedDatabase.idl
</span><span class="cx"> Modules/indexeddb/IDBCursor.idl
</span><ins>+ Modules/indexeddb/IDBCursorDirection.idl
</ins><span class="cx"> Modules/indexeddb/IDBCursorWithValue.idl
</span><span class="cx"> Modules/indexeddb/IDBDatabase.idl
</span><span class="cx"> Modules/indexeddb/IDBFactory.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/ChangeLog        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -1,3 +1,112 @@
</span><ins>+2016-12-24 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove (most) custom bindings for the IndexedDB code
+ https://bugs.webkit.org/show_bug.cgi?id=166451
+
+ Reviewed by Darin Adler.
+
+ Removes the custom bindings for all but one attribute (IDBRequest.result) in
+ the IndexedDB code.
+ - Adds a new WebIDL extension type, IDBKey, to represent the complex key conversion
+ rules IndexedDB specifies.
+ - Replaces custom bindings for IDBCursor.source with use of a union.
+ - Replaces custom enum type checking for IDBCursor.direction with a WebIDL enum.
+ - Replaces custom code generation for IDBKeyPaths with a union.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::source):
+ (WebCore::IDBCursor::direction):
+ (WebCore::IDBCursor::directionNext): Deleted.
+ (WebCore::IDBCursor::directionNextUnique): Deleted.
+ (WebCore::IDBCursor::directionPrev): Deleted.
+ (WebCore::IDBCursor::directionPrevUnique): Deleted.
+ (WebCore::IDBCursor::stringToDirection): Deleted.
+ (WebCore::IDBCursor::directionToString): Deleted.
+ * Modules/indexeddb/IDBCursor.h:
+ (WebCore::IDBCursor::objectStore): Deleted.
+ (WebCore::IDBCursor::index): Deleted.
+ Replace custom enum checking with direct use of the enum, letting the generator
+ handle the checks. Also adds source function which returns a Variant.
+
+ * Modules/indexeddb/IDBCursor.idl:
+ Remove custom annotation and use correct types.
+
+ * Modules/indexeddb/IDBCursorDirection.h: Added.
+ * Modules/indexeddb/IDBCursorDirection.idl: Added.
+
+ * Modules/indexeddb/IDBIndex.cpp:
+ (WebCore::IDBIndex::openCursor):
+ (WebCore::IDBIndex::openKeyCursor):
+ * Modules/indexeddb/IDBIndex.h:
+ * Modules/indexeddb/IDBIndex.idl:
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::openCursor):
+ (WebCore::IDBObjectStore::openKeyCursor):
+ * Modules/indexeddb/IDBObjectStore.h:
+ * Modules/indexeddb/IDBObjectStore.idl:
+ Replace Strings with IDBCursorDirection enums.
+
+ * Modules/indexeddb/IDBKeyRange.idl:
+ Remove annotation and use new IDBKey extension type.
+
+ * Modules/indexeddb/IDBOpenDBRequest.cpp:
+ (WebCore::IDBOpenDBRequest::onSuccess):
+ (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
+ (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
+ Use ReadyState enum in place of the old m_isDone boolean.
+
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::error):
+ (WebCore::IDBRequest::source):
+ (WebCore::IDBRequest::dispatchEvent):
+ (WebCore::IDBRequest::willIterateCursor):
+ (WebCore::IDBRequest::completeRequestAndDispatchEvent):
+ (WebCore::IDBRequest::readyState): Deleted.
+ * Modules/indexeddb/IDBRequest.h:
+ (WebCore::IDBRequest::readyState):
+ (WebCore::IDBRequest::isDone):
+ (WebCore::IDBRequest::objectStoreSource): Deleted.
+ (WebCore::IDBRequest::indexSource): Deleted.
+ (WebCore::IDBRequest::cursorSource): Deleted.
+ * Modules/indexeddb/IDBRequest.idl:
+ Replace the readyState String with a enum, and the custom source binding with a
+ source function that returns a Variant.
+
+ * Modules/indexeddb/IndexedDB.h:
+ Add the missing values to CursorDirection to make it comply with the IDL definition.
+
+ * bindings/generic/IDLTypes.h:
+ * bindings/js/JSDOMConvert.h:
+ (WebCore::JSConverter<IDLIDBKey<T>>::convert):
+ Add new extension type IDLIDBKey.
+
+ * bindings/js/JSIDBCursorCustom.cpp:
+ (WebCore::JSIDBCursor::source): Deleted.
+ * bindings/js/JSIDBRequestCustom.cpp:
+ (WebCore::JSIDBRequest::source): Deleted.
+ Remove custom bindings.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (IsBuiltinType):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GetBaseIDLType):
+ (NativeToJSValueDOMConvertNeedsState):
+ (NativeToJSValueDOMConvertNeedsGlobalObject):
+ (NativeToJSValue):
+ Add support for IDBKey, and remove custom code for IndexedDB in core conversion logic.
+
+ * bindings/scripts/IDLAttributes.txt:
+ Remove now unused ImplementationReturnType attribute.
+
+ * inspector/InspectorIndexedDBAgent.cpp:
+ Update to work with new functions taking enums rather than strings.
+
</ins><span class="cx"> 2016-12-23 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/DerivedSources.make        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -126,6 +126,7 @@
</span><span class="cx"> $(WebCore)/Modules/geolocation/PositionOptions.idl \
</span><span class="cx"> $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
</span><span class="cx"> $(WebCore)/Modules/indexeddb/IDBCursor.idl \
</span><ins>+ $(WebCore)/Modules/indexeddb/IDBCursorDirection.idl \
</ins><span class="cx"> $(WebCore)/Modules/indexeddb/IDBCursorWithValue.idl \
</span><span class="cx"> $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
</span><span class="cx"> $(WebCore)/Modules/indexeddb/IDBFactory.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -43,71 +43,11 @@
</span><span class="cx"> #include <heap/HeapInlines.h>
</span><span class="cx"> #include <heap/StrongInlines.h>
</span><span class="cx"> #include <runtime/JSCJSValueInlines.h>
</span><del>-#include <wtf/NeverDestroyed.h>
</del><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-const AtomicString& IDBCursor::directionNext()
-{
- static NeverDestroyed<AtomicString> next("next", AtomicString::ConstructFromLiteral);
- return next;
-}
-
-const AtomicString& IDBCursor::directionNextUnique()
-{
- static NeverDestroyed<AtomicString> nextunique("nextunique", AtomicString::ConstructFromLiteral);
- return nextunique;
-}
-
-const AtomicString& IDBCursor::directionPrev()
-{
- static NeverDestroyed<AtomicString> prev("prev", AtomicString::ConstructFromLiteral);
- return prev;
-}
-
-const AtomicString& IDBCursor::directionPrevUnique()
-{
- static NeverDestroyed<AtomicString> prevunique("prevunique", AtomicString::ConstructFromLiteral);
- return prevunique;
-}
-
-std::optional<IndexedDB::CursorDirection> IDBCursor::stringToDirection(const String& directionString)
-{
- if (directionString == directionNext())
- return IndexedDB::CursorDirection::Next;
- if (directionString == directionNextUnique())
- return IndexedDB::CursorDirection::NextNoDuplicate;
- if (directionString == directionPrev())
- return IndexedDB::CursorDirection::Prev;
- if (directionString == directionPrevUnique())
- return IndexedDB::CursorDirection::PrevNoDuplicate;
-
- return std::nullopt;
-}
-
-const AtomicString& IDBCursor::directionToString(IndexedDB::CursorDirection direction)
-{
- switch (direction) {
- case IndexedDB::CursorDirection::Next:
- return directionNext();
-
- case IndexedDB::CursorDirection::NextNoDuplicate:
- return directionNextUnique();
-
- case IndexedDB::CursorDirection::Prev:
- return directionPrev();
-
- case IndexedDB::CursorDirection::PrevNoDuplicate:
- return directionPrevUnique();
-
- default:
- ASSERT_NOT_REACHED();
- return directionNext();
- }
-}
-
</del><span class="cx"> Ref<IDBCursor> IDBCursor::create(IDBTransaction& transaction, IDBObjectStore& objectStore, const IDBCursorInfo& info)
</span><span class="cx"> {
</span><span class="cx"> return adoptRef(*new IDBCursor(transaction, objectStore, info));
</span><span class="lines">@@ -121,7 +61,7 @@
</span><span class="cx"> IDBCursor::IDBCursor(IDBTransaction& transaction, IDBObjectStore& objectStore, const IDBCursorInfo& info)
</span><span class="cx"> : ActiveDOMObject(transaction.scriptExecutionContext())
</span><span class="cx"> , m_info(info)
</span><del>- , m_objectStore(&objectStore)
</del><ins>+ , m_source(&objectStore)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx">
</span><span class="lines">@@ -131,7 +71,7 @@
</span><span class="cx"> IDBCursor::IDBCursor(IDBTransaction& transaction, IDBIndex& index, const IDBCursorInfo& info)
</span><span class="cx"> : ActiveDOMObject(transaction.scriptExecutionContext())
</span><span class="cx"> , m_info(info)
</span><del>- , m_index(&index)
</del><ins>+ , m_source(&index)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx">
</span><span class="lines">@@ -147,20 +87,18 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
</span><span class="cx">
</span><del>- if (m_objectStore)
- return m_objectStore->isDeleted();
-
- ASSERT(m_index);
- return m_index->isDeleted() || m_index->objectStore().isDeleted();
</del><ins>+ return WTF::switchOn(m_source,
+ [] (const RefPtr<IDBObjectStore>& objectStore) { return objectStore->isDeleted(); },
+ [] (const RefPtr<IDBIndex>& index) { return index->isDeleted() || index->objectStore().isDeleted(); }
+ );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBObjectStore& IDBCursor::effectiveObjectStore() const
</span><span class="cx"> {
</span><del>- if (m_objectStore)
- return *m_objectStore;
-
- ASSERT(m_index);
- return m_index->objectStore();
</del><ins>+ return WTF::switchOn(m_source,
+ [] (const RefPtr<IDBObjectStore>& objectStore) -> IDBObjectStore& { return *objectStore; },
+ [] (const RefPtr<IDBIndex>& index) -> IDBObjectStore& { return index->objectStore(); }
+ );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBTransaction& IDBCursor::transaction() const
</span><span class="lines">@@ -169,12 +107,6 @@
</span><span class="cx"> return effectiveObjectStore().transaction();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const String& IDBCursor::direction() const
-{
- ASSERT(currentThread() == effectiveObjectStore().transaction().database().originThreadID());
- return directionToString(m_info.cursorDirection());
-}
-
</del><span class="cx"> ExceptionOr<Ref<IDBRequest>> IDBCursor::update(ExecState& state, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBCursor::update");
</span><span class="lines">@@ -251,7 +183,7 @@
</span><span class="cx"> if (sourcesDeleted())
</span><span class="cx"> return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'continuePrimaryKey' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
</span><span class="cx">
</span><del>- if (!m_index)
</del><ins>+ if (!WTF::holds_alternative<RefPtr<IDBIndex>>(m_source))
</ins><span class="cx"> return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral("Failed to execute 'continuePrimaryKey' on 'IDBCursor': The cursor's source is not an index.") };
</span><span class="cx">
</span><span class="cx"> auto direction = m_info.cursorDirection();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -30,8 +30,10 @@
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><span class="cx"> #include "DOMWrapperWorld.h"
</span><span class="cx"> #include "ExceptionOr.h"
</span><ins>+#include "IDBCursorDirection.h"
</ins><span class="cx"> #include "IDBCursorInfo.h"
</span><span class="cx"> #include <heap/Strong.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -44,23 +46,16 @@
</span><span class="cx"> public:
</span><span class="cx"> static Ref<IDBCursor> create(IDBTransaction&, IDBObjectStore&, const IDBCursorInfo&);
</span><span class="cx"> static Ref<IDBCursor> create(IDBTransaction&, IDBIndex&, const IDBCursorInfo&);
</span><del>-
- static const AtomicString& directionNext();
- static const AtomicString& directionNextUnique();
- static const AtomicString& directionPrev();
- static const AtomicString& directionPrevUnique();
-
- static std::optional<IndexedDB::CursorDirection> stringToDirection(const String& modeString);
- static const AtomicString& directionToString(IndexedDB::CursorDirection mode);
</del><span class="cx">
</span><span class="cx"> virtual ~IDBCursor();
</span><span class="cx">
</span><del>- const String& direction() const;
</del><ins>+ using Source = Variant<RefPtr<IDBObjectStore>, RefPtr<IDBIndex>>;
+
+ const Source& source() const;
+ IDBCursorDirection direction() const;
</ins><span class="cx"> JSC::JSValue key() const;
</span><span class="cx"> JSC::JSValue primaryKey() const;
</span><span class="cx"> JSC::JSValue value() const;
</span><del>- IDBObjectStore* objectStore() const { return m_objectStore.get(); }
- IDBIndex* index() const { return m_index.get(); }
</del><span class="cx">
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> update(JSC::ExecState&, JSC::JSValue);
</span><span class="cx"> ExceptionOr<void> advance(unsigned);
</span><span class="lines">@@ -103,8 +98,7 @@
</span><span class="cx"> unsigned m_outstandingRequestCount { 1 };
</span><span class="cx">
</span><span class="cx"> IDBCursorInfo m_info;
</span><del>- RefPtr<IDBObjectStore> m_objectStore;
- RefPtr<IDBIndex> m_index;
</del><ins>+ Source m_source;
</ins><span class="cx"> IDBRequest* m_request { nullptr };
</span><span class="cx">
</span><span class="cx"> bool m_gotValue { false };
</span><span class="lines">@@ -117,6 +111,17 @@
</span><span class="cx"> JSC::Strong<JSC::Unknown> m_currentValue;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+
+inline const IDBCursor::Source& IDBCursor::source() const
+{
+ return m_source;
+}
+
+inline IDBCursorDirection IDBCursor::direction() const
+{
+ return m_info.cursorDirection();
+}
+
</ins><span class="cx"> inline JSC::JSValue IDBCursor::key() const
</span><span class="cx"> {
</span><span class="cx"> return m_currentKey.get();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> JSCustomMarkFunction,
</span><span class="cx"> SkipVTableValidation,
</span><span class="cx"> ] interface IDBCursor {
</span><del>- [CustomGetter] readonly attribute any source;
- readonly attribute DOMString direction;
</del><ins>+ readonly attribute (IDBObjectStore or IDBIndex) source;
+ readonly attribute IDBCursorDirection direction;
</ins><span class="cx"> readonly attribute any key;
</span><span class="cx"> readonly attribute any primaryKey;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorDirectionh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.h (0 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.h         (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "IndexedDB.h"
+
+namespace WebCore {
+
+using IDBCursorDirection = IndexedDB::CursorDirection;
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorDirectionidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.idl (0 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.idl         (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorDirection.idl        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ Conditional=INDEXED_DATABASE,
+] enum IDBCursorDirection {
+ "next",
+ "nextunique",
+ "prev",
+ "prevunique"
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> m_deleted = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBIndex::openCursor(ExecState& execState, IDBKeyRange* range, const String& directionString)
</del><ins>+ExceptionOr<Ref<IDBRequest>> IDBIndex::openCursor(ExecState& execState, IDBKeyRange* range, IDBCursorDirection direction)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::openCursor");
</span><span class="cx"> ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="lines">@@ -162,10 +162,6 @@
</span><span class="cx"> if (!m_objectStore.transaction().isActive())
</span><span class="cx"> return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'openCursor' on 'IDBIndex': The transaction is inactive or finished.") };
</span><span class="cx">
</span><del>- auto direction = IDBCursor::stringToDirection(directionString);
- if (!direction)
- return Exception { TypeError, ASCIILiteral("Failed to execute 'openCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.") };
-
</del><span class="cx"> IDBKeyRangeData rangeData = range;
</span><span class="cx"> if (rangeData.lowerKey.isNull())
</span><span class="cx"> rangeData.lowerKey = IDBKeyData::minimum();
</span><span class="lines">@@ -172,11 +168,11 @@
</span><span class="cx"> if (rangeData.upperKey.isNull())
</span><span class="cx"> rangeData.upperKey = IDBKeyData::maximum();
</span><span class="cx">
</span><del>- auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), rangeData, direction.value(), IndexedDB::CursorType::KeyAndValue);
</del><ins>+ auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), rangeData, direction, IndexedDB::CursorType::KeyAndValue);
</ins><span class="cx"> return m_objectStore.transaction().requestOpenCursor(execState, *this, info);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBIndex::openCursor(ExecState& execState, JSValue key, const String& direction)
</del><ins>+ExceptionOr<Ref<IDBRequest>> IDBIndex::openCursor(ExecState& execState, JSValue key, IDBCursorDirection direction)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::openCursor");
</span><span class="cx"> ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="lines">@@ -188,6 +184,31 @@
</span><span class="cx"> return openCursor(execState, keyRange.releaseReturnValue().ptr(), direction);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ExceptionOr<Ref<IDBRequest>> IDBIndex::openKeyCursor(ExecState& execState, IDBKeyRange* range, IDBCursorDirection direction)
+{
+ LOG(IndexedDB, "IDBIndex::openKeyCursor");
+ ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
+
+ if (m_deleted || m_objectStore.isDeleted())
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The index or its object store has been deleted.") };
+
+ if (!m_objectStore.transaction().isActive())
+ return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction is inactive or finished.") };
+
+ auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), range, direction, IndexedDB::CursorType::KeyOnly);
+ return m_objectStore.transaction().requestOpenCursor(execState, *this, info);
+}
+
+ExceptionOr<Ref<IDBRequest>> IDBIndex::openKeyCursor(ExecState& execState, JSValue key, IDBCursorDirection direction)
+{
+ LOG(IndexedDB, "IDBIndex::openKeyCursor");
+
+ auto keyRange = IDBKeyRange::only(execState, key);
+ if (keyRange.hasException())
+ return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The parameter is not a valid key.") };
+ return openKeyCursor(execState, keyRange.releaseReturnValue().ptr(), direction);
+}
+
</ins><span class="cx"> ExceptionOr<Ref<IDBRequest>> IDBIndex::count(ExecState& execState, IDBKeyRange* range)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::count");
</span><span class="lines">@@ -223,35 +244,6 @@
</span><span class="cx"> return transaction.requestCount(execState, *this, range);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBIndex::openKeyCursor(ExecState& execState, IDBKeyRange* range, const String& directionString)
-{
- LOG(IndexedDB, "IDBIndex::openKeyCursor");
- ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
-
- if (m_deleted || m_objectStore.isDeleted())
- return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The index or its object store has been deleted.") };
-
- if (!m_objectStore.transaction().isActive())
- return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction is inactive or finished.") };
-
- auto direction = IDBCursor::stringToDirection(directionString);
- if (!direction)
- return Exception { TypeError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The direction provided ('invalid-direction') is not one of 'next', 'nextunique', 'prev', or 'prevunique'.") };
-
- auto info = IDBCursorInfo::indexCursor(m_objectStore.transaction(), m_objectStore.info().identifier(), m_info.identifier(), range, direction.value(), IndexedDB::CursorType::KeyOnly);
- return m_objectStore.transaction().requestOpenCursor(execState, *this, info);
-}
-
-ExceptionOr<Ref<IDBRequest>> IDBIndex::openKeyCursor(ExecState& execState, JSValue key, const String& direction)
-{
- LOG(IndexedDB, "IDBIndex::openKeyCursor");
-
- auto keyRange = IDBKeyRange::only(execState, key);
- if (keyRange.hasException())
- return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBIndex': The parameter is not a valid key.") };
- return openKeyCursor(execState, keyRange.releaseReturnValue().ptr(), direction);
-}
-
</del><span class="cx"> ExceptionOr<Ref<IDBRequest>> IDBIndex::get(ExecState& execState, IDBKeyRange* range)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::get");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -56,15 +56,14 @@
</span><span class="cx">
</span><span class="cx"> void rollbackInfoForVersionChangeAbort();
</span><span class="cx">
</span><del>- ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, IDBKeyRange*, const String& direction);
- ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, JSC::JSValue key, const String& direction);
</del><ins>+ ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, IDBKeyRange*, IDBCursorDirection);
+ ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, JSC::JSValue key, IDBCursorDirection);
+ ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, IDBKeyRange*, IDBCursorDirection);
+ ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, JSC::JSValue key, IDBCursorDirection);
</ins><span class="cx">
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, IDBKeyRange*);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, JSC::JSValue key);
</span><span class="cx">
</span><del>- ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, IDBKeyRange*, const String& direction);
- ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, JSC::JSValue key, const String& direction);
-
</del><span class="cx"> ExceptionOr<Ref<IDBRequest>> get(JSC::ExecState&, IDBKeyRange*);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> get(JSC::ExecState&, JSC::JSValue key);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, IDBKeyRange*);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -23,6 +23,10 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+// NOTE: This type is specified as 'any' in the IndexedDB specification, but is always
+// constrained to this union.
+typedef (DOMString or sequence<DOMString>) IDBKeyPath;
+
</ins><span class="cx"> [
</span><span class="cx"> Conditional=INDEXED_DATABASE,
</span><span class="cx"> EnabledAtRuntime=IndexedDB,
</span><span class="lines">@@ -32,15 +36,15 @@
</span><span class="cx"> ] interface IDBIndex {
</span><span class="cx"> [SetterMayThrowException] attribute DOMString name;
</span><span class="cx"> readonly attribute IDBObjectStore objectStore;
</span><del>- [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;
</del><ins>+ readonly attribute IDBKeyPath? keyPath;
</ins><span class="cx"> readonly attribute boolean multiEntry;
</span><span class="cx"> readonly attribute boolean unique;
</span><span class="cx">
</span><del>- [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = "next");
- [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional DOMString direction = "next");
</del><ins>+ [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional IDBCursorDirection direction = "next");
+ [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional IDBCursorDirection direction = "next");
</ins><span class="cx">
</span><del>- [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional DOMString direction = "next");
- [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional DOMString direction = "next");
</del><ins>+ [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional IDBCursorDirection direction = "next");
+ [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional IDBCursorDirection direction = "next");
</ins><span class="cx">
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest get(IDBKeyRange? key);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest get(any key);
</span><span class="lines">@@ -53,4 +57,3 @@
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest count(optional IDBKeyRange? range = null);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest count(any key);
</span><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -28,8 +28,11 @@
</span><span class="cx"> ImplementationLacksVTable,
</span><span class="cx"> EnabledAtRuntime=IndexedDB,
</span><span class="cx"> ] interface IDBKeyRange {
</span><del>- [ImplementationReturnType=IDBKey] readonly attribute any lower;
- [ImplementationReturnType=IDBKey] readonly attribute any upper;
</del><ins>+ // NOTE: The 'lower' and 'upper' attributes are specified to be of type 'any'
+ // but we use the extension type IDBKey, to allow code generator to know our
+ // which conversion to use based on our actual implementation type.
+ readonly attribute IDBKey lower;
+ readonly attribute IDBKey upper;
</ins><span class="cx"> readonly attribute boolean lowerOpen;
</span><span class="cx"> readonly attribute boolean upperOpen;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> return m_info.autoIncrement();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openCursor(ExecState& execState, RefPtr<IDBKeyRange> range, const String& directionString)
</del><ins>+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openCursor(ExecState& execState, RefPtr<IDBKeyRange> range, IDBCursorDirection direction)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::openCursor");
</span><span class="cx"> ASSERT(currentThread() == m_transaction.database().originThreadID());
</span><span class="lines">@@ -161,15 +161,11 @@
</span><span class="cx"> if (!m_transaction.isActive())
</span><span class="cx"> return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'openCursor' on 'IDBObjectStore': The transaction is inactive or finished.") };
</span><span class="cx">
</span><del>- auto direction = IDBCursor::stringToDirection(directionString);
- if (!direction)
- return Exception { TypeError };
-
- auto info = IDBCursorInfo::objectStoreCursor(m_transaction, m_info.identifier(), range.get(), direction.value(), IndexedDB::CursorType::KeyAndValue);
</del><ins>+ auto info = IDBCursorInfo::objectStoreCursor(m_transaction, m_info.identifier(), range.get(), direction, IndexedDB::CursorType::KeyAndValue);
</ins><span class="cx"> return m_transaction.requestOpenCursor(execState, *this, info);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openCursor(ExecState& execState, JSValue key, const String& direction)
</del><ins>+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openCursor(ExecState& execState, JSValue key, IDBCursorDirection direction)
</ins><span class="cx"> {
</span><span class="cx"> auto onlyResult = IDBKeyRange::only(execState, key);
</span><span class="cx"> if (onlyResult.hasException())
</span><span class="lines">@@ -178,7 +174,7 @@
</span><span class="cx"> return openCursor(execState, onlyResult.releaseReturnValue(), direction);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openKeyCursor(ExecState& execState, RefPtr<IDBKeyRange> range, const String& directionString)
</del><ins>+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openKeyCursor(ExecState& execState, RefPtr<IDBKeyRange> range, IDBCursorDirection direction)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::openCursor");
</span><span class="cx"> ASSERT(currentThread() == m_transaction.database().originThreadID());
</span><span class="lines">@@ -189,15 +185,11 @@
</span><span class="cx"> if (!m_transaction.isActive())
</span><span class="cx"> return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'openKeyCursor' on 'IDBObjectStore': The transaction is inactive or finished.") };
</span><span class="cx">
</span><del>- auto direction = IDBCursor::stringToDirection(directionString);
- if (!direction)
- return Exception { TypeError };
-
- auto info = IDBCursorInfo::objectStoreCursor(m_transaction, m_info.identifier(), range.get(), direction.value(), IndexedDB::CursorType::KeyOnly);
</del><ins>+ auto info = IDBCursorInfo::objectStoreCursor(m_transaction, m_info.identifier(), range.get(), direction, IndexedDB::CursorType::KeyOnly);
</ins><span class="cx"> return m_transaction.requestOpenCursor(execState, *this, info);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openKeyCursor(ExecState& execState, JSValue key, const String& direction)
</del><ins>+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::openKeyCursor(ExecState& execState, JSValue key, IDBCursorDirection direction)
</ins><span class="cx"> {
</span><span class="cx"> auto onlyResult = IDBKeyRange::only(execState, key);
</span><span class="cx"> if (onlyResult.hasException())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><span class="cx"> #include "ExceptionOr.h"
</span><ins>+#include "IDBCursorDirection.h"
</ins><span class="cx"> #include "IDBKeyPath.h"
</span><span class="cx"> #include "IDBObjectStoreInfo.h"
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="lines">@@ -71,10 +72,10 @@
</span><span class="cx"> bool multiEntry;
</span><span class="cx"> };
</span><span class="cx">
</span><del>- ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, RefPtr<IDBKeyRange>, const String& direction);
- ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, JSC::JSValue key, const String& direction);
- ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, RefPtr<IDBKeyRange>, const String& direction);
- ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, JSC::JSValue key, const String& direction);
</del><ins>+ ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, RefPtr<IDBKeyRange>, IDBCursorDirection);
+ ExceptionOr<Ref<IDBRequest>> openCursor(JSC::ExecState&, JSC::JSValue key, IDBCursorDirection);
+ ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, RefPtr<IDBKeyRange>, IDBCursorDirection);
+ ExceptionOr<Ref<IDBRequest>> openKeyCursor(JSC::ExecState&, JSC::JSValue key, IDBCursorDirection);
</ins><span class="cx"> ExceptionOr<Ref<IDBRequest>> get(JSC::ExecState&, JSC::JSValue key);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> get(JSC::ExecState&, IDBKeyRange*);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, JSC::JSValue key);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -23,6 +23,10 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+// NOTE: This type is specified as 'any' in the IndexedDB specification, but is always
+// constrained to this union.
+typedef (DOMString or sequence<DOMString>) IDBKeyPath;
+
</ins><span class="cx"> [
</span><span class="cx"> Conditional=INDEXED_DATABASE,
</span><span class="cx"> EnabledAtRuntime=IndexedDB,
</span><span class="lines">@@ -31,7 +35,7 @@
</span><span class="cx"> SkipVTableValidation,
</span><span class="cx"> ] interface IDBObjectStore {
</span><span class="cx"> [SetterMayThrowException] attribute DOMString name;
</span><del>- [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;
</del><ins>+ readonly attribute IDBKeyPath? keyPath;
</ins><span class="cx"> readonly attribute DOMStringList indexNames;
</span><span class="cx"> readonly attribute IDBTransaction transaction;
</span><span class="cx"> readonly attribute boolean autoIncrement;
</span><span class="lines">@@ -45,10 +49,10 @@
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest getKey(IDBKeyRange? key);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest getKey(any key);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest clear();
</span><del>- [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = "next");
- [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional DOMString direction = "next");
- [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional DOMString direction = "next");
- [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional DOMString direction = "next");
</del><ins>+ [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(optional IDBKeyRange? range = null, optional IDBCursorDirection direction = "next");
+ [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional IDBCursorDirection direction = "next");
+ [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional IDBCursorDirection direction = "next");
+ [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional IDBCursorDirection direction = "next");
</ins><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest getAll(optional IDBKeyRange? range = null, [EnforceRange] optional unsigned long count);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest getAll(any key, [EnforceRange] optional unsigned long count);
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest getAllKeys(optional IDBKeyRange? range = null, [EnforceRange] optional unsigned long count);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span><span class="cx">
</span><span class="cx"> setResult(IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData));
</span><del>- m_isDone = true;
</del><ins>+ m_readyState = ReadyState::Done;
</ins><span class="cx">
</span><span class="cx"> enqueueEvent(IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this));
</span><span class="cx"> }
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::onUpgradeNeeded() - current version is %" PRIu64 ", new is %" PRIu64, oldVersion, newVersion);
</span><span class="cx">
</span><span class="cx"> setResult(WTFMove(database));
</span><del>- m_isDone = true;
</del><ins>+ m_readyState = ReadyState::Done;
</ins><span class="cx"> m_transaction = WTFMove(transaction);
</span><span class="cx"> m_transaction->addRequest(*this);
</span><span class="cx">
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::onDeleteDatabaseSuccess() - current version is %" PRIu64, oldVersion);
</span><span class="cx">
</span><del>- m_isDone = true;
</del><ins>+ m_readyState = ReadyState::Done;
</ins><span class="cx"> setResultToUndefined();
</span><span class="cx">
</span><span class="cx"> enqueueEvent(IDBVersionChangeEvent::create(oldVersion, 0, eventNames().successEvent));
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "ThreadSafeDataBuffer.h"
</span><span class="cx"> #include <heap/StrongInlines.h>
</span><del>-#include <wtf/NeverDestroyed.h>
</del><ins>+#include <wtf/Variant.h>
</ins><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="lines">@@ -101,13 +101,16 @@
</span><span class="cx"> : IDBActiveDOMObject(&context)
</span><span class="cx"> , m_transaction(&transaction)
</span><span class="cx"> , m_resourceIdentifier(transaction.connectionProxy())
</span><del>- , m_objectStoreSource(cursor.objectStore())
- , m_indexSource(cursor.index())
</del><span class="cx"> , m_pendingCursor(&cursor)
</span><span class="cx"> , m_connectionProxy(transaction.database().connectionProxy())
</span><span class="cx"> {
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx">
</span><ins>+ WTF::switchOn(cursor.source(),
+ [this] (const RefPtr<IDBIndex>& index) { this->m_indexSource = index; },
+ [this] (const RefPtr<IDBObjectStore>& objectStore) { this->m_objectStoreSource = objectStore; }
+ );
+
</ins><span class="cx"> cursor.setRequest(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -150,12 +153,24 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span><span class="cx">
</span><del>- if (!m_isDone)
</del><ins>+ if (!isDone())
</ins><span class="cx"> return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to read the 'error' property from 'IDBRequest': The request has not finished.") };
</span><span class="cx">
</span><span class="cx"> return m_domError.get();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+std::optional<IDBRequest::Source> IDBRequest::source() const
+{
+ if (m_cursorSource)
+ return Source { m_cursorSource };
+ if (m_indexSource)
+ return Source { m_indexSource };
+ if (m_objectStoreSource)
+ return Source { m_objectStoreSource };
+
+ return std::nullopt;
+}
+
</ins><span class="cx"> void IDBRequest::setSource(IDBCursor& cursor)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span><span class="lines">@@ -186,15 +201,6 @@
</span><span class="cx"> return m_shouldExposeTransactionToDOM ? m_transaction : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const String& IDBRequest::readyState() const
-{
- ASSERT(currentThread() == originThreadID());
-
- static NeverDestroyed<String> pendingString(ASCIILiteral("pending"));
- static NeverDestroyed<String> doneString(ASCIILiteral("done"));
- return m_isDone ? doneString : pendingString;
-}
-
</del><span class="cx"> uint64_t IDBRequest::sourceObjectStoreIdentifier() const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span><span class="lines">@@ -292,7 +298,7 @@
</span><span class="cx"> ASSERT(!m_contextStopped);
</span><span class="cx">
</span><span class="cx"> if (event.type() != eventNames().blockedEvent)
</span><del>- m_isDone = true;
</del><ins>+ m_readyState = ReadyState::Done;
</ins><span class="cx">
</span><span class="cx"> Vector<RefPtr<EventTarget>> targets;
</span><span class="cx"> targets.append(this);
</span><span class="lines">@@ -457,7 +463,7 @@
</span><span class="cx"> void IDBRequest::willIterateCursor(IDBCursor& cursor)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span><del>- ASSERT(m_isDone);
</del><ins>+ ASSERT(isDone());
</ins><span class="cx"> ASSERT(scriptExecutionContext());
</span><span class="cx"> ASSERT(m_transaction);
</span><span class="cx"> ASSERT(!m_pendingCursor);
</span><span class="lines">@@ -467,7 +473,7 @@
</span><span class="cx"> m_pendingCursor = &cursor;
</span><span class="cx"> m_hasPendingActivity = true;
</span><span class="cx"> clearResult();
</span><del>- m_isDone = false;
</del><ins>+ m_readyState = ReadyState::Pending;
</ins><span class="cx"> m_domError = nullptr;
</span><span class="cx"> m_idbError = { };
</span><span class="cx">
</span><span class="lines">@@ -499,7 +505,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(currentThread() == originThreadID());
</span><span class="cx">
</span><del>- m_isDone = true;
</del><ins>+ m_readyState = ReadyState::Done;
</ins><span class="cx">
</span><span class="cx"> m_idbError = resultData.error();
</span><span class="cx"> if (!m_idbError.isNull())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -70,14 +70,18 @@
</span><span class="cx"> IDBCursor* cursorResult() const { return m_cursorResult.get(); }
</span><span class="cx"> IDBDatabase* databaseResult() const { return m_databaseResult.get(); }
</span><span class="cx"> JSC::JSValue scriptResult() const { return m_scriptResult.get(); }
</span><ins>+
+ using Source = Variant<RefPtr<IDBObjectStore>, RefPtr<IDBIndex>, RefPtr<IDBCursor>>;
+ std::optional<Source> source() const;
+
</ins><span class="cx"> ExceptionOr<DOMError*> error() const;
</span><del>- IDBObjectStore* objectStoreSource() const { return m_objectStoreSource.get(); }
- IDBIndex* indexSource() const { return m_indexSource.get(); }
- IDBCursor* cursorSource() const { return m_cursorSource.get(); }
</del><ins>+
</ins><span class="cx"> RefPtr<IDBTransaction> transaction() const;
</span><del>- const String& readyState() const;
</del><ins>+
+ enum class ReadyState { Pending, Done };
+ ReadyState readyState() const { return m_readyState; }
</ins><span class="cx">
</span><del>- bool isDone() const { return m_isDone; }
</del><ins>+ bool isDone() const { return m_readyState == ReadyState::Done; }
</ins><span class="cx">
</span><span class="cx"> uint64_t sourceObjectStoreIdentifier() const;
</span><span class="cx"> uint64_t sourceIndexIdentifier() const;
</span><span class="lines">@@ -122,7 +126,7 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: Protected data members aren't great for maintainability.
</span><span class="cx"> // Consider adding protected helper functions and making these private.
</span><del>- bool m_isDone { false };
</del><ins>+ ReadyState m_readyState { ReadyState::Pending };
</ins><span class="cx"> RefPtr<IDBTransaction> m_transaction;
</span><span class="cx"> bool m_shouldExposeTransactionToDOM { true };
</span><span class="cx"> RefPtr<DOMError> m_domError;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -34,12 +34,17 @@
</span><span class="cx"> GenerateIsReachable=Impl,
</span><span class="cx"> SkipVTableValidation,
</span><span class="cx"> ] interface IDBRequest : EventTarget {
</span><del>- [CustomGetter] readonly attribute any result;
</del><ins>+ [CustomGetter, GetterMayThrowException] readonly attribute any result;
</ins><span class="cx"> [GetterMayThrowException] readonly attribute DOMError? error;
</span><del>- [CustomGetter] readonly attribute any source;
</del><ins>+ readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
</ins><span class="cx"> readonly attribute IDBTransaction transaction;
</span><del>- readonly attribute DOMString readyState;
</del><ins>+ readonly attribute IDBRequestReadyState readyState;
</ins><span class="cx">
</span><span class="cx"> attribute EventHandler onsuccess;
</span><span class="cx"> attribute EventHandler onerror;
</span><span class="cx"> };
</span><ins>+
+enum IDBRequestReadyState {
+ "pending",
+ "done"
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIndexedDBh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -40,10 +40,10 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> enum class CursorDirection {
</span><del>- Next = 0,
- NextNoDuplicate = 1,
- Prev = 2,
- PrevNoDuplicate = 3,
</del><ins>+ Next,
+ Nextunique,
+ Prev,
+ Prevunique,
</ins><span class="cx"> };
</span><span class="cx"> const unsigned CursorDirectionMaximum = 3;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -151,13 +151,13 @@
</span><span class="cx"> case IndexedDB::CursorDirection::Next:
</span><span class="cx"> m_currentIterator = valueStore->find(m_currentKey, m_currentPrimaryKey);
</span><span class="cx"> break;
</span><del>- case IndexedDB::CursorDirection::NextNoDuplicate:
</del><ins>+ case IndexedDB::CursorDirection::Nextunique:
</ins><span class="cx"> m_currentIterator = valueStore->find(m_currentKey, true);
</span><span class="cx"> break;
</span><span class="cx"> case IndexedDB::CursorDirection::Prev:
</span><span class="cx"> m_currentIterator = valueStore->reverseFind(m_currentKey, m_currentPrimaryKey, m_info.duplicity());
</span><span class="cx"> break;
</span><del>- case IndexedDB::CursorDirection::PrevNoDuplicate:
</del><ins>+ case IndexedDB::CursorDirection::Prevunique:
</ins><span class="cx"> m_currentIterator = valueStore->reverseFind(m_currentKey, m_info.duplicity(), true);
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> builder.append('<');
</span><span class="cx">
</span><span class="cx"> builder.appendLiteral(" CAST(? AS TEXT) ORDER BY key");
</span><del>- if (cursorDirection == IndexedDB::CursorDirection::Prev || cursorDirection == IndexedDB::CursorDirection::PrevNoDuplicate)
</del><ins>+ if (cursorDirection == IndexedDB::CursorDirection::Prev || cursorDirection == IndexedDB::CursorDirection::Prevunique)
</ins><span class="cx"> builder.appendLiteral(" DESC");
</span><span class="cx">
</span><span class="cx"> builder.appendLiteral(", value");
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">
</span><span class="cx"> builder.appendLiteral(" CAST(? AS TEXT) ORDER BY key");
</span><span class="cx">
</span><del>- if (cursorDirection == IndexedDB::CursorDirection::Prev || cursorDirection == IndexedDB::CursorDirection::PrevNoDuplicate)
</del><ins>+ if (cursorDirection == IndexedDB::CursorDirection::Prev || cursorDirection == IndexedDB::CursorDirection::Prevunique)
</ins><span class="cx"> builder.appendLiteral(" DESC");
</span><span class="cx">
</span><span class="cx"> builder.append(';');
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx"> m_statementNeedsReset = true;
</span><span class="cx"> ASSERT(!m_fetchedRecords.isEmpty());
</span><span class="cx">
</span><del>- if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate) {
</del><ins>+ if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::Nextunique) {
</ins><span class="cx"> m_currentLowerKey = m_fetchedRecords.first().record.key;
</span><span class="cx"> if (!m_keyRange.lowerOpen) {
</span><span class="cx"> m_keyRange.lowerOpen = true;
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx">
</span><span class="cx"> m_fetchedRecords.append({ });
</span><span class="cx">
</span><del>- bool isUnique = m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate || m_cursorDirection == IndexedDB::CursorDirection::PrevNoDuplicate;
</del><ins>+ bool isUnique = m_cursorDirection == IndexedDB::CursorDirection::Nextunique || m_cursorDirection == IndexedDB::CursorDirection::Prevunique;
</ins><span class="cx"> if (!isUnique)
</span><span class="cx"> return fetchNextRecord(m_fetchedRecords.last());
</span><span class="cx">
</span><span class="lines">@@ -509,7 +509,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // Search for the next key >= the target if the cursor is a Next cursor, or the next key <= if the cursor is a Previous cursor.
</span><del>- if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate) {
</del><ins>+ if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::Nextunique) {
</ins><span class="cx"> if (m_fetchedRecords.first().record.key.compare(targetKey) >= 0)
</span><span class="cx"> break;
</span><span class="cx"> } else if (m_fetchedRecords.first().record.key.compare(targetKey) <= 0)
</span><span class="lines">@@ -524,7 +524,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // Search for the next primary key >= the primary target if the cursor is a Next cursor, or the next key <= if the cursor is a Previous cursor.
</span><del>- if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::NextNoDuplicate) {
</del><ins>+ if (m_cursorDirection == IndexedDB::CursorDirection::Next || m_cursorDirection == IndexedDB::CursorDirection::Nextunique) {
</ins><span class="cx"> if (m_fetchedRecords.first().record.primaryKey.compare(targetPrimaryKey) >= 0)
</span><span class="cx"> break;
</span><span class="cx"> } else if (m_fetchedRecords.first().record.primaryKey.compare(targetPrimaryKey) <= 0)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBCursorInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -86,12 +86,12 @@
</span><span class="cx">
</span><span class="cx"> bool IDBCursorInfo::isDirectionForward() const
</span><span class="cx"> {
</span><del>- return m_direction == IndexedDB::CursorDirection::Next || m_direction == IndexedDB::CursorDirection::NextNoDuplicate;
</del><ins>+ return m_direction == IndexedDB::CursorDirection::Next || m_direction == IndexedDB::CursorDirection::Nextunique;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CursorDuplicity IDBCursorInfo::duplicity() const
</span><span class="cx"> {
</span><del>- return m_direction == IndexedDB::CursorDirection::NextNoDuplicate || m_direction == IndexedDB::CursorDirection::PrevNoDuplicate ? CursorDuplicity::NoDuplicates : CursorDuplicity::Duplicates;
</del><ins>+ return m_direction == IndexedDB::CursorDirection::Nextunique || m_direction == IndexedDB::CursorDirection::Prevunique ? CursorDuplicity::NoDuplicates : CursorDuplicity::Duplicates;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBCursorInfo IDBCursorInfo::isolatedCopy() const
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -2820,6 +2820,9 @@
</span><span class="cx">                 7C3A91E61C963B8800D1A7E3 /* ClipboardAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C3B79711908757B00B47A2D /* UserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */; };
</span><span class="cx">                 7C3B79721908757B00B47A2D /* UserMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3B79701908757B00B47A2D /* UserMessageHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                7C3D8EEB1E0B15A70023B084 /* IDBCursorDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3D8EE91E0B15A70023B084 /* IDBCursorDirection.h */; };
+                7C3D8EEF1E0B21430023B084 /* JSIDBCursorDirection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3D8EED1E0B21430023B084 /* JSIDBCursorDirection.cpp */; };
+                7C3D8EF01E0B21430023B084 /* JSIDBCursorDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3D8EEE1E0B21430023B084 /* JSIDBCursorDirection.h */; };
</ins><span class="cx">                 7C3E510A18DF8F3500C112F7 /* HTMLConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3E510818DF8F3500C112F7 /* HTMLConverter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C3E510B18DF8F3500C112F7 /* HTMLConverter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C3E510918DF8F3500C112F7 /* HTMLConverter.mm */; };
</span><span class="cx">                 7C3F01C11C8E5ABA00ADD962 /* UserContentProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3F01C01C8E5AB100ADD962 /* UserContentProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2896,6 +2899,7 @@
</span><span class="cx">                 7CD0BA051B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD0BA031B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h */; };
</span><span class="cx">                 7CD494CC1A86EB1D000A87EC /* RenderAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD494CA1A86EB1D000A87EC /* RenderAttachment.cpp */; };
</span><span class="cx">                 7CD494CD1A86EB1D000A87EC /* RenderAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD494CB1A86EB1D000A87EC /* RenderAttachment.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                7CD686561E0E26D300E97AA7 /* JSIDBRequestCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD686551E0E26D300E97AA7 /* JSIDBRequestCustom.cpp */; };
</ins><span class="cx">                 7CE58D4A1DD64A5B00128552 /* SVGPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D491DD64A5B00128552 /* SVGPoint.h */; };
</span><span class="cx">                 7CE58D4E1DD694FE00128552 /* SVGRectTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D4D1DD694FE00128552 /* SVGRectTraits.h */; };
</span><span class="cx">                 7CE58D501DD69A1E00128552 /* SVGNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D4F1DD69A1E00128552 /* SVGNumber.h */; };
</span><span class="lines">@@ -3340,7 +3344,6 @@
</span><span class="cx">                 934CC10A0EDB223900A658F2 /* ScriptSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */; };
</span><span class="cx">                 934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */; };
</span><span class="cx">                 934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                934F31B51CC0737200DB43DC /* JSIDBRequestCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */; };
</del><span class="cx">                 934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */; };
</span><span class="cx">                 934F713A0D5A6F1000018D69 /* AuthenticationChallengeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -10303,6 +10306,10 @@
</span><span class="cx">                 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C3B79701908757B00B47A2D /* UserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandler.h; sourceTree = "<group>"; };
</span><ins>+                7C3D8EE91E0B15A70023B084 /* IDBCursorDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorDirection.h; sourceTree = "<group>"; };
+                7C3D8EEA1E0B15A70023B084 /* IDBCursorDirection.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBCursorDirection.idl; sourceTree = "<group>"; };
+                7C3D8EED1E0B21430023B084 /* JSIDBCursorDirection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBCursorDirection.cpp; sourceTree = "<group>"; };
+                7C3D8EEE1E0B21430023B084 /* JSIDBCursorDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBCursorDirection.h; sourceTree = "<group>"; };
</ins><span class="cx">                 7C3E510818DF8F3500C112F7 /* HTMLConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLConverter.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C3E510918DF8F3500C112F7 /* HTMLConverter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLConverter.mm; sourceTree = "<group>"; };
</span><span class="cx">                 7C3F01BF1C8E5AB100ADD962 /* UserContentProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentProvider.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -10401,6 +10408,7 @@
</span><span class="cx">                 7CD0BA031B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveDOMCallbackMicrotask.h; sourceTree = "<group>"; };
</span><span class="cx">                 7CD494CA1A86EB1D000A87EC /* RenderAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderAttachment.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7CD494CB1A86EB1D000A87EC /* RenderAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderAttachment.h; sourceTree = "<group>"; };
</span><ins>+                7CD686551E0E26D300E97AA7 /* JSIDBRequestCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBRequestCustom.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 7CE58D491DD64A5B00128552 /* SVGPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPoint.h; sourceTree = "<group>"; };
</span><span class="cx">                 7CE58D4D1DD694FE00128552 /* SVGRectTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRectTraits.h; sourceTree = "<group>"; };
</span><span class="cx">                 7CE58D4F1DD69A1E00128552 /* SVGNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGNumber.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -10937,7 +10945,6 @@
</span><span class="cx">                 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceCode.h; sourceTree = "<group>"; };
</span><span class="cx">                 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSStringExtras.mm; sourceTree = "<group>"; };
</span><span class="cx">                 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreNSStringExtras.h; sourceTree = "<group>"; };
</span><del>-                934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBRequestCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeBase.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeBase.h; sourceTree = "<group>"; };
</span><span class="cx">                 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceErrorBase.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -18337,6 +18344,7 @@
</span><span class="cx">                                 ADEC78F718EE5308001315C2 /* JSElementCustom.h */,
</span><span class="cx">                                 BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
</span><span class="cx">                                 E34EE49F1DC2D57500EAA9D3 /* JSEventCustom.h */,
</span><ins>+                                512BDB4C1C46B0FF006494DF /* JSIDBCursorCustom.cpp */,
</ins><span class="cx">                                 5141298D1C5FD7E90059E714 /* JSIDBCursorWithValueCustom.cpp */,
</span><span class="cx">                                 5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */,
</span><span class="cx">                                 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */,
</span><span class="lines">@@ -19276,6 +19284,8 @@
</span><span class="cx">                                 51645B541B9F88E800F789CE /* IDBCursor.cpp */,
</span><span class="cx">                                 51645B411B9F889B00F789CE /* IDBCursor.h */,
</span><span class="cx">                                 51D71977181106DF0016DC51 /* IDBCursor.idl */,
</span><ins>+                                7C3D8EE91E0B15A70023B084 /* IDBCursorDirection.h */,
+                                7C3D8EEA1E0B15A70023B084 /* IDBCursorDirection.idl */,
</ins><span class="cx">                                 51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */,
</span><span class="cx">                                 51645B431B9F889B00F789CE /* IDBCursorWithValue.h */,
</span><span class="cx">                                 51D7197B181106DF0016DC51 /* IDBCursorWithValue.idl */,
</span><span class="lines">@@ -20701,6 +20711,8 @@
</span><span class="cx">                                 B59DD697119029E5007E9684 /* JSDatabaseCallback.h */,
</span><span class="cx">                                 511EF2A917F0FC4800E4FA16 /* JSIDBCursor.cpp */,
</span><span class="cx">                                 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */,
</span><ins>+                                7C3D8EED1E0B21430023B084 /* JSIDBCursorDirection.cpp */,
+                                7C3D8EEE1E0B21430023B084 /* JSIDBCursorDirection.h */,
</ins><span class="cx">                                 511EF2AA17F0FC4800E4FA16 /* JSIDBCursorWithValue.cpp */,
</span><span class="cx">                                 511EF2AB17F0FC4800E4FA16 /* JSIDBCursorWithValue.h */,
</span><span class="cx">                                 511EF2AC17F0FC4800E4FA16 /* JSIDBDatabase.cpp */,
</span><span class="lines">@@ -22126,8 +22138,7 @@
</span><span class="cx">                                 BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
</span><span class="cx">                                 AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
</span><span class="cx">                                 D6F7960C166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp */,
</span><del>-                                512BDB4C1C46B0FF006494DF /* JSIDBCursorCustom.cpp */,
-                                934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */,
</del><ins>+                                7CD686551E0E26D300E97AA7 /* JSIDBRequestCustom.cpp */,
</ins><span class="cx">                                 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
</span><span class="cx">                                 BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
</span><span class="cx">                                 2D9BF7481DBFDDF8007A7D99 /* JSMediaKeySessionCustom.cpp */,
</span><span class="lines">@@ -25657,6 +25668,7 @@
</span><span class="cx">                                 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */,
</span><span class="cx">                                 A853123D11D0471B00D4D077 /* FragmentScriptingPermission.h in Headers */,
</span><span class="cx">                                 65BF022F0974816300C43196 /* Frame.h in Headers */,
</span><ins>+                                7C3D8EF01E0B21430023B084 /* JSIDBCursorDirection.h in Headers */,
</ins><span class="cx">                                 974A862314B7ADBB003FDC76 /* FrameDestructionObserver.h in Headers */,
</span><span class="cx">                                 656D373C0ADBA5DE00A4554D /* FrameLoader.h in Headers */,
</span><span class="cx">                                 656D373E0ADBA5DE00A4554D /* FrameLoaderClient.h in Headers */,
</span><span class="lines">@@ -26122,6 +26134,7 @@
</span><span class="cx">                                 FC54D05816A7676E00575E4D /* JSCSSSupportsRule.h in Headers */,
</span><span class="cx">                                 9BD4E9171C462872005065BC /* JSCustomElementInterface.h in Headers */,
</span><span class="cx">                                 9BE6710C1D5AEB2500345514 /* JSCustomElementRegistry.h in Headers */,
</span><ins>+                                7C3D8EEB1E0B15A70023B084 /* IDBCursorDirection.h in Headers */,
</ins><span class="cx">                                 E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */,
</span><span class="cx">                                 E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */,
</span><span class="cx">                                 1AE82F900CAAFA9D002237AE /* JSDatabase.h in Headers */,
</span><span class="lines">@@ -30073,7 +30086,6 @@
</span><span class="cx">                                 511EF2D117F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp in Sources */,
</span><span class="cx">                                 511EF2C817F0FD3500E4FA16 /* JSIDBOpenDBRequest.cpp in Sources */,
</span><span class="cx">                                 511EF2C917F0FD3500E4FA16 /* JSIDBRequest.cpp in Sources */,
</span><del>-                                934F31B51CC0737200DB43DC /* JSIDBRequestCustom.cpp in Sources */,
</del><span class="cx">                                 511EF2CA17F0FD3500E4FA16 /* JSIDBTransaction.cpp in Sources */,
</span><span class="cx">                                 51E269331DD3BC4E006B6A58 /* JSIDBTransactionCustom.cpp in Sources */,
</span><span class="cx">                                 838EF53B1DC14A7C008F0C39 /* JSIDBTransactionMode.cpp in Sources */,
</span><span class="lines">@@ -31049,6 +31061,7 @@
</span><span class="cx">                                 7EE6847512D26E7000E79415 /* ResourceLoaderCFNet.cpp in Sources */,
</span><span class="cx">                                 51AA3F6F0BD5AA9E00892971 /* ResourceLoaderMac.mm in Sources */,
</span><span class="cx">                                 51EE7B3A1AA5123100F92B21 /* ResourceLoadInfo.cpp in Sources */,
</span><ins>+                                7C3D8EEF1E0B21430023B084 /* JSIDBCursorDirection.cpp in Sources */,
</ins><span class="cx">                                 973E325610883B7C005BC493 /* ResourceLoadNotifier.cpp in Sources */,
</span><span class="cx">                                 6B693A341C51A95D00B03BEF /* ResourceLoadObserver.cpp in Sources */,
</span><span class="cx">                                 7A929CA61C598A9E004DF226 /* ResourceLoadStatistics.cpp in Sources */,
</span><span class="lines">@@ -31736,6 +31749,7 @@
</span><span class="cx">                                 49C7B9D91042D32F0009D447 /* WebGLRenderbuffer.cpp in Sources */,
</span><span class="cx">                                 49C7B9DF1042D32F0009D447 /* WebGLRenderingContext.cpp in Sources */,
</span><span class="cx">                                 D3F3D3691A69B7B00059FC2B /* WebGLRenderingContextBase.cpp in Sources */,
</span><ins>+                                7CD686561E0E26D300E97AA7 /* JSIDBRequestCustom.cpp in Sources */,
</ins><span class="cx">                                 6F995A211A7078B100A735F4 /* WebGLSampler.cpp in Sources */,
</span><span class="cx">                                 49C7B9E21042D32F0009D447 /* WebGLShader.cpp in Sources */,
</span><span class="cx">                                 A08CF154152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericIDLTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/IDLTypes.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/generic/IDLTypes.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -170,10 +170,6 @@
</span><span class="cx"> static double extractValueFromNullable(double value) { return value; }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<typename T> struct IDLSerializedScriptValue : IDLWrapper<T> { };
-template<typename T> struct IDLEventListener : IDLWrapper<T> { };
-template<typename T> struct IDLXPathNSResolver : IDLWrapper<T> { };
-
</del><span class="cx"> struct IDLJSON : IDLType<String> {
</span><span class="cx"> using ParameterType = const String&;
</span><span class="cx">
</span><span class="lines">@@ -183,6 +179,11 @@
</span><span class="cx"> template <typename U> static U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<typename T> struct IDLSerializedScriptValue : IDLWrapper<T> { };
+template<typename T> struct IDLEventListener : IDLWrapper<T> { };
+template<typename T> struct IDLXPathNSResolver : IDLWrapper<T> { };
+template<typename T> struct IDLIDBKey : IDLWrapper<T> { };
+
</ins><span class="cx"> // Non-WebIDL convenience type aliases
</span><span class="cx">
</span><span class="cx"> using IDLBufferSource = IDLUnion<IDLInterface<JSC::ArrayBufferView>, IDLInterface<JSC::ArrayBuffer>>;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #include "BufferSource.h"
</span><ins>+#include "IDBBindingUtilities.h"
</ins><span class="cx"> #include "IDLTypes.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include <runtime/JSONObject.h>
</span><span class="lines">@@ -210,6 +211,31 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // MARK: -
</span><ins>+// MARK: Any type
+
+template<> struct Converter<IDLAny> : DefaultConverter<IDLAny> {
+ static JSC::JSValue convert(JSC::ExecState&, JSC::JSValue value)
+ {
+ return value;
+ }
+};
+
+template<> struct JSConverter<IDLAny> {
+ static constexpr bool needsState = false;
+ static constexpr bool needsGlobalObject = false;
+
+ static JSC::JSValue convert(const JSC::JSValue& value)
+ {
+ return value;
+ }
+
+ static JSC::JSValue convert(const JSC::Strong<JSC::Unknown>& value)
+ {
+ return value.get();
+ }
+};
+
+// MARK: -
</ins><span class="cx"> // MARK: Nullable type
</span><span class="cx">
</span><span class="cx"> namespace Detail {
</span><span class="lines">@@ -434,26 +460,6 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // MARK: -
</span><del>-// MARK: Any type
-
-template<> struct Converter<IDLAny> : DefaultConverter<IDLAny> {
- static JSC::JSValue convert(JSC::ExecState&, JSC::JSValue value)
- {
- return value;
- }
-};
-
-template<> struct JSConverter<IDLAny> {
- static constexpr bool needsState = false;
- static constexpr bool needsGlobalObject = false;
-
- static JSC::JSValue convert(const JSC::JSValue& value)
- {
- return value;
- }
-};
-
-// MARK: -
</del><span class="cx"> // MARK: Integer types
</span><span class="cx">
</span><span class="cx"> template<> struct Converter<IDLByte> : DefaultConverter<IDLByte> {
</span><span class="lines">@@ -1463,6 +1469,26 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // MARK: -
</span><ins>+// MARK: IDLJSON type
+
+template<> struct Converter<IDLJSON> : DefaultConverter<IDLJSON> {
+ static String convert(JSC::ExecState& state, JSC::JSValue value)
+ {
+ return JSC::JSONStringify(&state, value, 0);
+ }
+};
+
+template<> struct JSConverter<IDLJSON> {
+ static constexpr bool needsState = true;
+ static constexpr bool needsGlobalObject = false;
+
+ static JSC::JSValue convert(JSC::ExecState& state, const String& value)
+ {
+ return JSC::JSONParse(&state, value);
+ }
+};
+
+// MARK: -
</ins><span class="cx"> // MARK: SerializedScriptValue type
</span><span class="cx">
</span><span class="cx"> template<typename T> struct Converter<IDLSerializedScriptValue<T>> : DefaultConverter<IDLSerializedScriptValue<T>> {
</span><span class="lines">@@ -1537,22 +1563,16 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // MARK: -
</span><del>-// MARK: IDLJSON type
</del><ins>+// MARK: IDLIDBKey type
</ins><span class="cx">
</span><del>-template<> struct Converter<IDLJSON> : DefaultConverter<IDLJSON> {
- static String convert(JSC::ExecState& state, JSC::JSValue value)
- {
- return JSC::JSONStringify(&state, value, 0);
- }
-};
-
-template<> struct JSConverter<IDLJSON> {
</del><ins>+template<typename T> struct JSConverter<IDLIDBKey<T>> {
</ins><span class="cx"> static constexpr bool needsState = true;
</span><del>- static constexpr bool needsGlobalObject = false;
</del><ins>+ static constexpr bool needsGlobalObject = true;
</ins><span class="cx">
</span><del>- static JSC::JSValue convert(JSC::ExecState& state, const String& value)
</del><ins>+ template <typename U>
+ static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U&& value)
</ins><span class="cx"> {
</span><del>- return JSC::JSONParse(&state, value);
</del><ins>+ return toJS(state, globalObject, std::forward<U>(value));
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx">
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include "JSIDBCursorWithValue.h"
</span><del>-#include "JSIDBIndex.h"
-#include "JSIDBObjectStore.h"
</del><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="lines">@@ -44,14 +42,6 @@
</span><span class="cx"> visitor.addOpaqueRoot(request);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSIDBCursor::source(ExecState& state) const
-{
- auto& cursor = wrapped();
- if (auto* index = cursor.index())
- return toJS(&state, globalObject(), *index);
- return toJS(&state, globalObject(), cursor.objectStore());
-}
-
</del><span class="cx"> JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<IDBCursor>&& cursor)
</span><span class="cx"> {
</span><span class="cx"> if (is<IDBCursorWithValue>(cursor))
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBRequestCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/js/JSIDBRequestCustom.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> propagateException(state, Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to read the 'result' property from 'IDBRequest': The request has not finished.") });
</span><span class="cx"> return { };
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (auto* cursor = request.cursorResult())
</span><span class="cx"> return toJS(&state, globalObject(), *cursor);
</span><span class="cx"> if (auto* database = request.databaseResult())
</span><span class="lines">@@ -54,16 +55,6 @@
</span><span class="cx"> return jsNull();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSIDBRequest::source(ExecState& state) const
-{
- auto& request = wrapped();
- if (auto* cursor = request.cursorSource())
- return toJS(&state, globalObject(), *cursor);
- if (auto* index = request.indexSource())
- return toJS(&state, globalObject(), *index);
- return toJS(&state, globalObject(), request.objectStoreSource());
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -876,14 +876,15 @@
</span><span class="cx"> return 1 if $object->IsStringType($type);
</span><span class="cx"> return 1 if $object->IsTypedArrayType($type);
</span><span class="cx"> return 1 if $type->isUnion;
</span><ins>+ return 1 if $type->name eq "BufferSource";
+ return 1 if $type->name eq "EventListener";
+ return 1 if $type->name eq "IDBKey";
+ return 1 if $type->name eq "JSON";
+ return 1 if $type->name eq "Promise";
+ return 1 if $type->name eq "SerializedScriptValue";
+ return 1 if $type->name eq "XPathNSResolver";
</ins><span class="cx"> return 1 if $type->name eq "any";
</span><span class="cx"> return 1 if $type->name eq "object";
</span><del>- return 1 if $type->name eq "BufferSource";
- return 1 if $type->name eq "Promise";
- return 1 if $type->name eq "XPathNSResolver";
- return 1 if $type->name eq "EventListener";
- return 1 if $type->name eq "SerializedScriptValue";
- return 1 if $type->name eq "JSON";
</del><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -5107,10 +5107,11 @@
</span><span class="cx">
</span><span class="cx"> # Non-WebIDL extensions
</span><span class="cx"> "Date" => "IDLDate",
</span><ins>+ "EventListener" => "IDLEventListener<JSEventListener>",
+ "IDBKey" => "IDLIDBKey<IDBKey>",
+ "JSON" => "IDLJSON",
</ins><span class="cx"> "SerializedScriptValue" => "IDLSerializedScriptValue<SerializedScriptValue>",
</span><del>- "EventListener" => "IDLEventListener<JSEventListener>",
</del><span class="cx"> "XPathNSResolver" => "IDLXPathNSResolver<XPathNSResolver>",
</span><del>- "JSON" => "IDLJSON",
</del><span class="cx">
</span><span class="cx"> # Convenience type aliases
</span><span class="cx"> "BufferSource" => "IDLBufferSource",
</span><span class="lines">@@ -5333,9 +5334,10 @@
</span><span class="cx"> return 1 if $codeGenerator->IsInterfaceType($type);
</span><span class="cx"> return 1 if $codeGenerator->IsTypedArrayType($type);
</span><span class="cx"> return 1 if $type->name eq "Date";
</span><ins>+ return 1 if $type->name eq "IDBKey";
+ return 1 if $type->name eq "JSON";
</ins><span class="cx"> return 1 if $type->name eq "SerializedScriptValue";
</span><span class="cx"> return 1 if $type->name eq "XPathNSResolver";
</span><del>- return 1 if $type->name eq "JSON";
</del><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5351,6 +5353,7 @@
</span><span class="cx"> return 1 if $codeGenerator->IsDictionaryType($type);
</span><span class="cx"> return 1 if $codeGenerator->IsInterfaceType($type);
</span><span class="cx"> return 1 if $codeGenerator->IsTypedArrayType($type);
</span><ins>+ return 1 if $type->name eq "IDBKey";
</ins><span class="cx"> return 1 if $type->name eq "SerializedScriptValue";
</span><span class="cx"> return 1 if $type->name eq "XPathNSResolver";
</span><span class="cx">
</span><span class="lines">@@ -5402,14 +5405,6 @@
</span><span class="cx"> $value = "std::max(0, $value)";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($type->name eq "any") {
- my $returnType = $context->extendedAttributes->{ImplementationReturnType};
- if (defined $returnType and ($returnType eq "IDBKeyPath" or $returnType eq "IDBKey")) {
- AddToImplIncludes("IDBBindingUtilities.h", $conditional);
- return "toJS($stateReference, $globalObjectReference, $value)";
- }
- }
-
</del><span class="cx"> AddToImplIncludesForIDLType($type, $conditional);
</span><span class="cx"> AddToImplIncludes("JSDOMConvert.h", $conditional);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx"> Immutable
</span><span class="cx"> ImplementedAs=*
</span><span class="cx"> ImplementationLacksVTable
</span><del>-ImplementationReturnType=*
</del><span class="cx"> ImplicitThis
</span><span class="cx"> InterfaceName=*
</span><span class="cx"> IsImmutablePrototypeExoticObject
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (210147 => 210148)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-12-25 23:57:40 UTC (rev 210147)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-12-26 01:33:33 UTC (rev 210148)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx"> m_executableWithDatabase->requestCallback().sendFailure("Could not get result in callback.");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> auto databaseResult = request.databaseResult();
</span><span class="cx"> if (!databaseResult) {
</span><span class="cx"> m_executableWithDatabase->requestCallback().sendFailure("Unexpected result type.");
</span><span class="lines">@@ -365,10 +366,12 @@
</span><span class="cx"> m_requestCallback->sendFailure("Could not get result in callback.");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (request.scriptResult()) {
</span><span class="cx"> end(false);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> auto* cursorResult = request.cursorResult();
</span><span class="cx"> if (!cursorResult) {
</span><span class="cx"> end(false);
</span><span class="lines">@@ -468,13 +471,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (exec) {
</span><del>- auto result = idbIndex->openCursor(*exec, m_idbKeyRange.get(), IDBCursor::directionNext());
</del><ins>+ auto result = idbIndex->openCursor(*exec, m_idbKeyRange.get(), IDBCursorDirection::Next);
</ins><span class="cx"> if (!result.hasException())
</span><span class="cx"> idbRequest = result.releaseReturnValue();
</span><span class="cx"> }
</span><span class="cx"> } else {
</span><span class="cx"> if (exec) {
</span><del>- auto result = idbObjectStore->openCursor(*exec, m_idbKeyRange.get(), IDBCursor::directionNext());
</del><ins>+ auto result = idbObjectStore->openCursor(*exec, m_idbKeyRange.get(), IDBCursorDirection::Next);
</ins><span class="cx"> if (!result.hasException())
</span><span class="cx"> idbRequest = result.releaseReturnValue();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>