<!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<IDBKey> instead of RefPtr<IDBKey>, 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 <beidson@apple.com>
+
+ 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<IDBKey> instead of RefPtr<IDBKey>, 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 <benjamin@webkit.org>
</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& context, JSValue keyValue, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': Script execution context does not have an execution state.");
+ return;
+ }
+
</ins><span class="cx"> RefPtr<IDBKey> 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& context, JSValue firstValue, JSValue secondValue, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><del>- RefPtr<IDBKey> first = scriptValueToIDBKey(context, firstValue);
- RefPtr<IDBKey> second = scriptValueToIDBKey(context, secondValue);
</del><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'cmp' on 'IDBFactory': Script execution context does not have an execution state.");
+ return 0;
+ }
</ins><span class="cx">
</span><del>- ASSERT(first);
- ASSERT(second);
</del><ins>+ Ref<IDBKey> first = scriptValueToIDBKey(*exec, firstValue);
+ Ref<IDBKey> second = scriptValueToIDBKey(*exec, secondValue);
</ins><span class="cx">
</span><span class="cx"> if (!first->isValid() || !second->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, "IDBIndex::count");
</span><span class="cx">
</span><del>- RefPtr<IDBKey> idbKey = scriptValueToIDBKey(context, key);
- if (!idbKey || idbKey->type() == KeyType::Invalid) {
</del><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBIndex': Script execution context does not have an execution state.");
+ return 0;
+ }
+
+ Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key);
+ if (!idbKey->isValid()) {
</ins><span class="cx"> ec.code = IDBDatabaseException::DataError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key.");
</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<IDBRequest> IDBIndex::doCount(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
</span><span class="lines">@@ -244,14 +251,21 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::get");
</span><span class="cx">
</span><del>- RefPtr<IDBKey> idbKey = scriptValueToIDBKey(context, key);
- if (!idbKey || idbKey->type() == KeyType::Invalid) {
</del><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBIndex': Script execution context does not have an execution state.");
+ return nullptr;
+ }
+
+ Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key);
+ if (!idbKey->isValid()) {
</ins><span class="cx"> ec.code = IDBDatabaseException::DataError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBIndex': The parameter is not a valid key.");
</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<IDBRequest> IDBIndex::doGet(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
</span><span class="lines">@@ -290,14 +304,21 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::getKey");
</span><span class="cx">
</span><del>- RefPtr<IDBKey> idbKey = scriptValueToIDBKey(context, key);
- if (!idbKey || idbKey->type() == KeyType::Invalid) {
</del><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBIndex': Script execution context does not have an execution state.");
+ return nullptr;
+ }
+
+ Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key);
+ if (!idbKey->isValid()) {
</ins><span class="cx"> ec.code = IDBDatabaseException::DataError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'getKey' on 'IDBIndex': The parameter is not a valid key.");
</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<IDBRequest> IDBIndex::doGetKey(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& 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& other) const
</ins><span class="cx"> {
</span><del>- ASSERT(other);
- if (m_type != other->m_type)
- return m_type > other->m_type ? -1 : 1;
</del><ins>+ if (m_type != other.m_type)
+ return m_type > 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 < m_array.size() && i < other->m_array.size(); ++i) {
- if (int result = m_array[i]->compare(other->m_array[i].get()))
</del><ins>+ for (size_t i = 0; i < m_array.size() && i < other.m_array.size(); ++i) {
+ if (int result = m_array[i]->compare(*other.m_array[i]))
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><del>- if (m_array.size() < other->m_array.size())
</del><ins>+ if (m_array.size() < other.m_array.size())
</ins><span class="cx"> return -1;
</span><del>- if (m_array.size() > other->m_array.size())
</del><ins>+ if (m_array.size() > 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->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 < other->m_number) ? -1 :
- (m_number > other-> m_number) ? 1 : 0;
</del><ins>+ return (m_number < other.m_number) ? -1 : ((m_number > 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& 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& 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& resultKey : result) {
</span><del>- if (key->isEqual(resultKey.get())) {
</del><ins>+ if (key->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& other) const;
+ bool isLessThan(const IDBKey& other) const;
+ bool isEqual(const IDBKey& 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 "IDBDatabaseException.h"
</span><span class="cx"> #include "IDBKey.h"
</span><span class="cx"> #include "IDBKeyData.h"
</span><ins>+#include "ScriptExecutionContext.h"
</ins><span class="cx"> #include <runtime/JSCJSValue.h>
</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<IDBKeyRange> IDBKeyRange::only(ScriptExecutionContext& context, JSValue keyValue, ExceptionCode& 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<IDBKeyRange> IDBKeyRange::lowerBound(ExecState& state, JSValue boundValue, bool open, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> auto bound = scriptValueToIDBKey(state, boundValue);
</span><del>- if (!bound || !bound->isValid()) {
</del><ins>+ if (!bound->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<IDBKeyRange> IDBKeyRange::upperBound(ExecState& state, JSValue boundValue, bool open, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> auto bound = scriptValueToIDBKey(state, boundValue);
</span><del>- if (!bound || !bound->isValid()) {
</del><ins>+ if (!bound->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->isValid() || !upper || !upper->isValid()) {
</del><ins>+ if (!lower->isValid() || !upper->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 && m_upper && !m_isLowerOpen && !m_isUpperOpen && m_lower->isEqual(m_upper.get());
</del><ins>+ return m_lower && m_upper && !m_isLowerOpen && !m_isUpperOpen && m_lower->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, "IDBObjectStore::get");
</span><span class="cx"> ASSERT(currentThread() == m_transaction->database().originThreadID());
</span><span class="cx">
</span><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': Script execution context does not have an execution state.");
+ return nullptr;
+ }
+
</ins><span class="cx"> if (!m_transaction->isActive()) {
</span><span class="cx"> ec.code = IDBDatabaseException::TransactionInactiveError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.");
</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<IDBKey> idbKey = scriptValueToIDBKey(context, key);
- if (!idbKey || idbKey->type() == KeyType::Invalid) {
</del><ins>+ Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key);
+ if (!idbKey->isValid()) {
</ins><span class="cx"> ec.code = IDBDatabaseException::DataError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.");
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return m_transaction->requestGetRecord(context, *this, idbKey.get());
</del><ins>+ return m_transaction->requestGetRecord(context, *this, idbKey.ptr());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext& context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
</span><span class="lines">@@ -389,14 +396,21 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::modernDelete(ScriptExecutionContext& context, JSValue key, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><del>- RefPtr<IDBKey> idbKey = scriptValueToIDBKey(context, key);
- if (!idbKey || idbKey->type() == KeyType::Invalid) {
</del><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'delete' on 'IDBObjectStore': Script execution context does not have an execution state.");
+ return nullptr;
+ }
+
+ Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key);
+ if (!idbKey->isValid()) {
</ins><span class="cx"> ec.code = IDBDatabaseException::DataError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key.");
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return doDelete(context, &IDBKeyRange::create(idbKey.releaseNonNull()).get(), ec);
</del><ins>+ return doDelete(context, &IDBKeyRange::create(WTFMove(idbKey)).get(), ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::clear(ScriptExecutionContext& context, ExceptionCodeWithMessage& ec)
</span><span class="lines">@@ -580,14 +594,21 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::count");
</span><span class="cx">
</span><del>- RefPtr<IDBKey> idbKey = scriptValueToIDBKey(context, key);
- if (!idbKey || idbKey->type() == KeyType::Invalid) {
</del><ins>+ auto exec = context.execState();
+ if (!exec) {
+ ec.code = IDBDatabaseException::UnknownError;
+ ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBObjectStore': Script execution context does not have an execution state.");
+ return nullptr;
+ }
+
+ Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key);
+ if (!idbKey->isValid()) {
</ins><span class="cx"> ec.code = IDBDatabaseException::DataError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.");
</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<IDBRequest> IDBObjectStore::count(ScriptExecutionContext& context, IDBKeyRange* range, ExceptionCodeWithMessage& 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& keyPathElement, JSValue& result)
</del><ins>+static bool get(ExecState& exec, JSValue object, const String& keyPathElement, JSValue& result)
</ins><span class="cx"> {
</span><span class="cx"> if (object.isString() && keyPathElement == "length") {
</span><del>- result = jsNumber(object.toString(exec)->length());
</del><ins>+ result = jsNumber(object.toString(&exec)->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(&exec->vm(), keyPathElement);
- if (!asObject(object)->hasProperty(exec, identifier))
</del><ins>+ Identifier identifier = Identifier::fromString(&exec.vm(), keyPathElement);
+ if (!asObject(object)->hasProperty(&exec, identifier))
</ins><span class="cx"> return false;
</span><del>- result = asObject(object)->get(exec, identifier);
</del><ins>+ result = asObject(object)->get(&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& object, const String& keyPathElement, JSValue jsValue)
</del><ins>+static bool set(ExecState& exec, JSValue& object, const String& 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(&exec->vm(), keyPathElement);
- asObject(object)->putDirect(exec->vm(), identifier, jsValue);
</del><ins>+ Identifier identifier = Identifier::fromString(&exec.vm(), keyPathElement);
+ asObject(object)->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<IDBKey> createIDBKeyFromValue(ExecState* exec, JSValue value, Vector<JSArray*>& stack)
</del><ins>+static RefPtr<IDBKey> createIDBKeyFromValue(ExecState& exec, JSValue value, Vector<JSArray*>& stack)
</ins><span class="cx"> {
</span><del>- if (value.isNumber() && !std::isnan(value.toNumber(exec)))
- return IDBKey::createNumber(value.toNumber(exec));
</del><ins>+ if (value.isNumber() && !std::isnan(value.toNumber(&exec)))
+ return IDBKey::createNumber(value.toNumber(&exec));
+
</ins><span class="cx"> if (value.isString())
</span><del>- return IDBKey::createString(value.toString(exec)->value(exec));
- if (value.inherits(DateInstance::info()) && !std::isnan(valueToDate(exec, value)))
- return IDBKey::createDate(valueToDate(exec, value));
</del><ins>+ return IDBKey::createString(value.toString(&exec)->value(&exec));
+
+ if (value.inherits(DateInstance::info()) && !std::isnan(valueToDate(&exec, value)))
+ return IDBKey::createDate(valueToDate(&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->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() >= 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<RefPtr<IDBKey>> subkeys;
</span><span class="cx"> for (size_t i = 0; i < length; i++) {
</span><del>- JSValue item = array->getIndex(exec, i);
</del><ins>+ JSValue item = array->getIndex(&exec, i);
</ins><span class="cx"> RefPtr<IDBKey> 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<IDBKey> createIDBKeyFromValue(ExecState* exec, JSValue value)
</del><ins>+static Ref<IDBKey> createIDBKeyFromValue(ExecState& exec, JSValue value)
</ins><span class="cx"> {
</span><span class="cx"> Vector<JSArray*> stack;
</span><span class="cx"> RefPtr<IDBKey> 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<String>& keyPathElements, size_t index)
</del><ins>+static JSValue getNthValueOnKeyPath(ExecState& exec, JSValue rootValue, const Vector<String>& keyPathElements, size_t index)
</ins><span class="cx"> {
</span><span class="cx"> JSValue currentValue(rootValue);
</span><span class="cx"> ASSERT(index <= 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<IDBKey> internalCreateIDBKeyFromScriptValueAndKeyPath(ExecState* exec, const JSValue& value, const String& keyPath)
</del><ins>+static RefPtr<IDBKey> internalCreateIDBKeyFromScriptValueAndKeyPath(ExecState& exec, const JSValue& value, const String& keyPath)
</ins><span class="cx"> {
</span><span class="cx"> Vector<String> 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<String>& keyPathElements, size_t index)
</del><ins>+static JSValue ensureNthValueOnKeyPath(ExecState& exec, JSValue rootValue, const Vector<String>& 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& keyPathElement = keyPathElements[i];
</span><span class="cx"> if (!get(exec, parentValue, keyPathElement, currentValue)) {
</span><del>- JSObject* object = constructEmptyObject(exec);
</del><ins>+ JSObject* object = constructEmptyObject(&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<String>& keyPathElements, size_t index)
</del><ins>+static bool canInjectNthValueOnKeyPath(ExecState& exec, JSValue rootValue, const Vector<String>& 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(&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(&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<RefPtr<IDBKey>> result;
</span><span class="cx"> result.reserveInitialCapacity(array.size());
</span><span class="cx"> for (auto& string : array) {
</span><del>- RefPtr<IDBKey> key = internalCreateIDBKeyFromScriptValueAndKeyPath(&exec, value, string);
</del><ins>+ RefPtr<IDBKey> 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(&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& execState, const JSValue& scriptValue, const IDBKeyPath& keyPath)
</del><ins>+bool canInjectIDBKeyIntoScriptValue(ExecState& exec, const JSValue& scriptValue, const IDBKeyPath& keyPath)
</ins><span class="cx"> {
</span><span class="cx"> LOG(StorageAPI, "canInjectIDBKeyIntoScriptValue");
</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(&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& state, const IDBValue& value)
</del><ins>+static JSValue deserializeIDBValueToJSValue(ExecState& exec, const IDBValue& value)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: I think it's peculiar to use undefined to mean "null data" and null to mean "empty data".
</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<uint8_t>(data));
</span><span class="cx">
</span><del>- state.vm().apiLock().lock();
- JSValue result = serializedValue->deserialize(&state, state.lexicalGlobalObject(), 0, NonThrowing, value.blobURLs(), value.blobFilePaths());
- state.vm().apiLock().unlock();
</del><ins>+ exec.vm().apiLock().lock();
+ JSValue result = serializedValue->deserialize(&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& exec, const ThreadSafeDataBuffer& 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<IDBKey> scriptValueToIDBKey(ExecState& exec, const JSValue& scriptValue)
</del><ins>+Ref<IDBKey> scriptValueToIDBKey(ExecState& exec, const JSValue& scriptValue)
</ins><span class="cx"> {
</span><del>- return createIDBKeyFromValue(&exec, scriptValue);
</del><ins>+ return createIDBKeyFromValue(exec, scriptValue);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBKey> scriptValueToIDBKey(ScriptExecutionContext& context, const JSValue& scriptValue)
-{
- auto* execState = context.execState();
- return execState ? scriptValueToIDBKey(*execState, scriptValue) : nullptr;
-}
-
</del><span class="cx"> JSC::JSValue idbKeyDataToScriptValue(ScriptExecutionContext& context, const IDBKeyData& keyData)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<IDBKey> 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& entry : info.keyPath().array()) {
</span><del>- auto key = internalCreateIDBKeyFromScriptValueAndKeyPath(&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(&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&, const IDBValue&);
</span><span class="cx"> JSC::JSValue deserializeIDBValueDataToJSValue(JSC::ExecState&, const ThreadSafeDataBuffer& valueData);
</span><span class="cx">
</span><del>-RefPtr<IDBKey> scriptValueToIDBKey(ScriptExecutionContext&, const JSC::JSValue&);
-RefPtr<IDBKey> scriptValueToIDBKey(JSC::ExecState&, const JSC::JSValue&);
</del><ins>+Ref<IDBKey> scriptValueToIDBKey(JSC::ExecState&, const JSC::JSValue&);
</ins><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>