<!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>[201660] trunk/Source/WebCore</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/201660">201660</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-06-03 14:42:03 -0700 (Fri, 03 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Miscellaneous IDBBindingUtilities cleanup.
https://bugs.webkit.org/show_bug.cgi?id=158353

Reviewed by Tim Horton.

No new tests (Straight refactor, yo).

Starting with removing a single form of scriptValueToIDBKey(), and making the return value be
Ref&lt;IDBKey&gt; instead of RefPtr&lt;IDBKey&gt;, update a whole bunch of code to understand that the ExecState
is non-null and the resulting key is non-null.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continueFunction):

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::cmp):

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::getKey):

* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::compare):
(WebCore::IDBKey::isLessThan):
(WebCore::IDBKey::isEqual):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createMultiEntryArray):

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
(WebCore::IDBKeyRange::isOnlyKey):

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::modernDelete):
(WebCore::IDBObjectStore::count):

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::get):
(WebCore::set):
(WebCore::createIDBKeyFromValue):
(WebCore::getNthValueOnKeyPath):
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::ensureNthValueOnKeyPath):
(WebCore::canInjectNthValueOnKeyPath):
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
(WebCore::deserializeIDBValueToJSValue):
(WebCore::scriptValueToIDBKey):
(WebCore::createKeyPathArray):
* bindings/js/IDBBindingUtilities.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactorycpp">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexcpp">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeycpp">trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyh">trunk/Source/WebCore/Modules/indexeddb/IDBKey.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiesh">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/ChangeLog        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2016-06-03  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Miscellaneous IDBBindingUtilities cleanup.
+        https://bugs.webkit.org/show_bug.cgi?id=158353
+
+        Reviewed by Tim Horton.
+
+        No new tests (Straight refactor, yo).
+
+        Starting with removing a single form of scriptValueToIDBKey(), and making the return value be
+        Ref&lt;IDBKey&gt; instead of RefPtr&lt;IDBKey&gt;, update a whole bunch of code to understand that the ExecState
+        is non-null and the resulting key is non-null.
+        
+        * Modules/indexeddb/IDBCursor.cpp:
+        (WebCore::IDBCursor::continueFunction):
+        
+        * Modules/indexeddb/IDBFactory.cpp:
+        (WebCore::IDBFactory::cmp):
+        
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::count):
+        (WebCore::IDBIndex::get):
+        (WebCore::IDBIndex::getKey):
+        
+        * Modules/indexeddb/IDBKey.cpp:
+        (WebCore::IDBKey::compare):
+        (WebCore::IDBKey::isLessThan):
+        (WebCore::IDBKey::isEqual):
+        * Modules/indexeddb/IDBKey.h:
+        (WebCore::IDBKey::createMultiEntryArray):
+        
+        * Modules/indexeddb/IDBKeyRange.cpp:
+        (WebCore::IDBKeyRange::only):
+        (WebCore::IDBKeyRange::lowerBound):
+        (WebCore::IDBKeyRange::upperBound):
+        (WebCore::IDBKeyRange::bound):
+        (WebCore::IDBKeyRange::isOnlyKey):
+        
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::get):
+        (WebCore::IDBObjectStore::modernDelete):
+        (WebCore::IDBObjectStore::count):
+        
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::get):
+        (WebCore::set):
+        (WebCore::createIDBKeyFromValue):
+        (WebCore::getNthValueOnKeyPath):
+        (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
+        (WebCore::ensureNthValueOnKeyPath):
+        (WebCore::canInjectNthValueOnKeyPath):
+        (WebCore::injectIDBKeyIntoScriptValue):
+        (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath):
+        (WebCore::canInjectIDBKeyIntoScriptValue):
+        (WebCore::deserializeIDBValueToJSValue):
+        (WebCore::scriptValueToIDBKey):
+        (WebCore::createKeyPathArray):
+        * bindings/js/IDBBindingUtilities.h:
+
</ins><span class="cx"> 2016-06-03  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename CheckedRadioButtons into RadioButtonGroups
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -269,9 +269,16 @@
</span><span class="cx"> 
</span><span class="cx"> void IDBCursor::continueFunction(ScriptExecutionContext&amp; context, JSValue keyValue, ExceptionCodeWithMessage&amp; ec)
</span><span class="cx"> {
</span><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'continue' on 'IDBCursor': Script execution context does not have an execution state.&quot;);
+        return;
+    }
+
</ins><span class="cx">     RefPtr&lt;IDBKey&gt; key;
</span><span class="cx">     if (!keyValue.isUndefined())
</span><del>-        key = scriptValueToIDBKey(context, keyValue);
</del><ins>+        key = scriptValueToIDBKey(*exec, keyValue);
</ins><span class="cx"> 
</span><span class="cx">     continueFunction(key.get(), ec);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -144,11 +144,15 @@
</span><span class="cx"> 
</span><span class="cx"> short IDBFactory::cmp(ScriptExecutionContext&amp; context, JSValue firstValue, JSValue secondValue, ExceptionCodeWithMessage&amp; ec)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; first = scriptValueToIDBKey(context, firstValue);
-    RefPtr&lt;IDBKey&gt; second = scriptValueToIDBKey(context, secondValue);
</del><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'cmp' on 'IDBFactory': Script execution context does not have an execution state.&quot;);
+        return 0;
+    }
</ins><span class="cx"> 
</span><del>-    ASSERT(first);
-    ASSERT(second);
</del><ins>+    Ref&lt;IDBKey&gt; first = scriptValueToIDBKey(*exec, firstValue);
+    Ref&lt;IDBKey&gt; second = scriptValueToIDBKey(*exec, secondValue);
</ins><span class="cx"> 
</span><span class="cx">     if (!first-&gt;isValid() || !second-&gt;isValid()) {
</span><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -160,14 +160,21 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::count&quot;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
-    if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</del><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': Script execution context does not have an execution state.&quot;);
+        return 0;
+    }
+
+    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(*exec, key);
+    if (!idbKey-&gt;isValid()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return doCount(context, IDBKeyRangeData(idbKey.get()), ec);
</del><ins>+    return doCount(context, IDBKeyRangeData(idbKey.ptr()), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBIndex::doCount(ScriptExecutionContext&amp; context, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -244,14 +251,21 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::get&quot;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
-    if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</del><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': Script execution context does not have an execution state.&quot;);
+        return nullptr;
+    }
+
+    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(*exec, key);
+    if (!idbKey-&gt;isValid()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': The parameter is not a valid key.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return doGet(context, IDBKeyRangeData(idbKey.get()), ec);
</del><ins>+    return doGet(context, IDBKeyRangeData(idbKey.ptr()), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBIndex::doGet(ScriptExecutionContext&amp; context, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -290,14 +304,21 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::getKey&quot;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
-    if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</del><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBIndex': Script execution context does not have an execution state.&quot;);
+        return nullptr;
+    }
+
+    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(*exec, key);
+    if (!idbKey-&gt;isValid()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'getKey' on 'IDBIndex': The parameter is not a valid key.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return doGetKey(context, IDBKeyRangeData(idbKey.get()), ec);
</del><ins>+    return doGetKey(context, IDBKeyRangeData(idbKey.ptr()), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBIndex::doGetKey(ScriptExecutionContext&amp; context, const IDBKeyRangeData&amp; range, ExceptionCodeWithMessage&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -51,29 +51,27 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int IDBKey::compare(const IDBKey* other) const
</del><ins>+int IDBKey::compare(const IDBKey&amp; other) const
</ins><span class="cx"> {
</span><del>-    ASSERT(other);
-    if (m_type != other-&gt;m_type)
-        return m_type &gt; other-&gt;m_type ? -1 : 1;
</del><ins>+    if (m_type != other.m_type)
+        return m_type &gt; other.m_type ? -1 : 1;
</ins><span class="cx"> 
</span><span class="cx">     switch (m_type) {
</span><span class="cx">     case KeyType::Array:
</span><del>-        for (size_t i = 0; i &lt; m_array.size() &amp;&amp; i &lt; other-&gt;m_array.size(); ++i) {
-            if (int result = m_array[i]-&gt;compare(other-&gt;m_array[i].get()))
</del><ins>+        for (size_t i = 0; i &lt; m_array.size() &amp;&amp; i &lt; other.m_array.size(); ++i) {
+            if (int result = m_array[i]-&gt;compare(*other.m_array[i]))
</ins><span class="cx">                 return result;
</span><span class="cx">         }
</span><del>-        if (m_array.size() &lt; other-&gt;m_array.size())
</del><ins>+        if (m_array.size() &lt; other.m_array.size())
</ins><span class="cx">             return -1;
</span><del>-        if (m_array.size() &gt; other-&gt;m_array.size())
</del><ins>+        if (m_array.size() &gt; other.m_array.size())
</ins><span class="cx">             return 1;
</span><span class="cx">         return 0;
</span><span class="cx">     case KeyType::String:
</span><del>-        return -codePointCompare(other-&gt;m_string, m_string);
</del><ins>+        return -codePointCompare(other.m_string, m_string);
</ins><span class="cx">     case KeyType::Date:
</span><span class="cx">     case KeyType::Number:
</span><del>-        return (m_number &lt; other-&gt;m_number) ? -1 :
-                (m_number &gt; other-&gt; m_number) ? 1 : 0;
</del><ins>+        return (m_number &lt; other.m_number) ? -1 : ((m_number &gt; other. m_number) ? 1 : 0);
</ins><span class="cx">     case KeyType::Invalid:
</span><span class="cx">     case KeyType::Min:
</span><span class="cx">     case KeyType::Max:
</span><span class="lines">@@ -85,17 +83,13 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool IDBKey::isLessThan(const IDBKey* other) const
</del><ins>+bool IDBKey::isLessThan(const IDBKey&amp; other) const
</ins><span class="cx"> {
</span><del>-    ASSERT(other);
</del><span class="cx">     return compare(other) == -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool IDBKey::isEqual(const IDBKey* other) const
</del><ins>+bool IDBKey::isEqual(const IDBKey&amp; other) const
</ins><span class="cx"> {
</span><del>-    if (!other)
-        return false;
-
</del><span class="cx">     return !compare(other);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.h (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.h        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.h        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx">             bool skip = false;
</span><span class="cx">             for (auto&amp; resultKey : result) {
</span><del>-                if (key-&gt;isEqual(resultKey.get())) {
</del><ins>+                if (key-&gt;isEqual(*resultKey)) {
</ins><span class="cx">                     skip = true;
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="lines">@@ -124,9 +124,9 @@
</span><span class="cx">         return m_number;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    int compare(const IDBKey* other) const;
-    bool isLessThan(const IDBKey* other) const;
-    bool isEqual(const IDBKey* other) const;
</del><ins>+    int compare(const IDBKey&amp; other) const;
+    bool isLessThan(const IDBKey&amp; other) const;
+    bool isEqual(const IDBKey&amp; other) const;
</ins><span class="cx"> 
</span><span class="cx">     size_t sizeEstimate() const { return m_sizeEstimate; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBKey.h&quot;
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><ins>+#include &quot;ScriptExecutionContext.h&quot;
</ins><span class="cx"> #include &lt;runtime/JSCJSValue.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -78,13 +79,17 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::only(ScriptExecutionContext&amp; context, JSValue keyValue, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    return only(scriptValueToIDBKey(context, keyValue), ec);
</del><ins>+    auto exec = context.execState();
+    if (!exec)
+        return nullptr;
+
+    return only(scriptValueToIDBKey(*exec, keyValue), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::lowerBound(ExecState&amp; state, JSValue boundValue, bool open, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     auto bound = scriptValueToIDBKey(state, boundValue);
</span><del>-    if (!bound || !bound-&gt;isValid()) {
</del><ins>+    if (!bound-&gt;isValid()) {
</ins><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -95,7 +100,7 @@
</span><span class="cx"> RefPtr&lt;IDBKeyRange&gt; IDBKeyRange::upperBound(ExecState&amp; state, JSValue boundValue, bool open, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     auto bound = scriptValueToIDBKey(state, boundValue);
</span><del>-    if (!bound || !bound-&gt;isValid()) {
</del><ins>+    if (!bound-&gt;isValid()) {
</ins><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -108,7 +113,7 @@
</span><span class="cx">     auto lower = scriptValueToIDBKey(state, lowerValue);
</span><span class="cx">     auto upper = scriptValueToIDBKey(state, upperValue);
</span><span class="cx"> 
</span><del>-    if (!lower || !lower-&gt;isValid() || !upper || !upper-&gt;isValid()) {
</del><ins>+    if (!lower-&gt;isValid() || !upper-&gt;isValid()) {
</ins><span class="cx">         ec = IDBDatabaseException::DataError;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -126,7 +131,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool IDBKeyRange::isOnlyKey() const
</span><span class="cx"> {
</span><del>-    return m_lower &amp;&amp; m_upper &amp;&amp; !m_isLowerOpen &amp;&amp; !m_isUpperOpen &amp;&amp; m_lower-&gt;isEqual(m_upper.get());
</del><ins>+    return m_lower &amp;&amp; m_upper &amp;&amp; !m_isLowerOpen &amp;&amp; !m_isUpperOpen &amp;&amp; m_lower-&gt;isEqual(*m_upper);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -165,6 +165,13 @@
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::get&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': Script execution context does not have an execution state.&quot;);
+        return nullptr;
+    }
+
</ins><span class="cx">     if (!m_transaction-&gt;isActive()) {
</span><span class="cx">         ec.code = IDBDatabaseException::TransactionInactiveError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.&quot;);
</span><span class="lines">@@ -177,14 +184,14 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
-    if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</del><ins>+    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(*exec, key);
+    if (!idbKey-&gt;isValid()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestGetRecord(context, *this, idbKey.get());
</del><ins>+    return m_transaction-&gt;requestGetRecord(context, *this, idbKey.ptr());
</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">@@ -389,14 +396,21 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::modernDelete(ScriptExecutionContext&amp; context, JSValue key, ExceptionCodeWithMessage&amp; ec)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
-    if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</del><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': Script execution context does not have an execution state.&quot;);
+        return nullptr;
+    }
+
+    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(*exec, key);
+    if (!idbKey-&gt;isValid()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return doDelete(context, &amp;IDBKeyRange::create(idbKey.releaseNonNull()).get(), ec);
</del><ins>+    return doDelete(context, &amp;IDBKeyRange::create(WTFMove(idbKey)).get(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::clear(ScriptExecutionContext&amp; context, ExceptionCodeWithMessage&amp; ec)
</span><span class="lines">@@ -580,14 +594,21 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::count&quot;);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(context, key);
-    if (!idbKey || idbKey-&gt;type() == KeyType::Invalid) {
</del><ins>+    auto exec = context.execState();
+    if (!exec) {
+        ec.code = IDBDatabaseException::UnknownError;
+        ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': Script execution context does not have an execution state.&quot;);
+        return nullptr;
+    }
+
+    Ref&lt;IDBKey&gt; idbKey = scriptValueToIDBKey(*exec, key);
+    if (!idbKey-&gt;isValid()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::DataError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return doCount(context, IDBKeyRangeData(idbKey.get()), ec);
</del><ins>+    return doCount(context, IDBKeyRangeData(idbKey.ptr()), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::count(ScriptExecutionContext&amp; context, IDBKeyRange* range, ExceptionCodeWithMessage&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -50,18 +50,18 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static bool get(ExecState* exec, JSValue object, const String&amp; keyPathElement, JSValue&amp; result)
</del><ins>+static bool get(ExecState&amp; exec, JSValue object, const String&amp; keyPathElement, JSValue&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     if (object.isString() &amp;&amp; keyPathElement == &quot;length&quot;) {
</span><del>-        result = jsNumber(object.toString(exec)-&gt;length());
</del><ins>+        result = jsNumber(object.toString(&amp;exec)-&gt;length());
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (!object.isObject())
</span><span class="cx">         return false;
</span><del>-    Identifier identifier = Identifier::fromString(&amp;exec-&gt;vm(), keyPathElement);
-    if (!asObject(object)-&gt;hasProperty(exec, identifier))
</del><ins>+    Identifier identifier = Identifier::fromString(&amp;exec.vm(), keyPathElement);
+    if (!asObject(object)-&gt;hasProperty(&amp;exec, identifier))
</ins><span class="cx">         return false;
</span><del>-    result = asObject(object)-&gt;get(exec, identifier);
</del><ins>+    result = asObject(object)-&gt;get(&amp;exec, identifier);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -71,12 +71,12 @@
</span><span class="cx">     return object.isObject();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool set(ExecState* exec, JSValue&amp; object, const String&amp; keyPathElement, JSValue jsValue)
</del><ins>+static bool set(ExecState&amp; exec, JSValue&amp; object, const String&amp; keyPathElement, JSValue jsValue)
</ins><span class="cx"> {
</span><span class="cx">     if (!canSet(object, keyPathElement))
</span><span class="cx">         return false;
</span><del>-    Identifier identifier = Identifier::fromString(&amp;exec-&gt;vm(), keyPathElement);
-    asObject(object)-&gt;putDirect(exec-&gt;vm(), identifier, jsValue);
</del><ins>+    Identifier identifier = Identifier::fromString(&amp;exec.vm(), keyPathElement);
+    asObject(object)-&gt;putDirect(exec.vm(), identifier, jsValue);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -118,14 +118,17 @@
</span><span class="cx"> 
</span><span class="cx"> static const size_t maximumDepth = 2000;
</span><span class="cx"> 
</span><del>-static RefPtr&lt;IDBKey&gt; createIDBKeyFromValue(ExecState* exec, JSValue value, Vector&lt;JSArray*&gt;&amp; stack)
</del><ins>+static RefPtr&lt;IDBKey&gt; createIDBKeyFromValue(ExecState&amp; exec, JSValue value, Vector&lt;JSArray*&gt;&amp; stack)
</ins><span class="cx"> {
</span><del>-    if (value.isNumber() &amp;&amp; !std::isnan(value.toNumber(exec)))
-        return IDBKey::createNumber(value.toNumber(exec));
</del><ins>+    if (value.isNumber() &amp;&amp; !std::isnan(value.toNumber(&amp;exec)))
+        return IDBKey::createNumber(value.toNumber(&amp;exec));
+
</ins><span class="cx">     if (value.isString())
</span><del>-        return IDBKey::createString(value.toString(exec)-&gt;value(exec));
-    if (value.inherits(DateInstance::info()) &amp;&amp; !std::isnan(valueToDate(exec, value)))
-        return IDBKey::createDate(valueToDate(exec, value));
</del><ins>+        return IDBKey::createString(value.toString(&amp;exec)-&gt;value(&amp;exec));
+
+    if (value.inherits(DateInstance::info()) &amp;&amp; !std::isnan(valueToDate(&amp;exec, value)))
+        return IDBKey::createDate(valueToDate(&amp;exec, value));
+
</ins><span class="cx">     if (value.isObject()) {
</span><span class="cx">         JSObject* object = asObject(value);
</span><span class="cx">         if (isJSArray(object) || object-&gt;inherits(JSArray::info())) {
</span><span class="lines">@@ -134,13 +137,15 @@
</span><span class="cx"> 
</span><span class="cx">             if (stack.contains(array))
</span><span class="cx">                 return nullptr;
</span><ins>+
</ins><span class="cx">             if (stack.size() &gt;= maximumDepth)
</span><span class="cx">                 return nullptr;
</span><ins>+
</ins><span class="cx">             stack.append(array);
</span><span class="cx"> 
</span><span class="cx">             Vector&lt;RefPtr&lt;IDBKey&gt;&gt; subkeys;
</span><span class="cx">             for (size_t i = 0; i &lt; length; i++) {
</span><del>-                JSValue item = array-&gt;getIndex(exec, i);
</del><ins>+                JSValue item = array-&gt;getIndex(&amp;exec, i);
</ins><span class="cx">                 RefPtr&lt;IDBKey&gt; subkey = createIDBKeyFromValue(exec, item, stack);
</span><span class="cx">                 if (!subkey)
</span><span class="cx">                     subkeys.append(IDBKey::createInvalid());
</span><span class="lines">@@ -155,12 +160,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;IDBKey&gt; createIDBKeyFromValue(ExecState* exec, JSValue value)
</del><ins>+static Ref&lt;IDBKey&gt; createIDBKeyFromValue(ExecState&amp; exec, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;JSArray*&gt; stack;
</span><span class="cx">     RefPtr&lt;IDBKey&gt; key = createIDBKeyFromValue(exec, value, stack);
</span><span class="cx">     if (key)
</span><del>-        return key;
</del><ins>+        return *key;
</ins><span class="cx">     return IDBKey::createInvalid();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -174,7 +179,7 @@
</span><span class="cx">     return keyPath;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSValue getNthValueOnKeyPath(ExecState* exec, JSValue rootValue, const Vector&lt;String&gt;&amp; keyPathElements, size_t index)
</del><ins>+static JSValue getNthValueOnKeyPath(ExecState&amp; exec, JSValue rootValue, const Vector&lt;String&gt;&amp; keyPathElements, size_t index)
</ins><span class="cx"> {
</span><span class="cx">     JSValue currentValue(rootValue);
</span><span class="cx">     ASSERT(index &lt;= keyPathElements.size());
</span><span class="lines">@@ -186,7 +191,7 @@
</span><span class="cx">     return currentValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;IDBKey&gt; internalCreateIDBKeyFromScriptValueAndKeyPath(ExecState* exec, const JSValue&amp; value, const String&amp; keyPath)
</del><ins>+static RefPtr&lt;IDBKey&gt; internalCreateIDBKeyFromScriptValueAndKeyPath(ExecState&amp; exec, const JSValue&amp; value, const String&amp; keyPath)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;String&gt; keyPathElements;
</span><span class="cx">     IDBKeyPathParseError error;
</span><span class="lines">@@ -200,7 +205,7 @@
</span><span class="cx">     return createIDBKeyFromValue(exec, jsValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSValue ensureNthValueOnKeyPath(ExecState* exec, JSValue rootValue, const Vector&lt;String&gt;&amp; keyPathElements, size_t index)
</del><ins>+static JSValue ensureNthValueOnKeyPath(ExecState&amp; exec, JSValue rootValue, const Vector&lt;String&gt;&amp; keyPathElements, size_t index)
</ins><span class="cx"> {
</span><span class="cx">     JSValue currentValue(rootValue);
</span><span class="cx"> 
</span><span class="lines">@@ -209,7 +214,7 @@
</span><span class="cx">         JSValue parentValue(currentValue);
</span><span class="cx">         const String&amp; keyPathElement = keyPathElements[i];
</span><span class="cx">         if (!get(exec, parentValue, keyPathElement, currentValue)) {
</span><del>-            JSObject* object = constructEmptyObject(exec);
</del><ins>+            JSObject* object = constructEmptyObject(&amp;exec);
</ins><span class="cx">             if (!set(exec, parentValue, keyPathElement, JSValue(object)))
</span><span class="cx">                 return jsUndefined();
</span><span class="cx">             currentValue = JSValue(object);
</span><span class="lines">@@ -219,7 +224,7 @@
</span><span class="cx">     return currentValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool canInjectNthValueOnKeyPath(ExecState* exec, JSValue rootValue, const Vector&lt;String&gt;&amp; keyPathElements, size_t index)
</del><ins>+static bool canInjectNthValueOnKeyPath(ExecState&amp; exec, JSValue rootValue, const Vector&lt;String&gt;&amp; keyPathElements, size_t index)
</ins><span class="cx"> {
</span><span class="cx">     if (!rootValue.isObject())
</span><span class="cx">         return false;
</span><span class="lines">@@ -250,7 +255,7 @@
</span><span class="cx">     if (keyPathElements.isEmpty())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    JSValue parent = ensureNthValueOnKeyPath(&amp;exec, value, keyPathElements, keyPathElements.size() - 1);
</del><ins>+    JSValue parent = ensureNthValueOnKeyPath(exec, value, keyPathElements, keyPathElements.size() - 1);
</ins><span class="cx">     if (parent.isUndefined())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -258,7 +263,7 @@
</span><span class="cx">     if (!key)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!set(&amp;exec, parent, keyPathElements.last(), toJS(exec, *exec.lexicalGlobalObject(), key.get())))
</del><ins>+    if (!set(exec, parent, keyPathElements.last(), toJS(exec, *exec.lexicalGlobalObject(), key.get())))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -274,7 +279,7 @@
</span><span class="cx">         Vector&lt;RefPtr&lt;IDBKey&gt;&gt; result;
</span><span class="cx">         result.reserveInitialCapacity(array.size());
</span><span class="cx">         for (auto&amp; string : array) {
</span><del>-            RefPtr&lt;IDBKey&gt; key = internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, string);
</del><ins>+            RefPtr&lt;IDBKey&gt; key = internalCreateIDBKeyFromScriptValueAndKeyPath(exec, value, string);
</ins><span class="cx">             if (!key)
</span><span class="cx">                 return nullptr;
</span><span class="cx">             result.uncheckedAppend(WTFMove(key));
</span><span class="lines">@@ -283,10 +288,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(keyPath.type() == IDBKeyPath::Type::String);
</span><del>-    return internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, keyPath.string());
</del><ins>+    return internalCreateIDBKeyFromScriptValueAndKeyPath(exec, value, keyPath.string());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool canInjectIDBKeyIntoScriptValue(ExecState&amp; execState, const JSValue&amp; scriptValue, const IDBKeyPath&amp; keyPath)
</del><ins>+bool canInjectIDBKeyIntoScriptValue(ExecState&amp; exec, const JSValue&amp; scriptValue, const IDBKeyPath&amp; keyPath)
</ins><span class="cx"> {
</span><span class="cx">     LOG(StorageAPI, &quot;canInjectIDBKeyIntoScriptValue&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -299,11 +304,11 @@
</span><span class="cx">     if (!keyPathElements.size())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return canInjectNthValueOnKeyPath(&amp;execState, scriptValue, keyPathElements, keyPathElements.size() - 1);
</del><ins>+    return canInjectNthValueOnKeyPath(exec, scriptValue, keyPathElements, keyPathElements.size() - 1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-static JSValue deserializeIDBValueToJSValue(ExecState&amp; state, const IDBValue&amp; value)
</del><ins>+static JSValue deserializeIDBValueToJSValue(ExecState&amp; exec, const IDBValue&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: I think it's peculiar to use undefined to mean &quot;null data&quot; and null to mean &quot;empty data&quot;.
</span><span class="cx">     // But I am not changing this at the moment because at least some callers are specifically checking isUndefined.
</span><span class="lines">@@ -317,9 +322,9 @@
</span><span class="cx"> 
</span><span class="cx">     auto serializedValue = SerializedScriptValue::createFromWireBytes(Vector&lt;uint8_t&gt;(data));
</span><span class="cx"> 
</span><del>-    state.vm().apiLock().lock();
-    JSValue result = serializedValue-&gt;deserialize(&amp;state, state.lexicalGlobalObject(), 0, NonThrowing, value.blobURLs(), value.blobFilePaths());
-    state.vm().apiLock().unlock();
</del><ins>+    exec.vm().apiLock().lock();
+    JSValue result = serializedValue-&gt;deserialize(&amp;exec, exec.lexicalGlobalObject(), 0, NonThrowing, value.blobURLs(), value.blobFilePaths());
+    exec.vm().apiLock().unlock();
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -328,11 +333,11 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: I think it's peculiar to return an empty JSValue, undefined, and null for three different error cases.
</span><span class="cx"> 
</span><del>-    auto* execState = context.execState();
-    if (!execState)
</del><ins>+    auto* exec = context.execState();
+    if (!exec)
</ins><span class="cx">         return { };
</span><span class="cx"> 
</span><del>-    return deserializeIDBValueToJSValue(*execState, value);
</del><ins>+    return deserializeIDBValueToJSValue(*exec, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue deserializeIDBValueDataToJSValue(ExecState&amp; exec, const ThreadSafeDataBuffer&amp; valueData)
</span><span class="lines">@@ -340,17 +345,11 @@
</span><span class="cx">     return deserializeIDBValueToJSValue(exec, IDBValue(valueData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKey&gt; scriptValueToIDBKey(ExecState&amp; exec, const JSValue&amp; scriptValue)
</del><ins>+Ref&lt;IDBKey&gt; scriptValueToIDBKey(ExecState&amp; exec, const JSValue&amp; scriptValue)
</ins><span class="cx"> {
</span><del>-    return createIDBKeyFromValue(&amp;exec, scriptValue);
</del><ins>+    return createIDBKeyFromValue(exec, scriptValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKey&gt; scriptValueToIDBKey(ScriptExecutionContext&amp; context, const JSValue&amp; scriptValue)
-{
-    auto* execState = context.execState();
-    return execState ? scriptValueToIDBKey(*execState, scriptValue) : nullptr;
-}
-
</del><span class="cx"> JSC::JSValue idbKeyDataToScriptValue(ScriptExecutionContext&amp; context, const IDBKeyData&amp; keyData)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;IDBKey&gt; key = keyData.maybeCreateIDBKey();
</span><span class="lines">@@ -369,14 +368,14 @@
</span><span class="cx">     switch (info.keyPath().type()) {
</span><span class="cx">     case IDBKeyPath::Type::Array:
</span><span class="cx">         for (auto&amp; entry : info.keyPath().array()) {
</span><del>-            auto key = internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, entry);
</del><ins>+            auto key = internalCreateIDBKeyFromScriptValueAndKeyPath(exec, value, entry);
</ins><span class="cx">             if (!key)
</span><span class="cx">                 return { };
</span><span class="cx">             keys.append(key.get());
</span><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx">     case IDBKeyPath::Type::String: {
</span><del>-        auto idbKey = internalCreateIDBKeyFromScriptValueAndKeyPath(&amp;exec, value, info.keyPath().string());
</del><ins>+        auto idbKey = internalCreateIDBKeyFromScriptValueAndKeyPath(exec, value, info.keyPath().string());
</ins><span class="cx">         if (!idbKey)
</span><span class="cx">             return { };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (201659 => 201660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2016-06-03 21:36:51 UTC (rev 201659)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2016-06-03 21:42:03 UTC (rev 201660)
</span><span class="lines">@@ -62,8 +62,7 @@
</span><span class="cx"> JSC::JSValue deserializeIDBValueToJSValue(ScriptExecutionContext&amp;, const IDBValue&amp;);
</span><span class="cx"> JSC::JSValue deserializeIDBValueDataToJSValue(JSC::ExecState&amp;, const ThreadSafeDataBuffer&amp; valueData);
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBKey&gt; scriptValueToIDBKey(ScriptExecutionContext&amp;, const JSC::JSValue&amp;);
-RefPtr&lt;IDBKey&gt; scriptValueToIDBKey(JSC::ExecState&amp;, const JSC::JSValue&amp;);
</del><ins>+Ref&lt;IDBKey&gt; scriptValueToIDBKey(JSC::ExecState&amp;, const JSC::JSValue&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>