<!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>[200699] 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/200699">200699</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-05-11 13:04:58 -0700 (Wed, 11 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Change IDBObjectStore.createIndex to take an IDL dictionary
https://bugs.webkit.org/show_bug.cgi?id=157520

Reviewed by Chris Dumez.

Source/WebCore:

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore): Use IDBKeyPath::Type instead of
IndexedDB::KeyPathType.
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::IDBKeyPath): Ditto.
(WebCore::IDBKeyPath::isValid): Ditto.
(WebCore::IDBKeyPath::operator==): Ditto.
(WebCore::IDBKeyPath::encode): Ditto.
(WebCore::IDBKeyPath::decode): Ditto.

* Modules/indexeddb/IDBKeyPath.h: Use pragma once. Make constructors non-explicit so
we can just pass a string or vector and have it turn into an IDBKeyPath. Added an enum
class named Type here and use it instead of IndexedDB::KeyPathType.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Remove unneeded local variable.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::doDelete): Ditto.
(WebCore::IDBObjectStore::createIndex): Changed argument type to take IndexParameters
instead of two seaparate booleans. Also updated to use IDBKeyPath::Type.

* Modules/indexeddb/IDBObjectStore.h: Removed include of IndexedDB, using a forward
decalration instead. Marked the class final. Added an IndexParameters struct and used
it for the argument to createIndex.

* Modules/indexeddb/IDBObjectStore.idl: Stopped using Custom for put, add, and
createIndex functions. Stopped using Dictionary for createIndex, using IDBIndexParameters
instead as in the specification. Added IDBIndexParameters dictionary definition.

* Modules/indexeddb/IndexedDB.h: Use pragma once. Removed KeyPathType.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue): Use IDBKeyPath::Type instead of
IndexedDB::KeyPathType.
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Ditto.
(WebCore::canInjectIDBKeyIntoScriptValue): Ditto.
(WebCore::createKeyPathArray): Ditto.
(WebCore::toJS): Ditto.
* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::putOrAdd): Deleted.
(WebCore::JSIDBObjectStore::putFunction): Deleted.
(WebCore::JSIDBObjectStore::add): Deleted.
(WebCore::JSIDBObjectStore::createIndex): Deleted.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheckExpression): Fixed code that generates a type check for
wrappers to only check types is knows how to check: wrappers and arrays, including
typed arrays. This prevents it from trying to check dictionaries.

* inspector/InspectorIndexedDBAgent.cpp: Use IDBKeyPath::Type instead of
IndexedDB::KeyPathType.

LayoutTests:

* storage/indexeddb/deleteIndex-bug110792-expected.txt: Updated result.
Test is still marked as flaky, but this is the proper expectation now.
Discovered this when I accidentally reset results for the whole directory.
* storage/indexeddb/deleteIndex-bug110792-private-expected.txt: Ditto.

* storage/indexeddb/index-basics-expected.txt: Updated to expect the simpler
type error that is generated by the bindings code as opposed to the hand written
binding. If we want to make this fancier like this for all bindings we can do
that the future in the bindings script.
* storage/indexeddb/index-basics-private-expected.txt: Ditto.
* storage/indexeddb/index-basics-workers-expected.txt: Ditto.

* storage/indexeddb/keypath-basics-expected.txt: Updated for the change that
expects null and undefined the be legal key paths. See below.
* storage/indexeddb/keypath-basics-private-expected.txt: Ditto.

* storage/indexeddb/modern/create-index-failures-expected.txt: Removed
expected results that require that we forbid null for the name and key path.
See below.
* storage/indexeddb/modern/create-index-failures-private-expected.txt: Ditto.

* storage/indexeddb/modern/resources/create-index-failures.js: Removed the test
that expects failure when null is passed for the name and key path. In both
cases, the Web IDL and IDB specifications call for the null value to be converted
to the string &quot;null&quot;, not an exception.

