<!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>[210134] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/210134">210134</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-12-23 09:09:04 -0800 (Fri, 23 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebIDL] Remove custom bindings for WebSQL code
https://bugs.webkit.org/show_bug.cgi?id=166441
Reviewed by Darin Adler.
Source/WebCore:
- Replace custom variant type SQLValue with a type alias of a Variant.
- Use the newly representable SQLValue to remove custom bindings for
SQLResultSetRowList::item and SQLTransaction::executeSql.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSSQLResultSetRowListCustom.cpp: Removed.
* bindings/js/JSSQLTransactionCustom.cpp: Removed.
* platform/sql/SQLValue.cpp: Removed.
Remove files.
* Modules/webdatabase/SQLResultSetRowList.cpp:
(WebCore::SQLResultSetRowList::length):
(WebCore::SQLResultSetRowList::item):
* Modules/webdatabase/SQLResultSetRowList.h:
* Modules/webdatabase/SQLResultSetRowList.idl:
Sink the implementation of item() into the implementation. Use a
record type to bridge to javascript.
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::SQLStatement):
* Modules/webdatabase/SQLStatement.h:
Update to take arguments by rvalue reference.
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::executeSql):
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransaction.idl:
Remove custom annotation, and update signature to match the IDL.
* Modules/webdatabase/SQLTransactionBackend.cpp:
* Modules/webdatabase/SQLTransactionBackend.h:
Remove unneeded #includes of SQLValue.h
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLNull>::convert):
(WebCore::JSConverter<IDLNull>::convert):
Implement conversion for the null type so it can be used in the SQLValue union.
* inspector/InspectorDatabaseAgent.cpp:
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::bindValue):
(WebCore::SQLiteStatement::getColumnValue):
* platform/sql/SQLiteStatement.h:
Replace old switch with a WTF::switchOn that operates on the new variant.
* platform/sql/SQLValue.h:
(WebCore::SQLValue::SQLValue): Deleted.
(WebCore::SQLValue::type): Deleted.
Replace implementation with a Variant.
LayoutTests:
* storage/websql/execute-sql-args-expected.txt:
* storage/websql/execute-sql-args.js:
Update test and result to be slightly more strict about functions taking sequences.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstoragewebsqlexecutesqlargsexpectedtxt">trunk/LayoutTests/storage/websql/execute-sql-args-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstoragewebsqlexecutesqlargsjs">trunk/LayoutTests/storage/websql/execute-sql-args.js</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLResultSetRowListcpp">trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLResultSetRowListh">trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLResultSetRowListidl">trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementcpp">trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementh">trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactioncpp">trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionh">trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionidl">trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendh">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDatabaseAgentcpp">trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLValueh">trunk/Source/WebCore/platform/sql/SQLValue.h</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteStatementcpp">trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteStatementh">trunk/Source/WebCore/platform/sql/SQLiteStatement.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSSQLResultSetRowListCustomcpp">trunk/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSQLTransactionCustomcpp">trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLValuecpp">trunk/Source/WebCore/platform/sql/SQLValue.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/LayoutTests/ChangeLog        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-12-22 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove custom bindings for WebSQL code
+ https://bugs.webkit.org/show_bug.cgi?id=166441
+
+ Reviewed by Darin Adler.
+
+ * storage/websql/execute-sql-args-expected.txt:
+ * storage/websql/execute-sql-args.js:
+ Update test and result to be slightly more strict about functions taking sequences.
+
</ins><span class="cx"> 2016-12-22 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Nested calls to setDocument can omit firing 'unload' events
</span></span></pre></div>
<a id="trunkLayoutTestsstoragewebsqlexecutesqlargsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/websql/execute-sql-args-expected.txt (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/websql/execute-sql-args-expected.txt        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/LayoutTests/storage/websql/execute-sql-args-expected.txt        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -6,15 +6,10 @@
</span><span class="cx"> PASS. executeSql("", undefined) did not throw an exception
</span><span class="cx"> PASS. executeSql("", []) did not throw an exception
</span><span class="cx"> PASS. executeSql("", [ "arg0" ]) did not throw an exception
</span><del>-PASS. executeSql("", { }) did not throw an exception
-PASS. executeSql("", { length: 0 }) did not throw an exception
-PASS. executeSql("", { length: 1, 0: "arg0" }) did not throw an exception
</del><span class="cx"> PASS. executeSql("", null, null) did not throw an exception
</span><span class="cx"> PASS. executeSql("", null, undefined) did not throw an exception
</span><del>-PASS. executeSql("", null, { }) did not throw an exception
</del><span class="cx"> PASS. executeSql("", null, null, null) did not throw an exception
</span><span class="cx"> PASS. executeSql("", null, null, undefined) did not throw an exception
</span><del>-PASS. executeSql("", null, null, { }) did not throw an exception
</del><span class="cx"> PASS. executeSql() threw an exception as expected.
</span><span class="cx"> PASS. executeSql(throwOnToStringObject) threw an exception as expected.
</span><span class="cx"> PASS. executeSql("", throwOnGetLengthObject) threw an exception as expected.
</span><span class="lines">@@ -22,8 +17,13 @@
</span><span class="cx"> PASS. executeSql("", [ throwOnToStringObject ]) threw an exception as expected.
</span><span class="cx"> PASS. executeSql("", 0) threw an exception as expected.
</span><span class="cx"> PASS. executeSql("", "") threw an exception as expected.
</span><ins>+PASS. executeSql("", { }) threw an exception as expected.
+PASS. executeSql("", { length: 0 }) threw an exception as expected.
+PASS. executeSql("", { length: 1, 0: "arg0" }) threw an exception as expected.
</ins><span class="cx"> PASS. executeSql("", null, 0) threw an exception as expected.
</span><span class="cx"> PASS. executeSql("", null, "") threw an exception as expected.
</span><span class="cx"> PASS. executeSql("", null, null, 0) threw an exception as expected.
</span><span class="cx"> PASS. executeSql("", null, null, "") threw an exception as expected.
</span><ins>+PASS. executeSql("", null, { }) threw an exception as expected.
+PASS. executeSql("", null, null, { }) threw an exception as expected.
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsstoragewebsqlexecutesqlargsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/websql/execute-sql-args.js (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/websql/execute-sql-args.js        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/LayoutTests/storage/websql/execute-sql-args.js        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -16,15 +16,10 @@
</span><span class="cx"> '"", undefined',
</span><span class="cx"> '"", []',
</span><span class="cx"> '"", [ "arg0" ]',
</span><del>- '"", { }',
- '"", { length: 0 }',
- '"", { length: 1, 0: "arg0" }',
</del><span class="cx"> '"", null, null',
</span><span class="cx"> '"", null, undefined',
</span><del>- '"", null, { }',
</del><span class="cx"> '"", null, null, null',
</span><span class="cx"> '"", null, null, undefined',
</span><del>- '"", null, null, { }',
</del><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> var expectException = [
</span><span class="lines">@@ -35,10 +30,15 @@
</span><span class="cx"> '"", [ throwOnToStringObject ]',
</span><span class="cx"> '"", 0',
</span><span class="cx"> '"", ""',
</span><ins>+ '"", { }',
+ '"", { length: 0 }',
+ '"", { length: 1, 0: "arg0" }',
</ins><span class="cx"> '"", null, 0',
</span><span class="cx"> '"", null, ""',
</span><span class="cx"> '"", null, null, 0',
</span><span class="cx"> '"", null, null, ""',
</span><ins>+ '"", null, { }',
+ '"", null, null, { }',
</ins><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> function tryExecuteSql(transaction, parameterList)
</span><span class="lines">@@ -80,7 +80,6 @@
</span><span class="cx">
</span><span class="cx"> function runTest()
</span><span class="cx"> {
</span><del>-
</del><span class="cx"> var db = openDatabaseWithSuffix("ExecuteSQLArgsTest", "1.0", "Test of handling of the arguments to SQLTransaction.executeSql", 1);
</span><span class="cx"> db.transaction(runTransactionTests);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -1172,8 +1172,6 @@
</span><span class="cx"> bindings/js/JSReadableStreamPrivateConstructors.cpp
</span><span class="cx"> bindings/js/JSReadableStreamSourceCustom.cpp
</span><span class="cx"> bindings/js/JSRTCStatsResponseCustom.cpp
</span><del>- bindings/js/JSSQLResultSetRowListCustom.cpp
- bindings/js/JSSQLTransactionCustom.cpp
</del><span class="cx"> bindings/js/JSSVGPathSegCustom.cpp
</span><span class="cx"> bindings/js/JSStorageCustom.cpp
</span><span class="cx"> bindings/js/JSStyleSheetCustom.cpp
</span><span class="lines">@@ -2373,7 +2371,6 @@
</span><span class="cx"> platform/network/SocketStreamHandle.cpp
</span><span class="cx"> platform/network/SynchronousLoaderClient.cpp
</span><span class="cx">
</span><del>- platform/sql/SQLValue.cpp
</del><span class="cx"> platform/sql/SQLiteAuthorizer.cpp
</span><span class="cx"> platform/sql/SQLiteDatabase.cpp
</span><span class="cx"> platform/sql/SQLiteDatabaseTracker.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/ChangeLog        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2016-12-22 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Remove custom bindings for WebSQL code
+ https://bugs.webkit.org/show_bug.cgi?id=166441
+
+ Reviewed by Darin Adler.
+
+ - Replace custom variant type SQLValue with a type alias of a Variant.
+ - Use the newly representable SQLValue to remove custom bindings for
+ SQLResultSetRowList::item and SQLTransaction::executeSql.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSSQLResultSetRowListCustom.cpp: Removed.
+ * bindings/js/JSSQLTransactionCustom.cpp: Removed.
+ * platform/sql/SQLValue.cpp: Removed.
+ Remove files.
+
+ * Modules/webdatabase/SQLResultSetRowList.cpp:
+ (WebCore::SQLResultSetRowList::length):
+ (WebCore::SQLResultSetRowList::item):
+ * Modules/webdatabase/SQLResultSetRowList.h:
+ * Modules/webdatabase/SQLResultSetRowList.idl:
+ Sink the implementation of item() into the implementation. Use a
+ record type to bridge to javascript.
+
+ * Modules/webdatabase/SQLStatement.cpp:
+ (WebCore::SQLStatement::SQLStatement):
+ * Modules/webdatabase/SQLStatement.h:
+ Update to take arguments by rvalue reference.
+
+ * Modules/webdatabase/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::executeSql):
+ * Modules/webdatabase/SQLTransaction.h:
+ * Modules/webdatabase/SQLTransaction.idl:
+ Remove custom annotation, and update signature to match the IDL.
+
+ * Modules/webdatabase/SQLTransactionBackend.cpp:
+ * Modules/webdatabase/SQLTransactionBackend.h:
+ Remove unneeded #includes of SQLValue.h
+
+ * bindings/js/JSDOMConvert.h:
+ (WebCore::Converter<IDLNull>::convert):
+ (WebCore::JSConverter<IDLNull>::convert):
+ Implement conversion for the null type so it can be used in the SQLValue union.
+
+ * inspector/InspectorDatabaseAgent.cpp:
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::bindValue):
+ (WebCore::SQLiteStatement::getColumnValue):
+ * platform/sql/SQLiteStatement.h:
+ Replace old switch with a WTF::switchOn that operates on the new variant.
+
+ * platform/sql/SQLValue.h:
+ (WebCore::SQLValue::SQLValue): Deleted.
+ (WebCore::SQLValue::type): Deleted.
+ Replace implementation with a Variant.
+
</ins><span class="cx"> 2016-12-22 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] GLES build broken since r208997
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLResultSetRowListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -29,11 +29,13 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "SQLResultSetRowList.h"
</span><span class="cx">
</span><ins>+#include "ExceptionCode.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> unsigned SQLResultSetRowList::length() const
</span><span class="cx"> {
</span><del>- if (m_result.size() == 0)
</del><ins>+ if (m_result.isEmpty())
</ins><span class="cx"> return 0;
</span><span class="cx">
</span><span class="cx"> ASSERT(m_result.size() % m_columns.size() == 0);
</span><span class="lines">@@ -41,4 +43,19 @@
</span><span class="cx"> return m_result.size() / m_columns.size();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ExceptionOr<HashMap<String, SQLValue>> SQLResultSetRowList::item(unsigned index) const
+{
+ if (index >= length())
+ return Exception { INDEX_SIZE_ERR };
+
+ HashMap<String, SQLValue> result;
+
+ unsigned numberOfColumns = m_columns.size();
+ unsigned valuesIndex = index * numberOfColumns;
+ for (unsigned i = 0; i < numberOfColumns; i++)
+ result.set(m_columns[i], m_result[valuesIndex + i]);
+
+ return WTFMove(result);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLResultSetRowListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -28,8 +28,10 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include <wtf/RefCounted.h>
</del><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "SQLValue.h"
</span><ins>+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -44,6 +46,7 @@
</span><span class="cx"> void addResult(const SQLValue& result) { m_result.append(result); }
</span><span class="cx">
</span><span class="cx"> unsigned length() const;
</span><ins>+ ExceptionOr<HashMap<String, SQLValue>> item(unsigned index) const;
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> SQLResultSetRowList() { }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLResultSetRowListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.idl (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.idl        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.idl        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -26,9 +26,11 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+typedef (DOMString? or unrestricted double) SQLValue;
+
</ins><span class="cx"> [
</span><span class="cx"> ImplementationLacksVTable,
</span><span class="cx"> ] interface SQLResultSetRowList {
</span><span class="cx"> readonly attribute unsigned long length;
</span><del>- [Custom] any item(unsigned long index);
</del><ins>+ [MayThrowException] record<DOMString, SQLValue> item(unsigned long index);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-SQLStatement::SQLStatement(Database& database, const String& statement, const Vector<SQLValue>& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& errorCallback, int permissions)
</del><ins>+SQLStatement::SQLStatement(Database& database, const String& statement, Vector<SQLValue>&& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& errorCallback, int permissions)
</ins><span class="cx"> : m_statement(statement.isolatedCopy())
</span><del>- , m_arguments(arguments)
</del><ins>+ , m_arguments(WTFMove(arguments))
</ins><span class="cx"> , m_statementCallbackWrapper(WTFMove(callback), &database.scriptExecutionContext())
</span><span class="cx"> , m_statementErrorCallbackWrapper(WTFMove(errorCallback), &database.scriptExecutionContext())
</span><span class="cx"> , m_permissions(permissions)
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">
</span><span class="cx"> class SQLStatement {
</span><span class="cx"> public:
</span><del>- SQLStatement(Database&, const String&, const Vector<SQLValue>&, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&, int permissions);
</del><ins>+ SQLStatement(Database&, const String&, Vector<SQLValue>&&, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&, int permissions);
</ins><span class="cx"> ~SQLStatement();
</span><span class="cx">
</span><span class="cx"> bool execute(Database&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ExceptionOr<void> SQLTransaction::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& callbackError)
</del><ins>+ExceptionOr<void> SQLTransaction::executeSql(const String& sqlStatement, std::optional<Vector<SQLValue>>&& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& callbackError)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_executeSqlAllowed || !m_database->opened())
</span><span class="cx"> return Exception { INVALID_STATE_ERR };
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> else if (m_readOnly)
</span><span class="cx"> permissions |= DatabaseAuthorizer::ReadOnlyMask;
</span><span class="cx">
</span><del>- auto statement = std::make_unique<SQLStatement>(m_database, sqlStatement, arguments, WTFMove(callback), WTFMove(callbackError), permissions);
</del><ins>+ auto statement = std::make_unique<SQLStatement>(m_database, sqlStatement, arguments.value_or(Vector<SQLValue> { }), WTFMove(callback), WTFMove(callbackError), permissions);
</ins><span class="cx">
</span><span class="cx"> if (m_database->deleted())
</span><span class="cx"> statement->setDatabaseDeletedError();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx"> #include "SQLCallbackWrapper.h"
</span><span class="cx"> #include "SQLTransactionBackend.h"
</span><span class="cx"> #include "SQLTransactionStateMachine.h"
</span><ins>+#include "SQLValue.h"
+#include <wtf/Optional.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -43,7 +45,6 @@
</span><span class="cx"> class SQLTransactionBackend;
</span><span class="cx"> class SQLTransactionCallback;
</span><span class="cx"> class SQLTransactionErrorCallback;
</span><del>-class SQLValue;
</del><span class="cx"> class VoidCallback;
</span><span class="cx">
</span><span class="cx"> class SQLTransactionWrapper : public ThreadSafeRefCounted<SQLTransactionWrapper> {
</span><span class="lines">@@ -60,7 +61,7 @@
</span><span class="cx"> static Ref<SQLTransaction> create(Ref<Database>&&, RefPtr<SQLTransactionCallback>&&, RefPtr<VoidCallback>&& successCallback, RefPtr<SQLTransactionErrorCallback>&&, RefPtr<SQLTransactionWrapper>&&, bool readOnly);
</span><span class="cx"> ~SQLTransaction();
</span><span class="cx">
</span><del>- ExceptionOr<void> executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&);
</del><ins>+ ExceptionOr<void> executeSql(const String& sqlStatement, std::optional<Vector<SQLValue>>&& arguments, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&);
</ins><span class="cx">
</span><span class="cx"> void lockAcquired();
</span><span class="cx"> void performNextStep();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.idl (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.idl        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.idl        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -26,8 +26,10 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+typedef (DOMString? or unrestricted double) SQLValue;
+
</ins><span class="cx"> [
</span><span class="cx"> SkipVTableValidation,
</span><span class="cx"> ] interface SQLTransaction {
</span><del>- [Custom, MayThrowException] void executeSql(DOMString sqlStatement, ObjectArray arguments, optional SQLStatementCallback? callback, optional SQLStatementErrorCallback? errorCallback);
</del><ins>+ [MayThrowException] void executeSql(DOMString sqlStatement, optional sequence<SQLValue>? arguments = [], optional SQLStatementCallback? callback, optional SQLStatementErrorCallback? errorCallback);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include "SQLStatementErrorCallback.h"
</span><span class="cx"> #include "SQLTransaction.h"
</span><span class="cx"> #include "SQLTransactionCoordinator.h"
</span><del>-#include "SQLValue.h"
</del><span class="cx"> #include "SQLiteTransaction.h"
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx"> class SQLStatement;
</span><span class="cx"> class SQLTransaction;
</span><span class="cx"> class SQLTransactionWrapper;
</span><del>-class SQLValue;
</del><span class="cx">
</span><span class="cx"> class SQLTransactionBackend : public SQLTransactionStateMachine<SQLTransactionBackend> {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -693,7 +693,6 @@
</span><span class="cx">                 1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A2AAC580DC2A3B100A20D9A /* ApplicationCacheStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */; };
</span><span class="cx">                 1A2AAC590DC2A3B100A20D9A /* ApplicationCacheStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2AAC570DC2A3B100A20D9A /* ApplicationCacheStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E570CC55213004A2062 /* SQLValue.cpp */; };
</del><span class="cx">                 1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A2E6E7A0CC556D5004A2062 /* SQLiteAuthorizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */; };
</span><span class="cx">                 1A3586DF15264C450022A659 /* RenderMultiColumnFlowThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */; };
</span><span class="lines">@@ -883,7 +882,6 @@
</span><span class="cx">                 1ACE53EB0A8D18E70022947D /* XMLSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACE53E50A8D18E70022947D /* XMLSerializer.h */; };
</span><span class="cx">                 1ACE53F60A8D19470022947D /* JSXMLSerializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */; };
</span><span class="cx">                 1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACE53F50A8D19470022947D /* JSXMLSerializer.h */; };
</span><del>-                1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD2316D0CD269E700C1F194 /* JSSQLTransactionCustom.cpp */; };
</del><span class="cx">                 1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */; };
</span><span class="cx">                 1ADA4A1C1D22F2C0005A9A15 /* PaymentMerchantSessionCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA4A1B1D22F2C0005A9A15 /* PaymentMerchantSessionCocoa.mm */; };
</span><span class="lines">@@ -2222,7 +2220,6 @@
</span><span class="cx">                 51D7236D1BB6174900478CA3 /* IDBResultData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7236B1BB60BFE00478CA3 /* IDBResultData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51D7EFEA1BDE8F8C00E93E10 /* ThreadSafeDataBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 511FAEA91BDC989A00B4AFE4 /* ThreadSafeDataBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51D7EFEC1BDEFA5100E93E10 /* TransactionOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7EFEB1BDEFA4700E93E10 /* TransactionOperation.cpp */; };
</span><del>-                51DCE8020CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51DCE8010CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp */; };
</del><span class="cx">                 51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 51DF6D7D0B92A16D00C2DC85 /* ThreadCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */; };
</span><span class="cx">                 51E0BABB0DA5547100A9E417 /* StorageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E0BAB90DA5547100A9E417 /* StorageEvent.h */; };
</span><span class="lines">@@ -7728,7 +7725,6 @@
</span><span class="cx">                 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressTracker.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheStorage.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A2AAC570DC2A3B100A20D9A /* ApplicationCacheStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheStorage.h; sourceTree = "<group>"; };
</span><del>-                1A2E6E570CC55213004A2062 /* SQLValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLValue.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 1A2E6E580CC55213004A2062 /* SQLValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteAuthorizer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A3586DD15264C450022A659 /* RenderMultiColumnFlowThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMultiColumnFlowThread.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -7942,7 +7938,6 @@
</span><span class="cx">                 1ACE53E60A8D18E70022947D /* XMLSerializer.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = XMLSerializer.idl; sourceTree = "<group>"; };
</span><span class="cx">                 1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLSerializer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1ACE53F50A8D19470022947D /* JSXMLSerializer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLSerializer.h; sourceTree = "<group>"; };
</span><del>-                1AD2316D0CD269E700C1F194 /* JSSQLTransactionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformStrategies.h; sourceTree = "<group>"; };
</span><span class="cx">                 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformStrategies.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1ADA4A1B1D22F2C0005A9A15 /* PaymentMerchantSessionCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentMerchantSessionCocoa.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -9464,7 +9459,6 @@
</span><span class="cx">                 51D7236A1BB60BFE00478CA3 /* IDBResultData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBResultData.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 51D7236B1BB60BFE00478CA3 /* IDBResultData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBResultData.h; sourceTree = "<group>"; };
</span><span class="cx">                 51D7EFEB1BDEFA4700E93E10 /* TransactionOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransactionOperation.cpp; sourceTree = "<group>"; };
</span><del>-                51DCE8010CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLResultSetRowListCustom.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 51DF6D7D0B92A16D00C2DC85 /* ThreadCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadCheck.h; sourceTree = "<group>"; };
</span><span class="cx">                 51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ThreadCheck.mm; sourceTree = "<group>"; };
</span><span class="cx">                 51E0BAB90DA5547100A9E417 /* StorageEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageEvent.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -15745,7 +15739,6 @@
</span><span class="cx">                                 1A2246460CC98DDB00C05240 /* SQLiteStatement.h */,
</span><span class="cx">                                 1A2246470CC98DDB00C05240 /* SQLiteTransaction.cpp */,
</span><span class="cx">                                 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */,
</span><del>-                                1A2E6E570CC55213004A2062 /* SQLValue.cpp */,
</del><span class="cx">                                 1A2E6E580CC55213004A2062 /* SQLValue.h */,
</span><span class="cx">                         );
</span><span class="cx">                         path = sql;
</span><span class="lines">@@ -22148,8 +22141,6 @@
</span><span class="cx">                                 A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
</span><span class="cx">                                 418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
</span><span class="cx">                                 07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */,
</span><del>-                                51DCE8010CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp */,
-                                1AD2316D0CD269E700C1F194 /* JSSQLTransactionCustom.cpp */,
</del><span class="cx">                                 51D0C5150DAA90B7003B3831 /* JSStorageCustom.cpp */,
</span><span class="cx">                                 A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */,
</span><span class="cx">                                 57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */,
</span><span class="lines">@@ -30241,12 +30232,10 @@
</span><span class="cx">                                 B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
</span><span class="cx">                                 1AE82FEC0CAB07EE002237AE /* JSSQLResultSet.cpp in Sources */,
</span><span class="cx">                                 1AFE11990CBFFCC4003017FA /* JSSQLResultSetRowList.cpp in Sources */,
</span><del>-                                51DCE8020CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp in Sources */,
</del><span class="cx">                                 B59DD6A611902A62007E9684 /* JSSQLStatementCallback.cpp in Sources */,
</span><span class="cx">                                 B59DD6AA11902A71007E9684 /* JSSQLStatementErrorCallback.cpp in Sources */,
</span><span class="cx">                                 514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */,
</span><span class="cx">                                 B59DD69E11902A42007E9684 /* JSSQLTransactionCallback.cpp in Sources */,
</span><del>-                                1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */,
</del><span class="cx">                                 B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
</span><span class="cx">                                 A86629D409DA2B48009633A7 /* JSStaticRange.cpp in Sources */,
</span><span class="cx">                                 51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */,
</span><span class="lines">@@ -31280,7 +31269,6 @@
</span><span class="cx">                                 FEE1811316C319E800084849 /* SQLTransactionBackend.cpp in Sources */,
</span><span class="cx">                                 97BC6A561505F081001B74AC /* SQLTransactionCoordinator.cpp in Sources */,
</span><span class="cx">                                 FE36FD1616C7826500F887C1 /* SQLTransactionStateMachine.cpp in Sources */,
</span><del>-                                1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */,
</del><span class="cx">                                 4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */,
</span><span class="cx">                                 93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.mm in Sources */,
</span><span class="cx">                                 BC7FA62E0D1F0EFF00DB22A9 /* StaticNodeList.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -106,8 +106,6 @@
</span><span class="cx"> #include "JSPluginElementFunctions.cpp"
</span><span class="cx"> #include "JSPopStateEventCustom.cpp"
</span><span class="cx"> #include "JSReadableStreamPrivateConstructors.cpp"
</span><del>-#include "JSSQLResultSetRowListCustom.cpp"
-#include "JSSQLTransactionCustom.cpp"
</del><span class="cx"> #include "JSSVGPathSegCustom.cpp"
</span><span class="cx"> #include "JSStorageCustom.cpp"
</span><span class="cx"> #include "JSStyleSheetCustom.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -331,6 +331,26 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // MARK: -
</span><ins>+// MARK: Null type
+
+template<> struct Converter<IDLNull> : DefaultConverter<IDLNull> {
+ static std::nullptr_t convert(JSC::ExecState&, JSC::JSValue)
+ {
+ return nullptr;
+ }
+};
+
+template<> struct JSConverter<IDLNull> {
+ static constexpr bool needsState = false;
+ static constexpr bool needsGlobalObject = false;
+
+ static JSC::JSValue convert(std::nullptr_t)
+ {
+ return JSC::jsNull();
+ }
+};
+
+// MARK: -
</ins><span class="cx"> // MARK: Boolean type
</span><span class="cx">
</span><span class="cx"> template<> struct Converter<IDLBoolean> : DefaultConverter<IDLBoolean> {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSQLResultSetRowListCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "JSSQLResultSetRowList.h"
-#include "ExceptionCode.h"
-#include "JSDOMBinding.h"
-#include "SQLValue.h"
-#include <runtime/IdentifierInlines.h>
-#include <runtime/ObjectConstructor.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSSQLResultSetRowList::item(ExecState& state)
-{
- bool indexOk;
- int index = finiteInt32Value(state.argument(0), &state, indexOk);
- if (!indexOk) {
- setDOMException(&state, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
- if (index < 0 || (unsigned)index >= wrapped().length()) {
- setDOMException(&state, INDEX_SIZE_ERR);
- return jsUndefined();
- }
-
- JSObject* object = constructEmptyObject(&state);
-
- unsigned numColumns = wrapped().columnNames().size();
- unsigned valuesIndex = index * numColumns;
- for (unsigned i = 0; i < numColumns; i++) {
- const SQLValue& value = wrapped().values()[valuesIndex + i];
- JSValue jsValue;
-
- switch (value.type()) {
- case SQLValue::StringValue:
- jsValue = jsStringWithCache(&state, value.string());
- break;
- case SQLValue::NullValue:
- jsValue = jsNull();
- break;
- case SQLValue::NumberValue:
- jsValue = jsNumber(value.number());
- break;
- default:
- ASSERT_NOT_REACHED();
- }
-
- object->putDirect(state.vm(), Identifier::fromString(&state, wrapped().columnNames()[i]), jsValue, DontDelete | ReadOnly);
- }
-
- return object;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSQLTransactionCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -1,115 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "JSSQLTransaction.h"
-#include "DOMWindow.h"
-#include "ExceptionCode.h"
-#include "JSSQLStatementCallback.h"
-#include "JSSQLStatementErrorCallback.h"
-#include "JSDOMWindowCustom.h"
-#include "SQLTransaction.h"
-#include "SQLValue.h"
-#include <runtime/JSObjectInlines.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSSQLTransaction::executeSql(ExecState& state)
-{
- VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (!state.argumentCount()) {
- setDOMException(&state, SYNTAX_ERR);
- return jsUndefined();
- }
-
- String sqlStatement = state.argument(0).toWTFString(&state);
- RETURN_IF_EXCEPTION(scope, JSValue());
-
- // Now assemble the list of SQL arguments
- Vector<SQLValue> sqlValues;
- if (!state.argument(1).isUndefinedOrNull()) {
- JSObject* object = state.argument(1).getObject();
- if (!object) {
- setDOMException(&state, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- JSValue lengthValue = object->get(&state, state.propertyNames().length);
- RETURN_IF_EXCEPTION(scope, JSValue());
- unsigned length = lengthValue.toUInt32(&state);
- RETURN_IF_EXCEPTION(scope, JSValue());
-
- for (unsigned i = 0 ; i < length; ++i) {
- JSValue value = object->get(&state, i);
- RETURN_IF_EXCEPTION(scope, JSValue());
-
- if (value.isUndefinedOrNull())
- sqlValues.append(SQLValue());
- else if (value.isNumber())
- sqlValues.append(value.asNumber());
- else {
- // Convert the argument to a string and append it
- sqlValues.append(value.toWTFString(&state));
- RETURN_IF_EXCEPTION(scope, JSValue());
- }
- }
- }
-
- RefPtr<SQLStatementCallback> callback;
- if (!state.argument(2).isUndefinedOrNull()) {
- JSObject* object = state.argument(2).getObject();
- if (!object) {
- setDOMException(&state, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- callback = JSSQLStatementCallback::create(object, jsCast<JSDOMGlobalObject*>(globalObject()));
- }
-
- RefPtr<SQLStatementErrorCallback> errorCallback;
- if (!state.argument(3).isUndefinedOrNull()) {
- JSObject* object = state.argument(3).getObject();
- if (!object) {
- setDOMException(&state, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- errorCallback = JSSQLStatementErrorCallback::create(object, jsCast<JSDOMGlobalObject*>(globalObject()));
- }
-
- propagateException(state, scope, wrapped().executeSQL(sqlStatement, sqlValues, WTFMove(callback), WTFMove(errorCallback)));
-
- return jsUndefined();
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDatabaseAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -85,12 +85,11 @@
</span><span class="cx">
</span><span class="cx"> auto values = Inspector::Protocol::Array<InspectorValue>::create();
</span><span class="cx"> for (auto& value : rowList.values()) {
</span><del>- RefPtr<InspectorValue> inspectorValue;
- switch (value.type()) {
- case SQLValue::StringValue: inspectorValue = InspectorValue::create(value.string()); break;
- case SQLValue::NumberValue: inspectorValue = InspectorValue::create(value.number()); break;
- case SQLValue::NullValue: inspectorValue = InspectorValue::null(); break;
- }
</del><ins>+ auto inspectorValue = WTF::switchOn(value,
+ [] (const std::nullptr_t&) { return InspectorValue::null(); },
+ [] (const String& string) { return InspectorValue::create(string); },
+ [] (double number) { return InspectorValue::create(number); }
+ );
</ins><span class="cx"> values->addItem(WTFMove(inspectorValue));
</span><span class="cx"> }
</span><span class="cx"> m_requestCallback->sendSuccess(WTFMove(columnNames), WTFMove(values), nullptr);
</span><span class="lines">@@ -137,10 +136,9 @@
</span><span class="cx"> if (!m_requestCallback->isActive())
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- Vector<SQLValue> sqlValues;
</del><span class="cx"> Ref<SQLStatementCallback> callback(StatementCallback::create(m_requestCallback.copyRef()));
</span><span class="cx"> Ref<SQLStatementErrorCallback> errorCallback(StatementErrorCallback::create(m_requestCallback.copyRef()));
</span><del>- transaction->executeSQL(m_sqlStatement, sqlValues, WTFMove(callback), WTFMove(errorCallback));
</del><ins>+ transaction->executeSql(m_sqlStatement, { }, WTFMove(callback), WTFMove(errorCallback));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLValuecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/sql/SQLValue.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLValue.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/platform/sql/SQLValue.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following condition
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SQLValue.h"
-
-namespace WebCore {
-
-SQLValue::SQLValue(const SQLValue& val)
- : m_type(val.m_type)
- , m_number(val.m_number)
- , m_string(val.m_string.isolatedCopy())
-{
-}
-
-String SQLValue::string() const
-{
- ASSERT(m_type == StringValue);
-
- // Must return a copy since ref-shared Strings are not thread safe
- return m_string.isolatedCopy();
-}
-
-double SQLValue::number() const
-{
- ASSERT(m_type == NumberValue);
-
- return m_number;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLValue.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLValue.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/platform/sql/SQLValue.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -26,33 +26,13 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SQLValue_h
-#define SQLValue_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><del>-#include <wtf/Threading.h>
</del><ins>+#include <wtf/Variant.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class SQLValue {
- public:
- enum Type { NullValue, NumberValue, StringValue };
</del><ins>+using SQLValue = Variant<std::nullptr_t, String, double>;
</ins><span class="cx">
</span><del>- SQLValue() : m_type(NullValue), m_number(0.0) { }
- SQLValue(double number) : m_type(NumberValue), m_number(number) { }
- SQLValue(const String& s) : m_type(StringValue), m_number(0.0), m_string(s) { }
- SQLValue(const SQLValue&);
-
- Type type() const { return m_type; }
-
- String string() const;
- double number() const;
-
- private:
- Type m_type;
- double m_number;
- String m_string;
- };
</del><span class="cx"> };
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteStatementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "SQLValue.h"
</span><span class="cx"> #include <sqlite3.h>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx"> #include <wtf/text/StringView.h>
</span><span class="cx">
</span><span class="cx"> // SQLite 3.6.16 makes sqlite3_prepare_v2 automatically retry preparing the statement
</span><span class="lines">@@ -240,17 +241,11 @@
</span><span class="cx">
</span><span class="cx"> int SQLiteStatement::bindValue(int index, const SQLValue& value)
</span><span class="cx"> {
</span><del>- switch (value.type()) {
- case SQLValue::StringValue:
- return bindText(index, value.string());
- case SQLValue::NumberValue:
- return bindDouble(index, value.number());
- case SQLValue::NullValue:
- return bindNull(index);
- }
-
- ASSERT_NOT_REACHED();
- return SQLITE_ERROR;
</del><ins>+ return WTF::switchOn(value,
+ [&] (const std::nullptr_t&) { return bindNull(index); },
+ [&] (const String& string) { return bindText(index, string); },
+ [&] (double number) { return bindDouble(index, number); }
+ );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned SQLiteStatement::bindParameterCount() const
</span><span class="lines">@@ -307,9 +302,9 @@
</span><span class="cx"> ASSERT(col >= 0);
</span><span class="cx"> if (!m_statement)
</span><span class="cx"> if (prepareAndStep() != SQLITE_ROW)
</span><del>- return SQLValue();
</del><ins>+ return nullptr;
</ins><span class="cx"> if (columnCount() <= col)
</span><del>- return SQLValue();
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> // SQLite is typed per value. optional column types are
</span><span class="cx"> // "(mostly) ignored"
</span><span class="lines">@@ -317,19 +312,20 @@
</span><span class="cx"> switch (sqlite3_value_type(value)) {
</span><span class="cx"> case SQLITE_INTEGER: // SQLValue and JS don't represent integers, so use FLOAT -case
</span><span class="cx"> case SQLITE_FLOAT:
</span><del>- return SQLValue(sqlite3_value_double(value));
</del><ins>+ return sqlite3_value_double(value);
</ins><span class="cx"> case SQLITE_BLOB: // SQLValue and JS don't represent blobs, so use TEXT -case
</span><span class="cx"> case SQLITE_TEXT: {
</span><span class="cx"> const UChar* string = reinterpret_cast<const UChar*>(sqlite3_value_text16(value));
</span><del>- return SQLValue(StringImpl::create8BitIfPossible(string));
</del><ins>+ return StringImpl::create8BitIfPossible(string);
</ins><span class="cx"> }
</span><span class="cx"> case SQLITE_NULL:
</span><del>- return SQLValue();
</del><ins>+ return nullptr;
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return SQLValue();
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String SQLiteStatement::getColumnText(int col)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteStatementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteStatement.h (210133 => 210134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteStatement.h        2016-12-23 14:36:50 UTC (rev 210133)
+++ trunk/Source/WebCore/platform/sql/SQLiteStatement.h        2016-12-23 17:09:04 UTC (rev 210134)
</span><span class="lines">@@ -23,9 +23,9 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SQLiteStatement_h
-#define SQLiteStatement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><ins>+#include "SQLValue.h"
</ins><span class="cx"> #include "SQLiteDatabase.h"
</span><span class="cx">
</span><span class="cx"> struct sqlite3_stmt;
</span><span class="lines">@@ -32,8 +32,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class SQLValue;
-
</del><span class="cx"> class SQLiteStatement {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(SQLiteStatement); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -104,5 +102,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // SQLiteStatement_h
</del></span></pre>
</div>
</div>
</body>
</html>