<!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>[188089] 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/188089">188089</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-08-06 16:35:12 -0700 (Thu, 06 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename SQLStatementBackend to SQLStatement
https://bugs.webkit.org/show_bug.cgi?id=147755

Reviewed by Geoffrey Garen.

* CMakeLists.txt:
* Modules/webdatabase/SQLStatement.h: Renamed from Source/WebCore/Modules/webdatabase/SQLStatementBackend.h.
(WebCore::SQLStatement::hasStatementCallback):
(WebCore::SQLStatement::hasStatementErrorCallback):
* Modules/webdatabase/SQLStatementBackend.cpp: Removed.
(WebCore::SQLStatementBackend::SQLStatementBackend): Deleted.
(WebCore::SQLStatementBackend::~SQLStatementBackend): Deleted.
(WebCore::SQLStatementBackend::sqlError): Deleted.
(WebCore::SQLStatementBackend::sqlResultSet): Deleted.
(WebCore::SQLStatementBackend::execute): Deleted.
(WebCore::SQLStatementBackend::performCallback): Deleted.
(WebCore::SQLStatementBackend::setDatabaseDeletedError): Deleted.
(WebCore::SQLStatementBackend::setVersionMismatchedError): Deleted.
(WebCore::SQLStatementBackend::setFailureDueToQuota): Deleted.
(WebCore::SQLStatementBackend::clearFailureDueToQuota): Deleted.
(WebCore::SQLStatementBackend::lastExecutionFailedDueToQuota): Deleted.
* Modules/webdatabase/SQLStatementBackend.h:
(WebCore::SQLStatementBackend::hasStatementCallback): Deleted.
(WebCore::SQLStatementBackend::hasStatementErrorCallback): Deleted.
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::deliverStatementCallback):
(WebCore::SQLTransaction::executeSQL):
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::currentStatement):
(WebCore::SQLTransactionBackend::enqueueStatementBackend):
(WebCore::SQLTransactionBackend::executeSQL):
* Modules/webdatabase/SQLTransactionBackend.h:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactioncpp">trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp</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="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementBackendcpp">trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementBackendh">trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -1013,7 +1013,7 @@
</span><span class="cx">     Modules/webdatabase/SQLException.cpp
</span><span class="cx">     Modules/webdatabase/SQLResultSet.cpp
</span><span class="cx">     Modules/webdatabase/SQLResultSetRowList.cpp
</span><del>-    Modules/webdatabase/SQLStatementBackend.cpp
</del><ins>+    Modules/webdatabase/SQLStatement.cpp
</ins><span class="cx">     Modules/webdatabase/SQLTransaction.cpp
</span><span class="cx">     Modules/webdatabase/SQLTransactionBackend.cpp
</span><span class="cx">     Modules/webdatabase/SQLTransactionClient.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/ChangeLog        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-08-06  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Rename SQLStatementBackend to SQLStatement
+        https://bugs.webkit.org/show_bug.cgi?id=147755
+
+        Reviewed by Geoffrey Garen.
+
+        * CMakeLists.txt:
+        * Modules/webdatabase/SQLStatement.h: Renamed from Source/WebCore/Modules/webdatabase/SQLStatementBackend.h.
+        (WebCore::SQLStatement::hasStatementCallback):
+        (WebCore::SQLStatement::hasStatementErrorCallback):
+        * Modules/webdatabase/SQLStatementBackend.cpp: Removed.
+        (WebCore::SQLStatementBackend::SQLStatementBackend): Deleted.
+        (WebCore::SQLStatementBackend::~SQLStatementBackend): Deleted.
+        (WebCore::SQLStatementBackend::sqlError): Deleted.
+        (WebCore::SQLStatementBackend::sqlResultSet): Deleted.
+        (WebCore::SQLStatementBackend::execute): Deleted.
+        (WebCore::SQLStatementBackend::performCallback): Deleted.
+        (WebCore::SQLStatementBackend::setDatabaseDeletedError): Deleted.
+        (WebCore::SQLStatementBackend::setVersionMismatchedError): Deleted.
+        (WebCore::SQLStatementBackend::setFailureDueToQuota): Deleted.
+        (WebCore::SQLStatementBackend::clearFailureDueToQuota): Deleted.
+        (WebCore::SQLStatementBackend::lastExecutionFailedDueToQuota): Deleted.
+        * Modules/webdatabase/SQLStatementBackend.h:
+        (WebCore::SQLStatementBackend::hasStatementCallback): Deleted.
+        (WebCore::SQLStatementBackend::hasStatementErrorCallback): Deleted.
+        * Modules/webdatabase/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::deliverStatementCallback):
+        (WebCore::SQLTransaction::executeSQL):
+        * Modules/webdatabase/SQLTransactionBackend.cpp:
+        (WebCore::SQLTransactionBackend::currentStatement):
+        (WebCore::SQLTransactionBackend::enqueueStatementBackend):
+        (WebCore::SQLTransactionBackend::executeSQL):
+        * Modules/webdatabase/SQLTransactionBackend.h:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2015-08-06  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make FontDescriptionKey sensitive to FontFeatureSettings
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementcppfromrev188088trunkSourceWebCoreModuleswebdatabaseSQLStatementBackendcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp (from rev 188088, trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp) (0 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -0,0 +1,254 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2013 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. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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 &quot;config.h&quot;
+#include &quot;SQLStatement.h&quot;
+
+#include &quot;Database.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;SQLError.h&quot;
+#include &quot;SQLResultSet.h&quot;
+#include &quot;SQLStatementCallback.h&quot;
+#include &quot;SQLStatementErrorCallback.h&quot;
+#include &quot;SQLValue.h&quot;
+#include &quot;SQLiteDatabase.h&quot;
+#include &quot;SQLiteStatement.h&quot;
+#include &lt;wtf/text/CString.h&gt;
+
+
+// The Life-Cycle of a SQLStatement i.e. Who's keeping the SQLStatement alive? 
+// ==========================================================================
+// The RefPtr chain goes something like this:
+//
+//     At birth (in SQLTransactionBackend::executeSQL()):
+//     =================================================
+//     SQLTransactionBackend           // Deque&lt;RefPtr&lt;SQLStatement&gt;&gt; m_statementQueue points to ...
+//     --&gt; SQLStatement         // std::unique_ptr&lt;SQLStatement&gt; m_frontend points to ...
+//         --&gt; SQLStatement
+//
+//     After grabbing the statement for execution (in SQLTransactionBackend::getNextStatement()):
+//     =========================================================================================
+//     SQLTransactionBackend           // RefPtr&lt;SQLStatement&gt; m_currentStatementBackend points to ...
+//     --&gt; SQLStatement         // std::unique_ptr&lt;SQLStatement&gt; m_frontend points to ...
+//         --&gt; SQLStatement
+//
+//     Then we execute the statement in SQLTransactionBackend::runCurrentStatementAndGetNextState().
+//     And we callback to the script in SQLTransaction::deliverStatementCallback() if
+//     necessary.
+//     - Inside SQLTransaction::deliverStatementCallback(), we operate on a raw SQLStatement*.
+//       This pointer is valid because it is owned by SQLTransactionBackend's
+//       SQLTransactionBackend::m_currentStatementBackend.
+//
+//     After we're done executing the statement (in SQLTransactionBackend::getNextStatement()):
+//     =======================================================================================
+//     When we're done executing, we'll grab the next statement. But before we
+//     do that, getNextStatement() nullify SQLTransactionBackend::m_currentStatementBackend.
+//     This will trigger the deletion of the SQLStatement and SQLStatement.
+//
+//     Note: unlike with SQLTransaction, there is no JS representation of SQLStatement.
+//     Hence, there is no GC dependency at play here.
+
+namespace WebCore {
+
+SQLStatement::SQLStatement(Database&amp; database, const String&amp; statement, const Vector&lt;SQLValue&gt;&amp; arguments, PassRefPtr&lt;SQLStatementCallback&gt; callback, PassRefPtr&lt;SQLStatementErrorCallback&gt; errorCallback, int permissions)
+    : m_statement(statement.isolatedCopy())
+    , m_arguments(arguments)
+    , m_statementCallbackWrapper(callback, database.scriptExecutionContext())
+    , m_statementErrorCallbackWrapper(errorCallback, database.scriptExecutionContext())
+    , m_permissions(permissions)
+{
+}
+
+SQLStatement::~SQLStatement()
+{
+}
+
+PassRefPtr&lt;SQLError&gt; SQLStatement::sqlError() const
+{
+    return m_error;
+}
+
+PassRefPtr&lt;SQLResultSet&gt; SQLStatement::sqlResultSet() const
+{
+    return m_resultSet;
+}
+
+bool SQLStatement::execute(Database&amp; db)
+{
+    ASSERT(!m_resultSet);
+
+    // If we're re-running this statement after a quota violation, we need to clear that error now
+    clearFailureDueToQuota();
+
+    // This transaction might have been marked bad while it was being set up on the main thread,
+    // so if there is still an error, return false.
+    if (m_error)
+        return false;
+
+    db.setAuthorizerPermissions(m_permissions);
+
+    SQLiteDatabase&amp; database = db.sqliteDatabase();
+
+    SQLiteStatement statement(database, m_statement);
+    int result = statement.prepare();
+
+    if (result != SQLITE_OK) {
+        LOG(StorageAPI, &quot;Unable to verify correctness of statement %s - error %i (%s)&quot;, m_statement.ascii().data(), result, database.lastErrorMsg());
+        if (result == SQLITE_INTERRUPT)
+            m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not prepare statement&quot;, result, &quot;interrupted&quot;);
+        else
+            m_error = SQLError::create(SQLError::SYNTAX_ERR, &quot;could not prepare statement&quot;, result, database.lastErrorMsg());
+        return false;
+    }
+
+    // FIXME: If the statement uses the ?### syntax supported by sqlite, the bind parameter count is very likely off from the number of question marks.
+    // If this is the case, they might be trying to do something fishy or malicious
+    if (statement.bindParameterCount() != m_arguments.size()) {
+        LOG(StorageAPI, &quot;Bind parameter count doesn't match number of question marks&quot;);
+        m_error = SQLError::create(SQLError::SYNTAX_ERR, &quot;number of '?'s in statement string does not match argument count&quot;);
+        return false;
+    }
+
+    for (unsigned i = 0; i &lt; m_arguments.size(); ++i) {
+        result = statement.bindValue(i + 1, m_arguments[i]);
+        if (result == SQLITE_FULL) {
+            setFailureDueToQuota();
+            return false;
+        }
+
+        if (result != SQLITE_OK) {
+            LOG(StorageAPI, &quot;Failed to bind value index %i to statement for query '%s'&quot;, i + 1, m_statement.ascii().data());
+            m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not bind value&quot;, result, database.lastErrorMsg());
+            return false;
+        }
+    }
+
+    RefPtr&lt;SQLResultSet&gt; resultSet = SQLResultSet::create();
+
+    // Step so we can fetch the column names.
+    result = statement.step();
+    switch (result) {
+    case SQLITE_ROW: {
+        int columnCount = statement.columnCount();
+        SQLResultSetRowList* rows = resultSet-&gt;rows();
+
+        for (int i = 0; i &lt; columnCount; i++)
+            rows-&gt;addColumn(statement.getColumnName(i));
+
+        do {
+            for (int i = 0; i &lt; columnCount; i++)
+                rows-&gt;addResult(statement.getColumnValue(i));
+
+            result = statement.step();
+        } while (result == SQLITE_ROW);
+
+        if (result != SQLITE_DONE) {
+            m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not iterate results&quot;, result, database.lastErrorMsg());
+            return false;
+        }
+        break;
+    }
+    case SQLITE_DONE: {
+        // Didn't find anything, or was an insert
+        if (db.lastActionWasInsert())
+            resultSet-&gt;setInsertId(database.lastInsertRowID());
+        break;
+    }
+    case SQLITE_FULL:
+        // Return the Quota error - the delegate will be asked for more space and this statement might be re-run
+        setFailureDueToQuota();
+        return false;
+    case SQLITE_CONSTRAINT:
+        m_error = SQLError::create(SQLError::CONSTRAINT_ERR, &quot;could not execute statement due to a constaint failure&quot;, result, database.lastErrorMsg());
+        return false;
+    default:
+        m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not execute statement&quot;, result, database.lastErrorMsg());
+        return false;
+    }
+
+    // FIXME: If the spec allows triggers, and we want to be &quot;accurate&quot; in a different way, we'd use
+    // sqlite3_total_changes() here instead of sqlite3_changed, because that includes rows modified from within a trigger
+    // For now, this seems sufficient
+    resultSet-&gt;setRowsAffected(database.lastChanges());
+
+    m_resultSet = resultSet;
+    return true;
+}
+
+bool SQLStatement::performCallback(SQLTransaction* transaction)
+{
+    ASSERT(transaction);
+
+    bool callbackError = false;
+
+    RefPtr&lt;SQLStatementCallback&gt; callback = m_statementCallbackWrapper.unwrap();
+    RefPtr&lt;SQLStatementErrorCallback&gt; errorCallback = m_statementErrorCallbackWrapper.unwrap();
+    RefPtr&lt;SQLError&gt; error = sqlError();
+
+    // Call the appropriate statement callback and track if it resulted in an error,
+    // because then we need to jump to the transaction error callback.
+    if (error) {
+        if (errorCallback)
+            callbackError = errorCallback-&gt;handleEvent(transaction, error.get());
+    } else if (callback) {
+        RefPtr&lt;SQLResultSet&gt; resultSet = sqlResultSet();
+        callbackError = !callback-&gt;handleEvent(transaction, resultSet.get());
+    }
+
+    return callbackError;
+}
+
+void SQLStatement::setDatabaseDeletedError()
+{
+    ASSERT(!m_error &amp;&amp; !m_resultSet);
+    m_error = SQLError::create(SQLError::UNKNOWN_ERR, &quot;unable to execute statement, because the user deleted the database&quot;);
+}
+
+void SQLStatement::setVersionMismatchedError()
+{
+    ASSERT(!m_error &amp;&amp; !m_resultSet);
+    m_error = SQLError::create(SQLError::VERSION_ERR, &quot;current version of the database and `oldVersion` argument do not match&quot;);
+}
+
+void SQLStatement::setFailureDueToQuota()
+{
+    ASSERT(!m_error &amp;&amp; !m_resultSet);
+    m_error = SQLError::create(SQLError::QUOTA_ERR, &quot;there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space&quot;);
+}
+
+void SQLStatement::clearFailureDueToQuota()
+{
+    if (lastExecutionFailedDueToQuota())
+        m_error = nullptr;
+}
+
+bool SQLStatement::lastExecutionFailedDueToQuota() const
+{
+    return m_error &amp;&amp; m_error-&gt;code() == SQLError::QUOTA_ERR;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementhfromrev188088trunkSourceWebCoreModuleswebdatabaseSQLStatementBackendh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h (from rev 188088, trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h) (0 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2013 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. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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.
+ */
+#ifndef SQLStatement_h
+#define SQLStatement_h
+
+#include &quot;SQLCallbackWrapper.h&quot;
+#include &quot;SQLStatementCallback.h&quot;
+#include &quot;SQLStatementErrorCallback.h&quot;
+#include &quot;SQLValue.h&quot;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class Database;
+class SQLError;
+class SQLResultSet;
+class SQLTransactionBackend;
+
+class SQLStatement {
+public:
+    SQLStatement(Database&amp;, const String&amp;, const Vector&lt;SQLValue&gt;&amp;, PassRefPtr&lt;SQLStatementCallback&gt;, PassRefPtr&lt;SQLStatementErrorCallback&gt;, int permissions);
+    ~SQLStatement();
+
+    bool execute(Database&amp;);
+    bool lastExecutionFailedDueToQuota() const;
+
+    bool hasStatementCallback() const { return m_statementCallbackWrapper.hasCallback(); }
+    bool hasStatementErrorCallback() const { return m_statementErrorCallbackWrapper.hasCallback(); }
+    bool performCallback(SQLTransaction*);
+
+    void setDatabaseDeletedError();
+    void setVersionMismatchedError();
+
+    PassRefPtr&lt;SQLError&gt; sqlError() const;
+    PassRefPtr&lt;SQLResultSet&gt; sqlResultSet() const;
+
+private:
+    void setFailureDueToQuota();
+    void clearFailureDueToQuota();
+
+    String m_statement;
+    Vector&lt;SQLValue&gt; m_arguments;
+    SQLCallbackWrapper&lt;SQLStatementCallback&gt; m_statementCallbackWrapper;
+    SQLCallbackWrapper&lt;SQLStatementErrorCallback&gt; m_statementErrorCallbackWrapper;
+
+    RefPtr&lt;SQLError&gt; m_error;
+    RefPtr&lt;SQLResultSet&gt; m_resultSet;
+
+    int m_permissions;
+};
+
+} // namespace WebCore
+
+#endif // SQLStatement_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementBackendcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -1,254 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2013 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. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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 &quot;config.h&quot;
-#include &quot;SQLStatementBackend.h&quot;
-
-#include &quot;Database.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;SQLError.h&quot;
-#include &quot;SQLResultSet.h&quot;
-#include &quot;SQLStatementCallback.h&quot;
-#include &quot;SQLStatementErrorCallback.h&quot;
-#include &quot;SQLValue.h&quot;
-#include &quot;SQLiteDatabase.h&quot;
-#include &quot;SQLiteStatement.h&quot;
-#include &lt;wtf/text/CString.h&gt;
-
-
-// The Life-Cycle of a SQLStatement i.e. Who's keeping the SQLStatement alive? 
-// ==========================================================================
-// The RefPtr chain goes something like this:
-//
-//     At birth (in SQLTransactionBackend::executeSQL()):
-//     =================================================
-//     SQLTransactionBackend           // Deque&lt;RefPtr&lt;SQLStatementBackend&gt;&gt; m_statementQueue points to ...
-//     --&gt; SQLStatementBackend         // std::unique_ptr&lt;SQLStatement&gt; m_frontend points to ...
-//         --&gt; SQLStatement
-//
-//     After grabbing the statement for execution (in SQLTransactionBackend::getNextStatement()):
-//     =========================================================================================
-//     SQLTransactionBackend           // RefPtr&lt;SQLStatementBackend&gt; m_currentStatementBackend points to ...
-//     --&gt; SQLStatementBackend         // std::unique_ptr&lt;SQLStatement&gt; m_frontend points to ...
-//         --&gt; SQLStatement
-//
-//     Then we execute the statement in SQLTransactionBackend::runCurrentStatementAndGetNextState().
-//     And we callback to the script in SQLTransaction::deliverStatementCallback() if
-//     necessary.
-//     - Inside SQLTransaction::deliverStatementCallback(), we operate on a raw SQLStatement*.
-//       This pointer is valid because it is owned by SQLTransactionBackend's
-//       SQLTransactionBackend::m_currentStatementBackend.
-//
-//     After we're done executing the statement (in SQLTransactionBackend::getNextStatement()):
-//     =======================================================================================
-//     When we're done executing, we'll grab the next statement. But before we
-//     do that, getNextStatement() nullify SQLTransactionBackend::m_currentStatementBackend.
-//     This will trigger the deletion of the SQLStatementBackend and SQLStatement.
-//
-//     Note: unlike with SQLTransaction, there is no JS representation of SQLStatement.
-//     Hence, there is no GC dependency at play here.
-
-namespace WebCore {
-
-SQLStatementBackend::SQLStatementBackend(Database&amp; database, const String&amp; statement, const Vector&lt;SQLValue&gt;&amp; arguments, PassRefPtr&lt;SQLStatementCallback&gt; callback, PassRefPtr&lt;SQLStatementErrorCallback&gt; errorCallback, int permissions)
-    : m_statement(statement.isolatedCopy())
-    , m_arguments(arguments)
-    , m_statementCallbackWrapper(callback, database.scriptExecutionContext())
-    , m_statementErrorCallbackWrapper(errorCallback, database.scriptExecutionContext())
-    , m_permissions(permissions)
-{
-}
-
-SQLStatementBackend::~SQLStatementBackend()
-{
-}
-
-PassRefPtr&lt;SQLError&gt; SQLStatementBackend::sqlError() const
-{
-    return m_error;
-}
-
-PassRefPtr&lt;SQLResultSet&gt; SQLStatementBackend::sqlResultSet() const
-{
-    return m_resultSet;
-}
-
-bool SQLStatementBackend::execute(Database&amp; db)
-{
-    ASSERT(!m_resultSet);
-
-    // If we're re-running this statement after a quota violation, we need to clear that error now
-    clearFailureDueToQuota();
-
-    // This transaction might have been marked bad while it was being set up on the main thread,
-    // so if there is still an error, return false.
-    if (m_error)
-        return false;
-
-    db.setAuthorizerPermissions(m_permissions);
-
-    SQLiteDatabase&amp; database = db.sqliteDatabase();
-
-    SQLiteStatement statement(database, m_statement);
-    int result = statement.prepare();
-
-    if (result != SQLITE_OK) {
-        LOG(StorageAPI, &quot;Unable to verify correctness of statement %s - error %i (%s)&quot;, m_statement.ascii().data(), result, database.lastErrorMsg());
-        if (result == SQLITE_INTERRUPT)
-            m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not prepare statement&quot;, result, &quot;interrupted&quot;);
-        else
-            m_error = SQLError::create(SQLError::SYNTAX_ERR, &quot;could not prepare statement&quot;, result, database.lastErrorMsg());
-        return false;
-    }
-
-    // FIXME: If the statement uses the ?### syntax supported by sqlite, the bind parameter count is very likely off from the number of question marks.
-    // If this is the case, they might be trying to do something fishy or malicious
-    if (statement.bindParameterCount() != m_arguments.size()) {
-        LOG(StorageAPI, &quot;Bind parameter count doesn't match number of question marks&quot;);
-        m_error = SQLError::create(SQLError::SYNTAX_ERR, &quot;number of '?'s in statement string does not match argument count&quot;);
-        return false;
-    }
-
-    for (unsigned i = 0; i &lt; m_arguments.size(); ++i) {
-        result = statement.bindValue(i + 1, m_arguments[i]);
-        if (result == SQLITE_FULL) {
-            setFailureDueToQuota();
-            return false;
-        }
-
-        if (result != SQLITE_OK) {
-            LOG(StorageAPI, &quot;Failed to bind value index %i to statement for query '%s'&quot;, i + 1, m_statement.ascii().data());
-            m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not bind value&quot;, result, database.lastErrorMsg());
-            return false;
-        }
-    }
-
-    RefPtr&lt;SQLResultSet&gt; resultSet = SQLResultSet::create();
-
-    // Step so we can fetch the column names.
-    result = statement.step();
-    switch (result) {
-    case SQLITE_ROW: {
-        int columnCount = statement.columnCount();
-        SQLResultSetRowList* rows = resultSet-&gt;rows();
-
-        for (int i = 0; i &lt; columnCount; i++)
-            rows-&gt;addColumn(statement.getColumnName(i));
-
-        do {
-            for (int i = 0; i &lt; columnCount; i++)
-                rows-&gt;addResult(statement.getColumnValue(i));
-
-            result = statement.step();
-        } while (result == SQLITE_ROW);
-
-        if (result != SQLITE_DONE) {
-            m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not iterate results&quot;, result, database.lastErrorMsg());
-            return false;
-        }
-        break;
-    }
-    case SQLITE_DONE: {
-        // Didn't find anything, or was an insert
-        if (db.lastActionWasInsert())
-            resultSet-&gt;setInsertId(database.lastInsertRowID());
-        break;
-    }
-    case SQLITE_FULL:
-        // Return the Quota error - the delegate will be asked for more space and this statement might be re-run
-        setFailureDueToQuota();
-        return false;
-    case SQLITE_CONSTRAINT:
-        m_error = SQLError::create(SQLError::CONSTRAINT_ERR, &quot;could not execute statement due to a constaint failure&quot;, result, database.lastErrorMsg());
-        return false;
-    default:
-        m_error = SQLError::create(SQLError::DATABASE_ERR, &quot;could not execute statement&quot;, result, database.lastErrorMsg());
-        return false;
-    }
-
-    // FIXME: If the spec allows triggers, and we want to be &quot;accurate&quot; in a different way, we'd use
-    // sqlite3_total_changes() here instead of sqlite3_changed, because that includes rows modified from within a trigger
-    // For now, this seems sufficient
-    resultSet-&gt;setRowsAffected(database.lastChanges());
-
-    m_resultSet = resultSet;
-    return true;
-}
-
-bool SQLStatementBackend::performCallback(SQLTransaction* transaction)
-{
-    ASSERT(transaction);
-
-    bool callbackError = false;
-
-    RefPtr&lt;SQLStatementCallback&gt; callback = m_statementCallbackWrapper.unwrap();
-    RefPtr&lt;SQLStatementErrorCallback&gt; errorCallback = m_statementErrorCallbackWrapper.unwrap();
-    RefPtr&lt;SQLError&gt; error = sqlError();
-
-    // Call the appropriate statement callback and track if it resulted in an error,
-    // because then we need to jump to the transaction error callback.
-    if (error) {
-        if (errorCallback)
-            callbackError = errorCallback-&gt;handleEvent(transaction, error.get());
-    } else if (callback) {
-        RefPtr&lt;SQLResultSet&gt; resultSet = sqlResultSet();
-        callbackError = !callback-&gt;handleEvent(transaction, resultSet.get());
-    }
-
-    return callbackError;
-}
-
-void SQLStatementBackend::setDatabaseDeletedError()
-{
-    ASSERT(!m_error &amp;&amp; !m_resultSet);
-    m_error = SQLError::create(SQLError::UNKNOWN_ERR, &quot;unable to execute statement, because the user deleted the database&quot;);
-}
-
-void SQLStatementBackend::setVersionMismatchedError()
-{
-    ASSERT(!m_error &amp;&amp; !m_resultSet);
-    m_error = SQLError::create(SQLError::VERSION_ERR, &quot;current version of the database and `oldVersion` argument do not match&quot;);
-}
-
-void SQLStatementBackend::setFailureDueToQuota()
-{
-    ASSERT(!m_error &amp;&amp; !m_resultSet);
-    m_error = SQLError::create(SQLError::QUOTA_ERR, &quot;there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space&quot;);
-}
-
-void SQLStatementBackend::clearFailureDueToQuota()
-{
-    if (lastExecutionFailedDueToQuota())
-        m_error = nullptr;
-}
-
-bool SQLStatementBackend::lastExecutionFailedDueToQuota() const
-{
-    return m_error &amp;&amp; m_error-&gt;code() == SQLError::QUOTA_ERR;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementBackendh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -1,81 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2013 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. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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.
- */
-#ifndef SQLStatementBackend_h
-#define SQLStatementBackend_h
-
-#include &quot;SQLCallbackWrapper.h&quot;
-#include &quot;SQLStatementCallback.h&quot;
-#include &quot;SQLStatementErrorCallback.h&quot;
-#include &quot;SQLValue.h&quot;
-#include &lt;wtf/Forward.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class Database;
-class SQLError;
-class SQLResultSet;
-class SQLTransactionBackend;
-
-class SQLStatementBackend {
-public:
-    SQLStatementBackend(Database&amp;, const String&amp;, const Vector&lt;SQLValue&gt;&amp;, PassRefPtr&lt;SQLStatementCallback&gt;, PassRefPtr&lt;SQLStatementErrorCallback&gt;, int permissions);
-    ~SQLStatementBackend();
-
-    bool execute(Database&amp;);
-    bool lastExecutionFailedDueToQuota() const;
-
-    bool hasStatementCallback() const { return m_statementCallbackWrapper.hasCallback(); }
-    bool hasStatementErrorCallback() const { return m_statementErrorCallbackWrapper.hasCallback(); }
-    bool performCallback(SQLTransaction*);
-
-    void setDatabaseDeletedError();
-    void setVersionMismatchedError();
-
-    PassRefPtr&lt;SQLError&gt; sqlError() const;
-    PassRefPtr&lt;SQLResultSet&gt; sqlResultSet() const;
-
-private:
-    void setFailureDueToQuota();
-    void clearFailureDueToQuota();
-
-    String m_statement;
-    Vector&lt;SQLValue&gt; m_arguments;
-    SQLCallbackWrapper&lt;SQLStatementCallback&gt; m_statementCallbackWrapper;
-    SQLCallbackWrapper&lt;SQLStatementErrorCallback&gt; m_statementErrorCallbackWrapper;
-
-    RefPtr&lt;SQLError&gt; m_error;
-    RefPtr&lt;SQLResultSet&gt; m_resultSet;
-
-    int m_permissions;
-};
-
-} // namespace WebCore
-
-#endif // SQLStatementBackend_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;SQLError.h&quot;
</span><del>-#include &quot;SQLStatementBackend.h&quot;
</del><ins>+#include &quot;SQLStatement.h&quot;
</ins><span class="cx"> #include &quot;SQLStatementCallback.h&quot;
</span><span class="cx"> #include &quot;SQLStatementErrorCallback.h&quot;
</span><span class="cx"> #include &quot;SQLTransactionBackend.h&quot;
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx">     // Otherwise, continue to loop through the statement queue
</span><span class="cx">     m_executeSqlAllowed = true;
</span><span class="cx"> 
</span><del>-    SQLStatementBackend* currentStatement = m_backend-&gt;currentStatement();
</del><ins>+    SQLStatement* currentStatement = m_backend-&gt;currentStatement();
</ins><span class="cx">     ASSERT(currentStatement);
</span><span class="cx"> 
</span><span class="cx">     bool result = currentStatement-&gt;performCallback(this);
</span><span class="lines">@@ -258,7 +258,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&lt;SQLStatementBackend&gt;(m_database, sqlStatement, arguments, WTF::move(callback), WTF::move(callbackError), permissions);
</del><ins>+    auto statement = std::make_unique&lt;SQLStatement&gt;(m_database, sqlStatement, arguments, WTF::move(callback), WTF::move(callbackError), permissions);
</ins><span class="cx">     m_backend-&gt;executeSQL(WTF::move(statement));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;OriginLock.h&quot;
</span><span class="cx"> #include &quot;SQLError.h&quot;
</span><del>-#include &quot;SQLStatementBackend.h&quot;
</del><ins>+#include &quot;SQLStatement.h&quot;
</ins><span class="cx"> #include &quot;SQLStatementCallback.h&quot;
</span><span class="cx"> #include &quot;SQLStatementErrorCallback.h&quot;
</span><span class="cx"> #include &quot;SQLTransaction.h&quot;
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx">     m_wrapper = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SQLStatementBackend* SQLTransactionBackend::currentStatement()
</del><ins>+SQLStatement* SQLTransactionBackend::currentStatement()
</ins><span class="cx"> {
</span><span class="cx">     return m_currentStatementBackend.get();
</span><span class="cx"> }
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx">     return stateFunctions[static_cast&lt;int&gt;(state)];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SQLTransactionBackend::enqueueStatementBackend(std::unique_ptr&lt;SQLStatementBackend&gt; statementBackend)
</del><ins>+void SQLTransactionBackend::enqueueStatementBackend(std::unique_ptr&lt;SQLStatement&gt; statementBackend)
</ins><span class="cx"> {
</span><span class="cx">     MutexLocker locker(m_statementMutex);
</span><span class="cx">     m_statementQueue.append(WTF::move(statementBackend));
</span><span class="lines">@@ -523,7 +523,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void SQLTransactionBackend::executeSQL(std::unique_ptr&lt;SQLStatementBackend&gt; statementBackend)
</del><ins>+void SQLTransactionBackend::executeSQL(std::unique_ptr&lt;SQLStatement&gt; statementBackend)
</ins><span class="cx"> {
</span><span class="cx">     if (m_database-&gt;deleted())
</span><span class="cx">         statementBackend-&gt;setDatabaseDeletedError();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> class OriginLock;
</span><span class="cx"> class SQLError;
</span><span class="cx"> class SQLiteTransaction;
</span><del>-class SQLStatementBackend;
</del><ins>+class SQLStatement;
</ins><span class="cx"> class SQLTransaction;
</span><span class="cx"> class SQLTransactionBackend;
</span><span class="cx"> class SQLValue;
</span><span class="lines">@@ -76,16 +76,16 @@
</span><span class="cx">     // APIs called from the frontend published via SQLTransactionBackend:
</span><span class="cx">     void requestTransitToState(SQLTransactionState);
</span><span class="cx">     PassRefPtr&lt;SQLError&gt; transactionError();
</span><del>-    SQLStatementBackend* currentStatement();
</del><ins>+    SQLStatement* currentStatement();
</ins><span class="cx">     void setShouldRetryCurrentStatement(bool);
</span><del>-    void executeSQL(std::unique_ptr&lt;SQLStatementBackend&gt;);
</del><ins>+    void executeSQL(std::unique_ptr&lt;SQLStatement&gt;);
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     SQLTransactionBackend(Database*, PassRefPtr&lt;SQLTransaction&gt;, PassRefPtr&lt;SQLTransactionWrapper&gt;, bool readOnly);
</span><span class="cx"> 
</span><span class="cx">     void doCleanup();
</span><span class="cx"> 
</span><del>-    void enqueueStatementBackend(std::unique_ptr&lt;SQLStatementBackend&gt;);
</del><ins>+    void enqueueStatementBackend(std::unique_ptr&lt;SQLStatement&gt;);
</ins><span class="cx"> 
</span><span class="cx">     // State Machine functions:
</span><span class="cx">     virtual StateFunction stateFunctionFor(SQLTransactionState) override;
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">     void releaseOriginLockIfNeeded();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SQLTransaction&gt; m_frontend; // Has a reference cycle, and will break in doCleanup().
</span><del>-    std::unique_ptr&lt;SQLStatementBackend&gt; m_currentStatementBackend;
</del><ins>+    std::unique_ptr&lt;SQLStatement&gt; m_currentStatementBackend;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Database&gt; m_database;
</span><span class="cx">     RefPtr&lt;SQLTransactionWrapper&gt; m_wrapper;
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">     bool m_hasVersionMismatch;
</span><span class="cx"> 
</span><span class="cx">     Mutex m_statementMutex;
</span><del>-    Deque&lt;std::unique_ptr&lt;SQLStatementBackend&gt;&gt; m_statementQueue;
</del><ins>+    Deque&lt;std::unique_ptr&lt;SQLStatement&gt;&gt; m_statementQueue;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;SQLiteTransaction&gt; m_sqliteTransaction;
</span><span class="cx">     RefPtr&lt;OriginLock&gt; m_originLock;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -6819,7 +6819,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLException.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLResultSet.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLResultSetRowList.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLStatementBackend.cpp&quot; /&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLStatement.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLTransaction.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLTransactionBackend.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLTransactionClient.cpp&quot; /&gt;
</span><span class="lines">@@ -20561,7 +20561,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLException.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLResultSet.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLResultSetRowList.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatementBackend.h&quot; /&gt;
</del><ins>+    &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatement.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatementCallback.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatementErrorCallback.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLTransaction.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLResultSetRowList.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Modules\webdatabase&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLStatementBackend.cpp&quot;&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLStatement.cpp&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;Modules\webdatabase&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\Modules\webdatabase\SQLTransaction.cpp&quot;&gt;
</span><span class="lines">@@ -7487,7 +7487,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLResultSetRowList.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Modules\webdatabase&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatementBackend.h&quot;&gt;
</del><ins>+    &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatement.h&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;Modules\webdatabase&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\webdatabase\SQLStatementCallback.h&quot;&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (188088 => 188089)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-08-06 23:31:53 UTC (rev 188088)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-08-06 23:35:12 UTC (rev 188089)
</span><span class="lines">@@ -6833,8 +6833,8 @@
</span><span class="cx">                 FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */ = {isa = PBXBuildFile; fileRef = FE80DA620E9C4703000D6F75 /* JSGeoposition.h */; };
</span><span class="cx">                 FE80DA710E9C472F000D6F75 /* JSPositionError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE80DA6D0E9C472F000D6F75 /* JSPositionError.cpp */; };
</span><span class="cx">                 FE80DA720E9C472F000D6F75 /* JSPositionError.h in Headers */ = {isa = PBXBuildFile; fileRef = FE80DA6E0E9C472F000D6F75 /* JSPositionError.h */; };
</span><del>-                FE8A674716CDD19E00930BF8 /* SQLStatementBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE8A674516CDD19E00930BF8 /* SQLStatementBackend.cpp */; };
-                FE8A674816CDD19E00930BF8 /* SQLStatementBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8A674616CDD19E00930BF8 /* SQLStatementBackend.h */; };
</del><ins>+                FE8A674716CDD19E00930BF8 /* SQLStatement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE8A674516CDD19E00930BF8 /* SQLStatement.cpp */; };
+                FE8A674816CDD19E00930BF8 /* SQLStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8A674616CDD19E00930BF8 /* SQLStatement.h */; };
</ins><span class="cx">                 FE9E89FB16E2DC0500A908F8 /* OriginLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE9E89F916E2DC0400A908F8 /* OriginLock.cpp */; };
</span><span class="cx">                 FE9E89FC16E2DC0500A908F8 /* OriginLock.h in Headers */ = {isa = PBXBuildFile; fileRef = FE9E89FA16E2DC0400A908F8 /* OriginLock.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEAF6654167970320062D0C5 /* DatabaseServer.h in Headers */ = {isa = PBXBuildFile; fileRef = FEAF6653167970070062D0C5 /* DatabaseServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -14594,8 +14594,8 @@
</span><span class="cx">                 FE80DA620E9C4703000D6F75 /* JSGeoposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGeoposition.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE80DA6D0E9C472F000D6F75 /* JSPositionError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPositionError.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE80DA6E0E9C472F000D6F75 /* JSPositionError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                FE8A674516CDD19E00930BF8 /* SQLStatementBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatementBackend.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                FE8A674616CDD19E00930BF8 /* SQLStatementBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatementBackend.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                FE8A674516CDD19E00930BF8 /* SQLStatement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE8A674616CDD19E00930BF8 /* SQLStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE9E89F916E2DC0400A908F8 /* OriginLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginLock.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE9E89FA16E2DC0400A908F8 /* OriginLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginLock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEAF6653167970070062D0C5 /* DatabaseServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseServer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18806,8 +18806,8 @@
</span><span class="cx">                                 97BC6A021505F081001B74AC /* SQLResultSetRowList.cpp */,
</span><span class="cx">                                 97BC6A031505F081001B74AC /* SQLResultSetRowList.h */,
</span><span class="cx">                                 97BC6A041505F081001B74AC /* SQLResultSetRowList.idl */,
</span><del>-                                FE8A674516CDD19E00930BF8 /* SQLStatementBackend.cpp */,
-                                FE8A674616CDD19E00930BF8 /* SQLStatementBackend.h */,
</del><ins>+                                FE8A674516CDD19E00930BF8 /* SQLStatement.cpp */,
+                                FE8A674616CDD19E00930BF8 /* SQLStatement.h */,
</ins><span class="cx">                                 97BC6A071505F081001B74AC /* SQLStatementCallback.h */,
</span><span class="cx">                                 97BC6A081505F081001B74AC /* SQLStatementCallback.idl */,
</span><span class="cx">                                 97BC6A091505F081001B74AC /* SQLStatementErrorCallback.h */,
</span><span class="lines">@@ -26720,7 +26720,7 @@
</span><span class="cx">                                 1A22464E0CC98DDB00C05240 /* SQLiteTransaction.h in Headers */,
</span><span class="cx">                                 97BC6A421505F081001B74AC /* SQLResultSet.h in Headers */,
</span><span class="cx">                                 97BC6A451505F081001B74AC /* SQLResultSetRowList.h in Headers */,
</span><del>-                                FE8A674816CDD19E00930BF8 /* SQLStatementBackend.h in Headers */,
</del><ins>+                                FE8A674816CDD19E00930BF8 /* SQLStatement.h in Headers */,
</ins><span class="cx">                                 97BC6A491505F081001B74AC /* SQLStatementCallback.h in Headers */,
</span><span class="cx">                                 97BC6A4B1505F081001B74AC /* SQLStatementErrorCallback.h in Headers */,
</span><span class="cx">                                 97BC6A501505F081001B74AC /* SQLTransaction.h in Headers */,
</span><span class="lines">@@ -30188,7 +30188,7 @@
</span><span class="cx">                                 1A22464D0CC98DDB00C05240 /* SQLiteTransaction.cpp in Sources */,
</span><span class="cx">                                 97BC6A411505F081001B74AC /* SQLResultSet.cpp in Sources */,
</span><span class="cx">                                 97BC6A441505F081001B74AC /* SQLResultSetRowList.cpp in Sources */,
</span><del>-                                FE8A674716CDD19E00930BF8 /* SQLStatementBackend.cpp in Sources */,
</del><ins>+                                FE8A674716CDD19E00930BF8 /* SQLStatement.cpp in Sources */,
</ins><span class="cx">                                 97BC6A4F1505F081001B74AC /* SQLTransaction.cpp in Sources */,
</span><span class="cx">                                 FEE1811316C319E800084849 /* SQLTransactionBackend.cpp in Sources */,
</span><span class="cx">                                 97BC6A541505F081001B74AC /* SQLTransactionClient.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>