* storage/indexeddb/resources/keypath-basics.js:
(prepareDatabase): Added tests for both undefined and null. Both are legal values for
the key path argument to createIndex. The Web IDL and IDB specifications call for
them to be converted to the strings &quot;undefined&quot; and &quot;null&quot;, not to trigger exceptions.
(testInvalidKeyPaths): Removed tests that expect exceptions when calling createIndex
with undefined and null.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbdeleteIndexbug110792expectedtxt">trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbdeleteIndexbug110792privateexpectedtxt">trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-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="#trunkLayoutTestsstorageindexeddbkeypathbasicsexpectedtxt">trunk/LayoutTests/storage/indexeddb/keypath-basics-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbkeypathbasicsprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/keypath-basics-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderncreateindexfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderncreateindexfailuresprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernresourcescreateindexfailuresjs">trunk/LayoutTests/storage/indexeddb/modern/resources/create-index-failures.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourceskeypathbasicsjs">trunk/LayoutTests/storage/indexeddb/resources/keypath-basics.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyPathcpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyPathh">trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h</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="#trunkSourceWebCoreModulesindexeddbIndexedDBh">trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBObjectStoreCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/ChangeLog        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-05-11  Darin Adler  &lt;darin@apple.com&gt;
+
+        Change IDBObjectStore.createIndex to take an IDL dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=157520
+
+        Reviewed by Chris Dumez.
+
+        * storage/indexeddb/deleteIndex-bug110792-expected.txt: Updated result.
+        Test is still marked as flaky, but this is the proper expectation now.
+        Discovered this when I accidentally reset results for the whole directory.
+        * storage/indexeddb/deleteIndex-bug110792-private-expected.txt: Ditto.
+
+        * storage/indexeddb/index-basics-expected.txt: Updated to expect the simpler
+        type error that is generated by the bindings code as opposed to the hand written
+        binding. If we want to make this fancier like this for all bindings we can do
+        that the future in the bindings script.
+        * storage/indexeddb/index-basics-private-expected.txt: Ditto.
+        * storage/indexeddb/index-basics-workers-expected.txt: Ditto.
+
+        * storage/indexeddb/keypath-basics-expected.txt: Updated for the change that
+        expects null and undefined the be legal key paths. See below.
+        * storage/indexeddb/keypath-basics-private-expected.txt: Ditto.
+
+        * storage/indexeddb/modern/create-index-failures-expected.txt: Removed
+        expected results that require that we forbid null for the name and key path.
+        See below.
+        * storage/indexeddb/modern/create-index-failures-private-expected.txt: Ditto.
+
+        * storage/indexeddb/modern/resources/create-index-failures.js: Removed the test
+        that expects failure when null is passed for the name and key path. In both
+        cases, the Web IDL and IDB specifications call for the null value to be converted
+        to the string &quot;null&quot;, not an exception.
+
+        * storage/indexeddb/resources/keypath-basics.js:
+        (prepareDatabase): Added tests for both undefined and null. Both are legal values for
+        the key path argument to createIndex. The Web IDL and IDB specifications call for
+        them to be converted to the strings &quot;undefined&quot; and &quot;null&quot;, not to trigger exceptions.
+        (testInvalidKeyPaths): Removed tests that expect exceptions when calling createIndex
+        with undefined and null.
+
</ins><span class="cx"> 2016-05-11  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rebaseline inspector/dom/getAccessibilityPropertiesForNode.html after r200677
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbdeleteIndexbug110792expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -5,7 +5,6 @@
</span><span class="cx"> 
</span><span class="cx"> indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
</span><span class="cx"> 
</span><del>-dbname = &quot;deleteIndex-bug110792.html&quot;
</del><span class="cx"> indexedDB.deleteDatabase(dbname)
</span><span class="cx"> indexedDB.open(dbname, 1)
</span><span class="cx"> 
</span><span class="lines">@@ -27,7 +26,7 @@
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS code is DOMException.NOT_FOUND_ERR
</span><span class="cx"> PASS ename is 'NotFoundError'
</span><del>-Exception message: NotFoundError: DOM IDBDatabase Exception 8
</del><ins>+Exception message: Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbdeleteIndexbug110792privateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-private-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-private-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792-private-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -5,7 +5,6 @@
</span><span class="cx"> 
</span><span class="cx"> indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
</span><span class="cx"> 
</span><del>-dbname = &quot;deleteIndex-bug110792.html&quot;
</del><span class="cx"> indexedDB.deleteDatabase(dbname)
</span><span class="cx"> indexedDB.open(dbname, 1)
</span><span class="cx"> 
</span><span class="lines">@@ -27,7 +26,7 @@
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS code is DOMException.NOT_FOUND_ERR
</span><span class="cx"> PASS ename is 'NotFoundError'
</span><del>-Exception message: NotFoundError: DOM IDBDatabase Exception 8
</del><ins>+Exception message: Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbindexbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -18,10 +18,10 @@
</span><span class="cx"> PASS indexObject3.unique is true
</span><span class="cx"> Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true)
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.
</del><ins>+PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Type error
</ins><span class="cx"> Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.
</del><ins>+PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Type error
</ins><span class="cx"> PASS 'name' in indexObject is true
</span><span class="cx"> PASS indexObject.name is &quot;indexName&quot;
</span><span class="cx"> PASS 'objectStore' in indexObject is true
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbindexbasicsprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-private-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -18,10 +18,10 @@
</span><span class="cx"> PASS indexObject3.unique is true
</span><span class="cx"> Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true)
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.
</del><ins>+PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Type error
</ins><span class="cx"> Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string')
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.
</del><ins>+PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Type error
</ins><span class="cx"> PASS 'name' in indexObject is true
</span><span class="cx"> PASS indexObject.name is &quot;indexName&quot;
</span><span class="cx"> PASS 'objectStore' in indexObject is true
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbindexbasicsworkersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -19,10 +19,10 @@
</span><span class="cx"> PASS [Worker] indexObject3.unique is true
</span><span class="cx"> [Worker] Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true)
</span><span class="cx"> PASS [Worker] Exception was thrown.
</span><del>-PASS [Worker] store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.
</del><ins>+PASS [Worker] store.createIndex('failureIndex', 'zzz', true) threw TypeError: Type error
</ins><span class="cx"> [Worker] Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string')
</span><span class="cx"> PASS [Worker] Exception was thrown.
</span><del>-PASS [Worker] store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.
</del><ins>+PASS [Worker] store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Type error
</ins><span class="cx"> PASS [Worker] 'name' in indexObject is true
</span><span class="cx"> PASS [Worker] indexObject.name is &quot;indexName&quot;
</span><span class="cx"> PASS [Worker] 'objectStore' in indexObject is true
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbkeypathbasicsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/keypath-basics-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/keypath-basics-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/keypath-basics-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -135,6 +135,16 @@
</span><span class="cx"> index = store.createIndex('name', '_\u200D')
</span><span class="cx"> PASS index.keyPath is '_\u200D'
</span><span class="cx"> Deleted all object stores.
</span><ins>+store = db.createObjectStore('name', {keyPath: 'undefined'})
+PASS store.keyPath is 'undefined'
+index = store.createIndex('name', undefined)
+PASS index.keyPath is 'undefined'
+Deleted all object stores.
+store = db.createObjectStore('name', {keyPath: 'null'})
+PASS store.keyPath is 'null'
+index = store.createIndex('name', null)
+PASS index.keyPath is 'null'
+Deleted all object stores.
</ins><span class="cx"> 
</span><span class="cx"> testInvalidKeyPaths():
</span><span class="cx"> Deleted all object stores.
</span><span class="lines">@@ -157,16 +167,6 @@
</span><span class="cx"> Deleted all object stores.
</span><span class="cx"> 
</span><span class="cx"> Key paths which are never valid:
</span><del>-Expecting exception from db.createObjectStore('name').createIndex('name', null)
-PASS Exception was thrown.
-PASS code is DOMException.SYNTAX_ERR
-Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.
-Deleted all object stores.
-Expecting exception from db.createObjectStore('name').createIndex('name', undefined)
-PASS Exception was thrown.
-PASS code is DOMException.SYNTAX_ERR
-Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.
-Deleted all object stores.
</del><span class="cx"> Expecting exception from db.createObjectStore('name', {keyPath: ' '})
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS code is DOMException.SYNTAX_ERR
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbkeypathbasicsprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/keypath-basics-private-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/keypath-basics-private-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/keypath-basics-private-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -135,6 +135,16 @@
</span><span class="cx"> index = store.createIndex('name', '_\u200D')
</span><span class="cx"> PASS index.keyPath is '_\u200D'
</span><span class="cx"> Deleted all object stores.
</span><ins>+store = db.createObjectStore('name', {keyPath: 'undefined'})
+PASS store.keyPath is 'undefined'
+index = store.createIndex('name', undefined)
+PASS index.keyPath is 'undefined'
+Deleted all object stores.
+store = db.createObjectStore('name', {keyPath: 'null'})
+PASS store.keyPath is 'null'
+index = store.createIndex('name', null)
+PASS index.keyPath is 'null'
+Deleted all object stores.
</ins><span class="cx"> 
</span><span class="cx"> testInvalidKeyPaths():
</span><span class="cx"> Deleted all object stores.
</span><span class="lines">@@ -157,16 +167,6 @@
</span><span class="cx"> Deleted all object stores.
</span><span class="cx"> 
</span><span class="cx"> Key paths which are never valid:
</span><del>-Expecting exception from db.createObjectStore('name').createIndex('name', null)
-PASS Exception was thrown.
-PASS code is DOMException.SYNTAX_ERR
-Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.
-Deleted all object stores.
-Expecting exception from db.createObjectStore('name').createIndex('name', undefined)
-PASS Exception was thrown.
-PASS code is DOMException.SYNTAX_ERR
-Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.
-Deleted all object stores.
</del><span class="cx"> Expecting exception from db.createObjectStore('name', {keyPath: ' '})
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS code is DOMException.SYNTAX_ERR
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderncreateindexfailuresexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -8,8 +8,6 @@
</span><span class="cx"> indexedDB.deleteDatabase(dbname)
</span><span class="cx"> indexedDB.open(dbname)
</span><span class="cx"> Initial upgrade needed: Old version - 0 New version - 1
</span><del>-Failed to create index with null name
-Failed to create index with invalid key path
</del><span class="cx"> Failed to create index on a deleted object store
</span><span class="cx"> Failed to create multi-entry index with an array key path
</span><span class="cx"> Failed to create index that already exists
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderncreateindexfailuresprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-private-expected.txt (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-private-expected.txt        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-private-expected.txt        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -8,8 +8,6 @@
</span><span class="cx"> indexedDB.deleteDatabase(dbname)
</span><span class="cx"> indexedDB.open(dbname)
</span><span class="cx"> Initial upgrade needed: Old version - 0 New version - 1
</span><del>-Failed to create index with null name
-Failed to create index with invalid key path
</del><span class="cx"> Failed to create index on a deleted object store
</span><span class="cx"> Failed to create multi-entry index with an array key path
</span><span class="cx"> Failed to create index that already exists
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernresourcescreateindexfailuresjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/resources/create-index-failures.js (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/resources/create-index-failures.js        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/create-index-failures.js        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -23,18 +23,6 @@
</span><span class="cx">     database = event.target.result;
</span><span class="cx">     var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
</span><span class="cx"> 
</span><del>-    try {
-        objectStore.createIndex(null, &quot;foo&quot;);
-    } catch(e) {
-        debug(&quot;Failed to create index with null name&quot;);
-    }
-    
-    try {
-        objectStore.createIndex(&quot;TestIndex1&quot;, null);
-    } catch(e) {
-        debug(&quot;Failed to create index with invalid key path&quot;);
-    }
-    
</del><span class="cx">     database.deleteObjectStore(&quot;TestObjectStore&quot;);
</span><span class="cx">     try {
</span><span class="cx">         objectStore.createIndex(&quot;TestIndex2&quot;, &quot;foo&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourceskeypathbasicsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/resources/keypath-basics.js (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/keypath-basics.js        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/LayoutTests/storage/indexeddb/resources/keypath-basics.js        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">         { keyPath: &quot;'_\\u0300'&quot; }, // DIGIT ZERO (Nd)
</span><span class="cx">         { keyPath: &quot;'_\\u203F'&quot; }, // UNDERTIE (Pc)
</span><span class="cx">         { keyPath: &quot;'_\\u200C'&quot; }, // ZWNJ
</span><del>-        { keyPath: &quot;'_\\u200D'&quot; }  // ZWJ
</del><ins>+        { keyPath: &quot;'_\\u200D'&quot; },  // ZWJ
</ins><span class="cx">     ];
</span><span class="cx"> 
</span><span class="cx">     testKeyPaths.forEach(function (testCase) {
</span><span class="lines">@@ -57,6 +57,18 @@
</span><span class="cx">         deleteAllObjectStores(db);
</span><span class="cx">     });
</span><span class="cx"> 
</span><ins>+    evalAndLog(&quot;store = db.createObjectStore('name', {keyPath: 'undefined'})&quot;);
+    shouldBe(&quot;store.keyPath&quot;, &quot;'undefined'&quot;);
+    evalAndLog(&quot;index = store.createIndex('name', undefined)&quot;);
+    shouldBe(&quot;index.keyPath&quot;, &quot;'undefined'&quot;);
+    deleteAllObjectStores(db);
+
+    evalAndLog(&quot;store = db.createObjectStore('name', {keyPath: 'null'})&quot;);
+    shouldBe(&quot;store.keyPath&quot;, &quot;'null'&quot;);
+    evalAndLog(&quot;index = store.createIndex('name', null)&quot;);
+    shouldBe(&quot;index.keyPath&quot;, &quot;'null'&quot;);
+    deleteAllObjectStores(db);
+
</ins><span class="cx">     testInvalidKeyPaths();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -77,11 +89,6 @@
</span><span class="cx">     debug(&quot;&quot;);
</span><span class="cx">     debug(&quot;Key paths which are never valid:&quot;);
</span><span class="cx"> 
</span><del>-    evalAndExpectException(&quot;db.createObjectStore('name').createIndex('name', null)&quot;, &quot;DOMException.SYNTAX_ERR&quot;);
-    deleteAllObjectStores(db);
-    evalAndExpectException(&quot;db.createObjectStore('name').createIndex('name', undefined)&quot;, &quot;DOMException.SYNTAX_ERR&quot;);
-    deleteAllObjectStores(db);
-    
</del><span class="cx">     testKeyPaths = [
</span><span class="cx">         &quot;' '&quot;,
</span><span class="cx">         &quot;'foo '&quot;,
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/ChangeLog        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2016-05-11  Darin Adler  &lt;darin@apple.com&gt;
+
+        Change IDBObjectStore.createIndex to take an IDL dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=157520
+
+        Reviewed by Chris Dumez.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::createObjectStore): Use IDBKeyPath::Type instead of
+        IndexedDB::KeyPathType.
+        * Modules/indexeddb/IDBKeyPath.cpp:
+        (WebCore::IDBKeyPath::IDBKeyPath): Ditto.
+        (WebCore::IDBKeyPath::isValid): Ditto.
+        (WebCore::IDBKeyPath::operator==): Ditto.
+        (WebCore::IDBKeyPath::encode): Ditto.
+        (WebCore::IDBKeyPath::decode): Ditto.
+
+        * Modules/indexeddb/IDBKeyPath.h: Use pragma once. Make constructors non-explicit so
+        we can just pass a string or vector and have it turn into an IDBKeyPath. Added an enum
+        class named Type here and use it instead of IndexedDB::KeyPathType.
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::openCursor): Remove unneeded local variable.
+        (WebCore::IDBObjectStore::get): Ditto.
+        (WebCore::IDBObjectStore::doDelete): Ditto.
+        (WebCore::IDBObjectStore::createIndex): Changed argument type to take IndexParameters
+        instead of two seaparate booleans. Also updated to use IDBKeyPath::Type.
+
+        * Modules/indexeddb/IDBObjectStore.h: Removed include of IndexedDB, using a forward
+        decalration instead. Marked the class final. Added an IndexParameters struct and used
+        it for the argument to createIndex.
+
+        * Modules/indexeddb/IDBObjectStore.idl: Stopped using Custom for put, add, and
+        createIndex functions. Stopped using Dictionary for createIndex, using IDBIndexParameters
+        instead as in the specification. Added IDBIndexParameters dictionary definition.
+
+        * Modules/indexeddb/IndexedDB.h: Use pragma once. Removed KeyPathType.
+
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::injectIDBKeyIntoScriptValue): Use IDBKeyPath::Type instead of
+        IndexedDB::KeyPathType.
+        (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Ditto.
+        (WebCore::canInjectIDBKeyIntoScriptValue): Ditto.
+        (WebCore::createKeyPathArray): Ditto.
+        (WebCore::toJS): Ditto.
+        * bindings/js/JSIDBObjectStoreCustom.cpp:
+        (WebCore::putOrAdd): Deleted.
+        (WebCore::JSIDBObjectStore::putFunction): Deleted.
+        (WebCore::JSIDBObjectStore::add): Deleted.
+        (WebCore::JSIDBObjectStore::createIndex): Deleted.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateParametersCheckExpression): Fixed code that generates a type check for
+        wrappers to only check types is knows how to check: wrappers and arrays, including
+        typed arrays. This prevents it from trying to check dictionaries.
+
+        * inspector/InspectorIndexedDBAgent.cpp: Use IDBKeyPath::Type instead of
+        IndexedDB::KeyPathType.
+
</ins><span class="cx"> 2016-05-11  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: WebWorker support.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (autoIncrement &amp;&amp; !keyPath.isNull()) {
</span><del>-        if ((keyPath.type() == IndexedDB::KeyPathType::String &amp;&amp; keyPath.string().isEmpty()) || keyPath.type() == IndexedDB::KeyPathType::Array) {
</del><ins>+        if ((keyPath.type() == IDBKeyPath::Type::String &amp;&amp; keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::Type::Array) {
</ins><span class="cx">             ec.code = IDBDatabaseException::InvalidAccessError;
</span><span class="cx">             ec.message = ASCIILiteral(&quot;Failed to execute 'createObjectStore' on 'IDBDatabase': The autoIncrement option was set but the keyPath option was empty or an array.&quot;);
</span><span class="cx">             return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyPathcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -192,14 +192,14 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBKeyPath::IDBKeyPath(const String&amp; string)
</span><del>-    : m_type(IndexedDB::KeyPathType::String)
</del><ins>+    : m_type(Type::String)
</ins><span class="cx">     , m_string(string)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_string.isNull());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBKeyPath::IDBKeyPath(const Vector&lt;String&gt;&amp; array)
</span><del>-    : m_type(IndexedDB::KeyPathType::Array)
</del><ins>+    : m_type(Type::Array)
</ins><span class="cx">     , m_array(array)
</span><span class="cx"> {
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -211,13 +211,11 @@
</span><span class="cx"> bool IDBKeyPath::isValid() const
</span><span class="cx"> {
</span><span class="cx">     switch (m_type) {
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case Type::Null:
</ins><span class="cx">         return false;
</span><del>-
-    case IndexedDB::KeyPathType::String:
</del><ins>+    case Type::String:
</ins><span class="cx">         return IDBIsValidKeyPath(m_string);
</span><del>-
-    case IndexedDB::KeyPathType::Array:
</del><ins>+    case Type::Array:
</ins><span class="cx">         if (m_array.isEmpty())
</span><span class="cx">             return false;
</span><span class="cx">         for (auto&amp; key : m_array) {
</span><span class="lines">@@ -236,11 +234,11 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     switch (m_type) {
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case Type::Null:
</ins><span class="cx">         return true;
</span><del>-    case IndexedDB::KeyPathType::String:
</del><ins>+    case Type::String:
</ins><span class="cx">         return m_string == other.m_string;
</span><del>-    case IndexedDB::KeyPathType::Array:
</del><ins>+    case Type::Array:
</ins><span class="cx">         return m_array == other.m_array;
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -252,11 +250,9 @@
</span><span class="cx">     IDBKeyPath result;
</span><span class="cx">     result.m_type = m_type;
</span><span class="cx">     result.m_string = m_string.isolatedCopy();
</span><del>-
</del><span class="cx">     result.m_array.reserveInitialCapacity(m_array.size());
</span><span class="cx">     for (auto&amp; key : m_array)
</span><span class="cx">         result.m_array.uncheckedAppend(key.isolatedCopy());
</span><del>-
</del><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -264,44 +260,41 @@
</span><span class="cx"> {
</span><span class="cx">     encoder.encodeEnum(&quot;type&quot;, m_type);
</span><span class="cx">     switch (m_type) {
</span><del>-    case IndexedDB::KeyPathType::Null:
-        break;
-    case IndexedDB::KeyPathType::String:
</del><ins>+    case Type::Null:
+        return;
+    case Type::String:
</ins><span class="cx">         encoder.encodeString(&quot;string&quot;, m_string);
</span><del>-        break;
-    case IndexedDB::KeyPathType::Array:
</del><ins>+        return;
+    case Type::Array:
</ins><span class="cx">         encoder.encodeObjects(&quot;array&quot;, m_array.begin(), m_array.end(), [](WebCore::KeyedEncoder&amp; encoder, const String&amp; string) {
</span><span class="cx">             encoder.encodeString(&quot;string&quot;, string);
</span><span class="cx">         });
</span><del>-        break;
-    default:
-        ASSERT_NOT_REACHED();
</del><ins>+        return;
</ins><span class="cx">     };
</span><ins>+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IDBKeyPath::decode(KeyedDecoder&amp; decoder, IDBKeyPath&amp; result)
</span><span class="cx"> {
</span><del>-    auto enumFunction = [](IndexedDB::KeyPathType value) {
-        return value == IndexedDB::KeyPathType::Null || value == IndexedDB::KeyPathType::String || value == IndexedDB::KeyPathType::Array;
-    };
-
-    if (!decoder.decodeEnum(&quot;type&quot;, result.m_type, enumFunction))
</del><ins>+    bool succeeded = decoder.decodeEnum(&quot;type&quot;, result.m_type, [](Type value) {
+        return value == Type::Null || value == Type::String || value == Type::Array;
+    });
+    if (!succeeded)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (result.m_type == IndexedDB::KeyPathType::Null)
</del><ins>+    switch (result.m_type) {
+    case Type::Null:
</ins><span class="cx">         return true;
</span><del>-
-    if (result.m_type == IndexedDB::KeyPathType::String)
</del><ins>+    case Type::String:
</ins><span class="cx">         return decoder.decodeString(&quot;string&quot;, result.m_string);
</span><del>-
-    ASSERT(result.m_type == IndexedDB::KeyPathType::Array);
-
-    auto arrayFunction = [](KeyedDecoder&amp; decoder, String&amp; result) {
-        return decoder.decodeString(&quot;string&quot;, result);
-    };
-
-    result.m_array.clear();
-    return decoder.decodeObjects(&quot;array&quot;, result.m_array, arrayFunction);
</del><ins>+    case Type::Array:
+        result.m_array.clear();
+        return decoder.decodeObjects(&quot;array&quot;, result.m_array, [](KeyedDecoder&amp; decoder, String&amp; result) {
+            return decoder.decodeString(&quot;string&quot;, result);
+        });
+    }
+    ASSERT_NOT_REACHED();
+    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyPathh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -23,12 +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><del>-#ifndef IDBKeyPath_h
-#define IDBKeyPath_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;IndexedDB.h&quot;
</del><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -49,24 +47,25 @@
</span><span class="cx"> class IDBKeyPath {
</span><span class="cx"> public:
</span><span class="cx">     IDBKeyPath() { }
</span><del>-    WEBCORE_EXPORT explicit IDBKeyPath(const String&amp;);
-    WEBCORE_EXPORT explicit IDBKeyPath(const Vector&lt;String&gt;&amp; array);
</del><ins>+    WEBCORE_EXPORT IDBKeyPath(const String&amp;);
+    WEBCORE_EXPORT IDBKeyPath(const Vector&lt;String&gt;&amp; array);
</ins><span class="cx"> 
</span><del>-    IndexedDB::KeyPathType type() const { return m_type; }
</del><ins>+    enum class Type { Null, String, Array };
+    Type type() const { return m_type; }
</ins><span class="cx"> 
</span><span class="cx">     const Vector&lt;String&gt;&amp; array() const
</span><span class="cx">     {
</span><del>-        ASSERT(m_type == IndexedDB::KeyPathType::Array);
</del><ins>+        ASSERT(m_type == Type::Array);
</ins><span class="cx">         return m_array;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const String&amp; string() const
</span><span class="cx">     {
</span><del>-        ASSERT(m_type == IndexedDB::KeyPathType::String);
</del><ins>+        ASSERT(m_type == Type::String);
</ins><span class="cx">         return m_string;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool isNull() const { return m_type == IndexedDB::KeyPathType::Null; }
</del><ins>+    bool isNull() const { return m_type == Type::Null; }
</ins><span class="cx">     bool isValid() const;
</span><span class="cx">     bool operator==(const IDBKeyPath&amp; other) const;
</span><span class="cx"> 
</span><span class="lines">@@ -79,23 +78,22 @@
</span><span class="cx">     WEBCORE_EXPORT static bool decode(KeyedDecoder&amp;, IDBKeyPath&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    IndexedDB::KeyPathType m_type { IndexedDB::KeyPathType::Null };
</del><ins>+    Type m_type { Type::Null };
</ins><span class="cx">     String m_string;
</span><span class="cx">     Vector&lt;String&gt; m_array;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template&lt;class Encoder&gt;
-void IDBKeyPath::encode(Encoder&amp; encoder) const
</del><ins>+template&lt;class Encoder&gt; void IDBKeyPath::encode(Encoder&amp; encoder) const
</ins><span class="cx"> {
</span><span class="cx">     encoder.encodeEnum(m_type);
</span><span class="cx"> 
</span><span class="cx">     switch (m_type) {
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case Type::Null:
</ins><span class="cx">         break;
</span><del>-    case IndexedDB::KeyPathType::String:
</del><ins>+    case Type::String:
</ins><span class="cx">         encoder &lt;&lt; m_string;
</span><span class="cx">         break;
</span><del>-    case IndexedDB::KeyPathType::Array:
</del><ins>+    case Type::Array:
</ins><span class="cx">         encoder &lt;&lt; m_array;
</span><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="lines">@@ -103,19 +101,18 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;class Decoder&gt;
-bool IDBKeyPath::decode(Decoder&amp; decoder, IDBKeyPath&amp; keyPath)
</del><ins>+template&lt;class Decoder&gt; bool IDBKeyPath::decode(Decoder&amp; decoder, IDBKeyPath&amp; keyPath)
</ins><span class="cx"> {
</span><del>-    IndexedDB::KeyPathType type;
</del><ins>+    Type type;
</ins><span class="cx">     if (!decoder.decodeEnum(type))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     switch (type) {
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case Type::Null:
</ins><span class="cx">         keyPath = IDBKeyPath();
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    case IndexedDB::KeyPathType::String: {
</del><ins>+    case Type::String: {
</ins><span class="cx">         String string;
</span><span class="cx">         if (!decoder.decode(string))
</span><span class="cx">             return false;
</span><span class="lines">@@ -123,7 +120,7 @@
</span><span class="cx">         keyPath = IDBKeyPath(string);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><del>-    case IndexedDB::KeyPathType::Array: {
</del><ins>+    case Type::Array: {
</ins><span class="cx">         Vector&lt;String&gt; array;
</span><span class="cx">         if (!decoder.decode(array))
</span><span class="cx">             return false;
</span><span class="lines">@@ -139,5 +136,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-
-#endif // IDBKeyPath_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -146,8 +146,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     auto info = IDBCursorInfo::objectStoreCursor(m_transaction.get(), m_info.identifier(), range, direction);
</span><del>-    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestOpenCursor(context, *this, info);
-    return WTFMove(request);
</del><ins>+    return m_transaction-&gt;requestOpenCursor(context, *this, info);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::openCursor(ScriptExecutionContext&amp; context, JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -185,8 +184,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestGetRecord(context, *this, idbKey.get());
-    return WTFMove(request);
</del><ins>+    return m_transaction-&gt;requestGetRecord(context, *this, idbKey.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::get(ScriptExecutionContext&amp; context, IDBKeyRange* keyRange, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -211,8 +209,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestGetRecord(context, *this, keyRangeData);
-    return WTFMove(request);
</del><ins>+    return m_transaction-&gt;requestGetRecord(context, *this, keyRangeData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::add(ExecState&amp; execState, JSValue value, JSValue key, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -382,8 +379,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestDeleteRecord(context, *this, keyRangeData);
-    return WTFMove(request);
</del><ins>+    return m_transaction-&gt;requestDeleteRecord(context, *this, keyRangeData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::deleteFunction(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -435,7 +431,7 @@
</span><span class="cx">     return adoptRef(request.leakRef());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBIndex&gt; IDBObjectStore::createIndex(ScriptExecutionContext&amp;, const String&amp; name, const IDBKeyPath&amp; keyPath, bool unique, bool multiEntry, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBIndex&gt; IDBObjectStore::createIndex(ScriptExecutionContext&amp;, const String&amp; name, const IDBKeyPath&amp; keyPath, const IndexParameters&amp; parameters, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::createIndex %s&quot;, name.utf8().data());
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="lines">@@ -474,14 +470,14 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (keyPath.type() == IndexedDB::KeyPathType::Array &amp;&amp; multiEntry) {
</del><ins>+    if (keyPath.type() == IDBKeyPath::Type::Array &amp;&amp; parameters.multiEntry) {
</ins><span class="cx">         ec.code = IDBDatabaseException::InvalidAccessError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument was an array and the multiEntry option is true.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Install the new Index into the ObjectStore's info.
</span><del>-    IDBIndexInfo info = m_info.createNewIndex(name, keyPath, unique, multiEntry);
</del><ins>+    IDBIndexInfo info = m_info.createNewIndex(name, keyPath, parameters.unique, parameters.multiEntry);
</ins><span class="cx">     m_transaction-&gt;database().didCreateIndexInfo(info);
</span><span class="cx"> 
</span><span class="cx">     // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><del>-#include &quot;IndexedDB.h&quot;
</del><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -50,7 +49,11 @@
</span><span class="cx"> struct ExceptionCodeWithMessage;
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><del>-class IDBObjectStore : public RefCounted&lt;IDBObjectStore&gt;, public ActiveDOMObject {
</del><ins>+namespace IndexedDB {
+enum class ObjectStoreOverwriteMode;
+}
+
+class IDBObjectStore final : public RefCounted&lt;IDBObjectStore&gt;, public ActiveDOMObject {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;IDBObjectStore&gt; create(ScriptExecutionContext&amp;, const IDBObjectStoreInfo&amp;, IDBTransaction&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -62,6 +65,11 @@
</span><span class="cx">     RefPtr&lt;IDBTransaction&gt; transaction();
</span><span class="cx">     bool autoIncrement() const;
</span><span class="cx"> 
</span><ins>+    struct IndexParameters {
+        bool unique;
+        bool multiEntry;
+    };
+
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, IDBKeyRange*, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext&amp;, JSC::JSValue key, const String&amp; direction, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</span><span class="lines">@@ -71,7 +79,7 @@
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; deleteFunction(ScriptExecutionContext&amp;, JSC::JSValue key, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; clear(ScriptExecutionContext&amp;, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;IDBIndex&gt; createIndex(ScriptExecutionContext&amp;, const String&amp; name, const IDBKeyPath&amp;, bool unique, bool multiEntry, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBIndex&gt; createIndex(ScriptExecutionContext&amp;, const String&amp; name, const IDBKeyPath&amp;, const IndexParameters&amp;, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBIndex&gt; index(const String&amp; name, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     void deleteIndex(const String&amp; name, ExceptionCodeWithMessage&amp;);
</span><span class="cx">     RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><span class="lines">@@ -85,8 +93,7 @@
</span><span class="cx"> 
</span><span class="cx">     const IDBObjectStoreInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><del>-    // FIXME: After removing LegacyIDB and folding abstract/implementation classes together,
-    // this will no longer be necessary.
</del><ins>+    // FIXME: After removing LegacyIDB and folding abstract/implementation classes together, this will no longer be necessary.
</ins><span class="cx">     IDBTransaction&amp; modernTransaction() { return m_transaction.get(); }
</span><span class="cx"> 
</span><span class="cx">     void rollbackInfoForVersionChangeAbort();
</span><span class="lines">@@ -96,19 +103,14 @@
</span><span class="cx"> private:
</span><span class="cx">     IDBObjectStore(ScriptExecutionContext&amp;, const IDBObjectStoreInfo&amp;, IDBTransaction&amp;);
</span><span class="cx"> 
</span><del>-    enum class InlineKeyCheck {
-        Perform,
-        DoNotPerform,
-    };
-
</del><ins>+    enum class InlineKeyCheck { Perform, DoNotPerform };
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; putOrAdd(JSC::ExecState&amp;, JSC::JSValue, RefPtr&lt;IDBKey&gt;, IndexedDB::ObjectStoreOverwriteMode, InlineKeyCheck, ExceptionCodeWithMessage&amp;);
</span><del>-    RefPtr&lt;WebCore::IDBRequest&gt; doCount(ScriptExecutionContext&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBRequest&gt; doCount(ScriptExecutionContext&amp;, const IDBKeyRangeData&amp;, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBRequest&gt; doDelete(ScriptExecutionContext&amp;, IDBKeyRange*, ExceptionCodeWithMessage&amp;);
</span><span class="cx"> 
</span><del>-    // ActiveDOMObject
-    const char* activeDOMObjectName() const;
-    bool canSuspendForDocumentSuspension() const;
-    bool hasPendingActivity() const;
</del><ins>+    const char* activeDOMObjectName() const final;
+    bool canSuspendForDocumentSuspension() const final;
+    bool hasPendingActivity() const final;
</ins><span class="cx"> 
</span><span class="cx">     IDBObjectStoreInfo m_info;
</span><span class="cx">     IDBObjectStoreInfo m_originalInfo;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -26,9 +26,9 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=INDEXED_DATABASE,
</span><span class="cx">     EnabledAtRuntime=IndexedDB,
</span><ins>+    GenerateIsReachable=Impl,
+    JSCustomMarkFunction,
</ins><span class="cx">     SkipVTableValidation,
</span><del>-    JSCustomMarkFunction,
-    GenerateIsReachable=Impl,
</del><span class="cx"> ] interface IDBObjectStore {
</span><span class="cx">     readonly attribute DOMString? name;
</span><span class="cx">     [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx">     readonly attribute IDBTransaction transaction;
</span><span class="cx">     readonly attribute boolean autoIncrement;
</span><span class="cx"> 
</span><del>-    [CallWith=ScriptExecutionContext, Custom, ImplementedAs=putFunction, RaisesExceptionWithMessage] IDBRequest put(any value, optional any key);
-    [CallWith=ScriptExecutionContext, Custom, RaisesExceptionWithMessage] IDBRequest add(any value, optional any key);
</del><ins>+    [CallWith=ScriptState, RaisesExceptionWithMessage] IDBRequest put(any value, optional any key);
+    [CallWith=ScriptState, RaisesExceptionWithMessage] IDBRequest add(any value, optional any key);
</ins><span class="cx">     [CallWith=ScriptExecutionContext, ImplementedAs=deleteFunction, RaisesExceptionWithMessage] IDBRequest delete(IDBKeyRange? keyRange);
</span><span class="cx">     [CallWith=ScriptExecutionContext, ImplementedAs=deleteFunction, RaisesExceptionWithMessage] IDBRequest delete(any key);
</span><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBRequest get(IDBKeyRange? key);
</span><span class="lines">@@ -45,10 +45,15 @@
</span><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBRequest clear();
</span><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBRequest openCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
</span><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBRequest openCursor(any key, optional DOMString direction = &quot;next&quot;);
</span><del>-    [CallWith=ScriptExecutionContext, Custom, RaisesExceptionWithMessage] IDBIndex createIndex(DOMString name, sequence&lt;DOMString&gt; keyPath, optional Dictionary options);
-    [CallWith=ScriptExecutionContext, Custom, RaisesExceptionWithMessage] IDBIndex createIndex(DOMString name, DOMString keyPath, optional Dictionary options);
</del><ins>+    [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBIndex createIndex(DOMString name, sequence&lt;DOMString&gt; keyPath, optional IDBIndexParameters options);
+    [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBIndex createIndex(DOMString name, DOMString keyPath, optional IDBIndexParameters options);
</ins><span class="cx">     [RaisesExceptionWithMessage] IDBIndex index(DOMString name);
</span><span class="cx">     [RaisesExceptionWithMessage] void deleteIndex(DOMString name);
</span><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBRequest count(optional IDBKeyRange? range = null);
</span><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBRequest count(any key);
</span><span class="cx"> };
</span><ins>+
+dictionary IDBIndexParameters {
+    boolean unique = false;
+    boolean multiEntry = false;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIndexedDBh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef IndexedDB_h
-#define IndexedDB_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="lines">@@ -71,12 +70,6 @@
</span><span class="cx">     NonNull,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum class KeyPathType {
-    Null,
-    String,
-    Array,
-};
-
</del><span class="cx"> enum class ObjectStoreOverwriteMode {
</span><span class="cx">     Overwrite,
</span><span class="cx">     OverwriteForCursor,
</span><span class="lines">@@ -110,5 +103,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLED(INDEXED_DATABASE)
</span><del>-
-#endif // IndexedDB_h
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx">     if (isJSArray(keyPathValue))
</span><span class="cx">         keyPath = IDBKeyPath(toNativeArray&lt;String&gt;(&amp;exec, keyPathValue));
</span><span class="cx">     else
</span><del>-        keyPath = IDBKeyPath(keyPathValue.toString(&amp;exec)-&gt;value(&amp;exec));
</del><ins>+        keyPath = IDBKeyPath(keyPathValue.toWTFString(&amp;exec));
</ins><span class="cx">     return keyPath;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;injectIDBKeyIntoScriptValue&quot;);
</span><span class="cx"> 
</span><del>-    ASSERT(keyPath.type() == IndexedDB::KeyPathType::String);
</del><ins>+    ASSERT(keyPath.type() == IDBKeyPath::Type::String);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; keyPathElements;
</span><span class="cx">     IDBKeyPathParseError error;
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!keyPath.isNull());
</span><span class="cx"> 
</span><del>-    if (keyPath.type() == IndexedDB::KeyPathType::Array) {
</del><ins>+    if (keyPath.type() == IDBKeyPath::Type::Array) {
</ins><span class="cx">         const Vector&lt;String&gt;&amp; array = keyPath.array();
</span><span class="cx">         Vector&lt;RefPtr&lt;IDBKey&gt;&gt; result;
</span><span class="cx">         result.reserveInitialCapacity(array.size());
</span><span class="lines">@@ -282,7 +282,7 @@
</span><span class="cx">         return IDBKey::createArray(WTFMove(result));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT(keyPath.type() == IndexedDB::KeyPathType::String);
</del><ins>+    ASSERT(keyPath.type() == IDBKeyPath::Type::String);
</ins><span class="cx">     return internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, keyPath.string());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(StorageAPI, &quot;canInjectIDBKeyIntoScriptValue&quot;);
</span><span class="cx"> 
</span><del>-    ASSERT(keyPath.type() == IndexedDB::KeyPathType::String);
</del><ins>+    ASSERT(keyPath.type() == IDBKeyPath::Type::String);
</ins><span class="cx">     Vector&lt;String&gt; keyPathElements;
</span><span class="cx">     IDBKeyPathParseError error;
</span><span class="cx">     IDBParseKeyPath(keyPath.string(), keyPathElements, error);
</span><span class="lines">@@ -367,7 +367,7 @@
</span><span class="cx">     Vector&lt;IDBKeyData&gt; keys;
</span><span class="cx"> 
</span><span class="cx">     switch (info.keyPath().type()) {
</span><del>-    case IndexedDB::KeyPathType::Array:
</del><ins>+    case IDBKeyPath::Type::Array:
</ins><span class="cx">         for (auto&amp; entry : info.keyPath().array()) {
</span><span class="cx">             auto key = internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, entry);
</span><span class="cx">             if (!key)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx">             keys.append(key.get());
</span><span class="cx">         }
</span><span class="cx">         break;
</span><del>-    case IndexedDB::KeyPathType::String: {
</del><ins>+    case IDBKeyPath::Type::String: {
</ins><span class="cx">         auto idbKey = internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, info.keyPath().string());
</span><span class="cx">         if (!idbKey)
</span><span class="cx">             return { };
</span><span class="lines">@@ -388,7 +388,7 @@
</span><span class="cx"> 
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case IDBKeyPath::Type::Null:
</ins><span class="cx">         RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -408,11 +408,11 @@
</span><span class="cx"> JSValue toJS(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, const IDBKeyPath&amp; value)
</span><span class="cx"> {
</span><span class="cx">     switch (value.type()) {
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case IDBKeyPath::Type::Null:
</ins><span class="cx">         return jsNull();
</span><del>-    case IndexedDB::KeyPathType::String:
</del><ins>+    case IDBKeyPath::Type::String:
</ins><span class="cx">         return jsStringWithCache(&amp;state, value.string());
</span><del>-    case IndexedDB::KeyPathType::Array:
</del><ins>+    case IDBKeyPath::Type::Array:
</ins><span class="cx">         auto keyPaths = DOMStringList::create();
</span><span class="cx">         for (auto&amp; path : value.array())
</span><span class="cx">             keyPaths-&gt;append(path);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBObjectStoreCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -31,16 +31,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSIDBObjectStore.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;IDBBindingUtilities.h&quot;
-#include &quot;IDBDatabaseException.h&quot;
-#include &quot;IDBKeyPath.h&quot;
-#include &quot;IDBObjectStore.h&quot;
-#include &quot;JSDOMBinding.h&quot;
-#include &quot;JSIDBIndex.h&quot;
-#include &quot;JSIDBRequest.h&quot;
-#include &lt;runtime/Error.h&gt;
-#include &lt;runtime/JSString.h&gt;
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -50,97 +40,6 @@
</span><span class="cx">     static_cast&lt;IDBObjectStore&amp;&gt;(wrapped()).visitReferencedIndexes(visitor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSValue putOrAdd(JSC::ExecState&amp; state, bool overwrite)
-{
-    JSValue thisValue = state.thisValue();
-    JSIDBObjectStore* castedThis = jsDynamicCast&lt;JSIDBObjectStore*&gt;(thisValue);
-    if (UNLIKELY(!castedThis))
-        return JSValue::decode(throwThisTypeError(state, &quot;IDBObjectStore&quot;, &quot;put&quot;));
-
-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSIDBObjectStore::info());
-    auto&amp; wrapped = castedThis-&gt;wrapped();
-
-    size_t argsCount = state.argumentCount();
-    if (UNLIKELY(argsCount &lt; 1))
-        return JSValue::decode(throwVMError(&amp;state, createNotEnoughArgumentsError(&amp;state)));
-
-    ExceptionCodeWithMessage ec;
-    auto value = state.uncheckedArgument(0);
-    auto key = state.argument(1);
-    JSValue result;
-    if (overwrite)
-        result = toJS(&amp;state, castedThis-&gt;globalObject(), wrapped.put(state, value, key, ec).get());
-    else
-        result = toJS(&amp;state, castedThis-&gt;globalObject(), wrapped.add(state, value, key, ec).get());
-
-    setDOMException(&amp;state, ec);
-    return result;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSIDBObjectStore::putFunction(JSC::ExecState&amp; state)
-{
-    return putOrAdd(state, true);
-}
-
-JSValue JSIDBObjectStore::add(JSC::ExecState&amp; state)
-{
-    return putOrAdd(state, false);
-}
-
-JSValue JSIDBObjectStore::createIndex(ExecState&amp; state)
-{
-    ScriptExecutionContext* context = jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())-&gt;scriptExecutionContext();
-    if (!context)
-        return state.vm().throwException(&amp;state, createReferenceError(&amp;state, &quot;IDBObjectStore script &amp;stateution context is unavailable&quot;));
-
-    if (state.argumentCount() &lt; 2)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    String name;
-    JSValue nameValue = state.argument(0);
-    if (!nameValue.isUndefinedOrNull())
-        name = nameValue.toString(&amp;state)-&gt;value(&amp;state);
-
-    if (state.hadException())
-        return jsUndefined();
-
-    IDBKeyPath keyPath;
-    JSValue keyPathValue = state.argument(1);
-    if (!keyPathValue.isUndefinedOrNull())
-        keyPath = idbKeyPathFromValue(state, keyPathValue);
-    else {
-        ExceptionCodeWithMessage ec;
-        ec.code = IDBDatabaseException::SyntaxError;
-        ec.message = ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.&quot;);
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    if (state.hadException())
-        return jsUndefined();
-
-    JSValue optionsValue = state.argument(2);
-    if (!optionsValue.isUndefinedOrNull() &amp;&amp; !optionsValue.isObject())
-        return throwTypeError(&amp;state, &quot;Failed to execute 'createIndex' on 'IDBObjectStore': No function was found that matched the signature provided.&quot;);
-
-    bool unique = false;
-    bool multiEntry = false;
-    if (!optionsValue.isUndefinedOrNull()) {
-        unique = optionsValue.get(&amp;state, Identifier::fromString(&amp;state, &quot;unique&quot;)).toBoolean(&amp;state);
-        if (state.hadException())
-            return jsUndefined();
-
-        multiEntry = optionsValue.get(&amp;state, Identifier::fromString(&amp;state, &quot;multiEntry&quot;)).toBoolean(&amp;state);
-        if (state.hadException())
-            return jsUndefined();
-    }
-
-    ExceptionCodeWithMessage ec;
-    JSValue result = toJS(&amp;state, globalObject(), wrapped().createIndex(*context, name, keyPath, unique, multiEntry, ec).get());
-    setDOMException(&amp;state, ec);
-    return result;
-}
-
-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -1661,7 +1661,6 @@
</span><span class="cx">         my $value = &quot;arg$parameterIndex&quot;;
</span><span class="cx">         my $type = $parameter-&gt;type;
</span><span class="cx"> 
</span><del>-        # Only DOMString or wrapper types are checked.
</del><span class="cx">         # For DOMString with StrictTypeChecking only Null, Undefined and Object
</span><span class="cx">         # are accepted for compatibility. Otherwise, no restrictions are made to
</span><span class="cx">         # match the non-overloaded behavior.
</span><span class="lines">@@ -1679,12 +1678,11 @@
</span><span class="cx">                 push(@andExpression, &quot;(${value}.isNull() || ${value}.isObject())&quot;);
</span><span class="cx">             }
</span><span class="cx">             $usedArguments{$parameterIndex} = 1;
</span><del>-        } elsif (!IsNativeType($type)) {
</del><ins>+        } elsif ($codeGenerator-&gt;GetArrayOrSequenceType($type) || $codeGenerator-&gt;IsTypedArrayType($type) || $codeGenerator-&gt;IsWrapperType($type)) {
</ins><span class="cx">             my $condition = &quot;&quot;;
</span><span class="cx">             $condition .= &quot;${value}.isUndefined() || &quot; if $parameter-&gt;isOptional;
</span><span class="cx"> 
</span><del>-            # FIXME: WebIDL says that undefined is also acceptable for nullable parameters and
-            # should be converted to null:
</del><ins>+            # FIXME: WebIDL says that undefined is also acceptable for nullable parameters and should be converted to null:
</ins><span class="cx">             # http://heycam.github.io/webidl/#es-nullable-type
</span><span class="cx">             $condition .= &quot;${value}.isNull() || &quot; if $parameter-&gt;isNullable;
</span><span class="cx"> 
</span><span class="lines">@@ -3701,13 +3699,7 @@
</span><span class="cx">             }
</span><span class="cx">             $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">         } elsif ($parameter-&gt;isVariadic) {
</span><del>-            my $nativeElementType;
-            if ($type eq &quot;DOMString&quot;) {
-                $nativeElementType = &quot;String&quot;;
-            } else {
-                $nativeElementType = GetNativeType($interface, $type);
-            }
-
</del><ins>+            my $nativeElementType = GetNativeType($interface, $type);
</ins><span class="cx">             if (!IsNativeType($type)) {
</span><span class="cx">                 push(@$outputArray, &quot;    Vector&lt;$nativeElementType&gt; $name;\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    for (unsigned i = $argumentIndex, count = state-&gt;argumentCount(); i &lt; count; ++i) {\n&quot;);
</span><span class="lines">@@ -3717,7 +3709,6 @@
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;)
</span><span class="cx">             } else {
</span><span class="cx">                 push(@$outputArray, &quot;    Vector&lt;$nativeElementType&gt; $name = toNativeArguments&lt;$nativeElementType&gt;(state, $argumentIndex);\n&quot;);
</span><del>-                # Check if the type conversion succeeded.
</del><span class="cx">                 push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (200698 => 200699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-05-11 19:59:32 UTC (rev 200698)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-05-11 20:04:58 UTC (rev 200699)
</span><span class="lines">@@ -169,19 +169,19 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;KeyPath&gt; keyPath;
</span><span class="cx">     switch (idbKeyPath.type()) {
</span><del>-    case IndexedDB::KeyPathType::Null:
</del><ins>+    case IDBKeyPath::Type::Null:
</ins><span class="cx">         keyPath = KeyPath::create()
</span><span class="cx">             .setType(KeyPath::Type::Null)
</span><span class="cx">             .release();
</span><span class="cx">         break;
</span><del>-    case IndexedDB::KeyPathType::String:
</del><ins>+    case IDBKeyPath::Type::String:
</ins><span class="cx">         keyPath = KeyPath::create()
</span><span class="cx">             .setType(KeyPath::Type::String)
</span><span class="cx">             .release();
</span><span class="cx">         keyPath-&gt;setString(idbKeyPath.string());
</span><span class="cx"> 
</span><span class="cx">         break;
</span><del>-    case IndexedDB::KeyPathType::Array: {
</del><ins>+    case IDBKeyPath::Type::Array: {
</ins><span class="cx">         auto array = Inspector::Protocol::Array&lt;String&gt;::create();
</span><span class="cx">         for (auto&amp; string : idbKeyPath.array())
</span><span class="cx">             array-&gt;addItem(string);
</span></span></pre>
</div>
</div>

</body>
</html>