<!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 <andersca@apple.com>
+
+ 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 <mmaxfield@apple.com>
</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. ("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 "SQLStatement.h"
+
+#include "Database.h"
+#include "Logging.h"
+#include "SQLError.h"
+#include "SQLResultSet.h"
+#include "SQLStatementCallback.h"
+#include "SQLStatementErrorCallback.h"
+#include "SQLValue.h"
+#include "SQLiteDatabase.h"
+#include "SQLiteStatement.h"
+#include <wtf/text/CString.h>
+
+
+// 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<RefPtr<SQLStatement>> m_statementQueue points to ...
+// --> SQLStatement // std::unique_ptr<SQLStatement> m_frontend points to ...
+// --> SQLStatement
+//
+// After grabbing the statement for execution (in SQLTransactionBackend::getNextStatement()):
+// =========================================================================================
+// SQLTransactionBackend // RefPtr<SQLStatement> m_currentStatementBackend points to ...
+// --> SQLStatement // std::unique_ptr<SQLStatement> m_frontend points to ...
+// --> 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& database, const String& statement, const Vector<SQLValue>& arguments, PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> 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<SQLError> SQLStatement::sqlError() const
+{
+ return m_error;
+}
+
+PassRefPtr<SQLResultSet> SQLStatement::sqlResultSet() const
+{
+ return m_resultSet;
+}
+
+bool SQLStatement::execute(Database& 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& database = db.sqliteDatabase();
+
+ SQLiteStatement statement(database, m_statement);
+ int result = statement.prepare();
+
+ if (result != SQLITE_OK) {
+ LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database.lastErrorMsg());
+ if (result == SQLITE_INTERRUPT)
+ m_error = SQLError::create(SQLError::DATABASE_ERR, "could not prepare statement", result, "interrupted");
+ else
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, "could not prepare statement", 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, "Bind parameter count doesn't match number of question marks");
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
+ return false;
+ }
+
+ for (unsigned i = 0; i < 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, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, "could not bind value", result, database.lastErrorMsg());
+ return false;
+ }
+ }
+
+ RefPtr<SQLResultSet> 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->rows();
+
+ for (int i = 0; i < columnCount; i++)
+ rows->addColumn(statement.getColumnName(i));
+
+ do {
+ for (int i = 0; i < columnCount; i++)
+ rows->addResult(statement.getColumnValue(i));
+
+ result = statement.step();
+ } while (result == SQLITE_ROW);
+
+ if (result != SQLITE_DONE) {
+ m_error = SQLError::create(SQLError::DATABASE_ERR, "could not iterate results", result, database.lastErrorMsg());
+ return false;
+ }
+ break;
+ }
+ case SQLITE_DONE: {
+ // Didn't find anything, or was an insert
+ if (db.lastActionWasInsert())
+ resultSet->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, "could not execute statement due to a constaint failure", result, database.lastErrorMsg());
+ return false;
+ default:
+ m_error = SQLError::create(SQLError::DATABASE_ERR, "could not execute statement", result, database.lastErrorMsg());
+ return false;
+ }
+
+ // FIXME: If the spec allows triggers, and we want to be "accurate" 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->setRowsAffected(database.lastChanges());
+
+ m_resultSet = resultSet;
+ return true;
+}
+
+bool SQLStatement::performCallback(SQLTransaction* transaction)
+{
+ ASSERT(transaction);
+
+ bool callbackError = false;
+
+ RefPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap();
+ RefPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWrapper.unwrap();
+ RefPtr<SQLError> 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->handleEvent(transaction, error.get());
+ } else if (callback) {
+ RefPtr<SQLResultSet> resultSet = sqlResultSet();
+ callbackError = !callback->handleEvent(transaction, resultSet.get());
+ }
+
+ return callbackError;
+}
+
+void SQLStatement::setDatabaseDeletedError()
+{
+ ASSERT(!m_error && !m_resultSet);
+ m_error = SQLError::create(SQLError::UNKNOWN_ERR, "unable to execute statement, because the user deleted the database");
+}
+
+void SQLStatement::setVersionMismatchedError()
+{
+ ASSERT(!m_error && !m_resultSet);
+ m_error = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
+}
+
+void SQLStatement::setFailureDueToQuota()
+{
+ ASSERT(!m_error && !m_resultSet);
+ m_error = SQLError::create(SQLError::QUOTA_ERR, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
+}
+
+void SQLStatement::clearFailureDueToQuota()
+{
+ if (lastExecutionFailedDueToQuota())
+ m_error = nullptr;
+}
+
+bool SQLStatement::lastExecutionFailedDueToQuota() const
+{
+ return m_error && m_error->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. ("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.
+ */
+#ifndef SQLStatement_h
+#define SQLStatement_h
+
+#include "SQLCallbackWrapper.h"
+#include "SQLStatementCallback.h"
+#include "SQLStatementErrorCallback.h"
+#include "SQLValue.h"
+#include <wtf/Forward.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class Database;
+class SQLError;
+class SQLResultSet;
+class SQLTransactionBackend;
+
+class SQLStatement {
+public:
+ SQLStatement(Database&, const String&, const Vector<SQLValue>&, PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>, int permissions);
+ ~SQLStatement();
+
+ bool execute(Database&);
+ 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<SQLError> sqlError() const;
+ PassRefPtr<SQLResultSet> sqlResultSet() const;
+
+private:
+ void setFailureDueToQuota();
+ void clearFailureDueToQuota();
+
+ String m_statement;
+ Vector<SQLValue> m_arguments;
+ SQLCallbackWrapper<SQLStatementCallback> m_statementCallbackWrapper;
+ SQLCallbackWrapper<SQLStatementErrorCallback> m_statementErrorCallbackWrapper;
+
+ RefPtr<SQLError> m_error;
+ RefPtr<SQLResultSet> 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. ("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 "SQLStatementBackend.h"
-
-#include "Database.h"
-#include "Logging.h"
-#include "SQLError.h"
-#include "SQLResultSet.h"
-#include "SQLStatementCallback.h"
-#include "SQLStatementErrorCallback.h"
-#include "SQLValue.h"
-#include "SQLiteDatabase.h"
-#include "SQLiteStatement.h"
-#include <wtf/text/CString.h>
-
-
-// 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<RefPtr<SQLStatementBackend>> m_statementQueue points to ...
-// --> SQLStatementBackend // std::unique_ptr<SQLStatement> m_frontend points to ...
-// --> SQLStatement
-//
-// After grabbing the statement for execution (in SQLTransactionBackend::getNextStatement()):
-// =========================================================================================
-// SQLTransactionBackend // RefPtr<SQLStatementBackend> m_currentStatementBackend points to ...
-// --> SQLStatementBackend // std::unique_ptr<SQLStatement> m_frontend points to ...
-// --> 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& database, const String& statement, const Vector<SQLValue>& arguments, PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> 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<SQLError> SQLStatementBackend::sqlError() const
-{
- return m_error;
-}
-
-PassRefPtr<SQLResultSet> SQLStatementBackend::sqlResultSet() const
-{
- return m_resultSet;
-}
-
-bool SQLStatementBackend::execute(Database& 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& database = db.sqliteDatabase();
-
- SQLiteStatement statement(database, m_statement);
- int result = statement.prepare();
-
- if (result != SQLITE_OK) {
- LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database.lastErrorMsg());
- if (result == SQLITE_INTERRUPT)
- m_error = SQLError::create(SQLError::DATABASE_ERR, "could not prepare statement", result, "interrupted");
- else
- m_error = SQLError::create(SQLError::SYNTAX_ERR, "could not prepare statement", 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, "Bind parameter count doesn't match number of question marks");
- m_error = SQLError::create(SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
- return false;
- }
-
- for (unsigned i = 0; i < 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, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
- m_error = SQLError::create(SQLError::DATABASE_ERR, "could not bind value", result, database.lastErrorMsg());
- return false;
- }
- }
-
- RefPtr<SQLResultSet> 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->rows();
-
- for (int i = 0; i < columnCount; i++)
- rows->addColumn(statement.getColumnName(i));
-
- do {
- for (int i = 0; i < columnCount; i++)
- rows->addResult(statement.getColumnValue(i));
-
- result = statement.step();
- } while (result == SQLITE_ROW);
-
- if (result != SQLITE_DONE) {
- m_error = SQLError::create(SQLError::DATABASE_ERR, "could not iterate results", result, database.lastErrorMsg());
- return false;
- }
- break;
- }
- case SQLITE_DONE: {
- // Didn't find anything, or was an insert
- if (db.lastActionWasInsert())
- resultSet->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, "could not execute statement due to a constaint failure", result, database.lastErrorMsg());
- return false;
- default:
- m_error = SQLError::create(SQLError::DATABASE_ERR, "could not execute statement", result, database.lastErrorMsg());
- return false;
- }
-
- // FIXME: If the spec allows triggers, and we want to be "accurate" 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->setRowsAffected(database.lastChanges());
-
- m_resultSet = resultSet;
- return true;
-}
-
-bool SQLStatementBackend::performCallback(SQLTransaction* transaction)
-{
- ASSERT(transaction);
-
- bool callbackError = false;
-
- RefPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap();
- RefPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWrapper.unwrap();
- RefPtr<SQLError> 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->handleEvent(transaction, error.get());
- } else if (callback) {
- RefPtr<SQLResultSet> resultSet = sqlResultSet();
- callbackError = !callback->handleEvent(transaction, resultSet.get());
- }
-
- return callbackError;
-}
-
-void SQLStatementBackend::setDatabaseDeletedError()
-{
- ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(SQLError::UNKNOWN_ERR, "unable to execute statement, because the user deleted the database");
-}
-
-void SQLStatementBackend::setVersionMismatchedError()
-{
- ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
-}
-
-void SQLStatementBackend::setFailureDueToQuota()
-{
- ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(SQLError::QUOTA_ERR, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
-}
-
-void SQLStatementBackend::clearFailureDueToQuota()
-{
- if (lastExecutionFailedDueToQuota())
- m_error = nullptr;
-}
-
-bool SQLStatementBackend::lastExecutionFailedDueToQuota() const
-{
- return m_error && m_error->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. ("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.
- */
-#ifndef SQLStatementBackend_h
-#define SQLStatementBackend_h
-
-#include "SQLCallbackWrapper.h"
-#include "SQLStatementCallback.h"
-#include "SQLStatementErrorCallback.h"
-#include "SQLValue.h"
-#include <wtf/Forward.h>
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class Database;
-class SQLError;
-class SQLResultSet;
-class SQLTransactionBackend;
-
-class SQLStatementBackend {
-public:
- SQLStatementBackend(Database&, const String&, const Vector<SQLValue>&, PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>, int permissions);
- ~SQLStatementBackend();
-
- bool execute(Database&);
- 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<SQLError> sqlError() const;
- PassRefPtr<SQLResultSet> sqlResultSet() const;
-
-private:
- void setFailureDueToQuota();
- void clearFailureDueToQuota();
-
- String m_statement;
- Vector<SQLValue> m_arguments;
- SQLCallbackWrapper<SQLStatementCallback> m_statementCallbackWrapper;
- SQLCallbackWrapper<SQLStatementErrorCallback> m_statementErrorCallbackWrapper;
-
- RefPtr<SQLError> m_error;
- RefPtr<SQLResultSet> 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 "ExceptionCode.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "SQLError.h"
</span><del>-#include "SQLStatementBackend.h"
</del><ins>+#include "SQLStatement.h"
</ins><span class="cx"> #include "SQLStatementCallback.h"
</span><span class="cx"> #include "SQLStatementErrorCallback.h"
</span><span class="cx"> #include "SQLTransactionBackend.h"
</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->currentStatement();
</del><ins>+ SQLStatement* currentStatement = m_backend->currentStatement();
</ins><span class="cx"> ASSERT(currentStatement);
</span><span class="cx">
</span><span class="cx"> bool result = currentStatement->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<SQLStatementBackend>(m_database, sqlStatement, arguments, WTF::move(callback), WTF::move(callbackError), permissions);
</del><ins>+ auto statement = std::make_unique<SQLStatement>(m_database, sqlStatement, arguments, WTF::move(callback), WTF::move(callbackError), permissions);
</ins><span class="cx"> m_backend->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 "Logging.h"
</span><span class="cx"> #include "OriginLock.h"
</span><span class="cx"> #include "SQLError.h"
</span><del>-#include "SQLStatementBackend.h"
</del><ins>+#include "SQLStatement.h"
</ins><span class="cx"> #include "SQLStatementCallback.h"
</span><span class="cx"> #include "SQLStatementErrorCallback.h"
</span><span class="cx"> #include "SQLTransaction.h"
</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<int>(state)];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SQLTransactionBackend::enqueueStatementBackend(std::unique_ptr<SQLStatementBackend> statementBackend)
</del><ins>+void SQLTransactionBackend::enqueueStatementBackend(std::unique_ptr<SQLStatement> 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<SQLStatementBackend> statementBackend)
</del><ins>+void SQLTransactionBackend::executeSQL(std::unique_ptr<SQLStatement> statementBackend)
</ins><span class="cx"> {
</span><span class="cx"> if (m_database->deleted())
</span><span class="cx"> statementBackend->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<SQLError> transactionError();
</span><del>- SQLStatementBackend* currentStatement();
</del><ins>+ SQLStatement* currentStatement();
</ins><span class="cx"> void setShouldRetryCurrentStatement(bool);
</span><del>- void executeSQL(std::unique_ptr<SQLStatementBackend>);
</del><ins>+ void executeSQL(std::unique_ptr<SQLStatement>);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> SQLTransactionBackend(Database*, PassRefPtr<SQLTransaction>, PassRefPtr<SQLTransactionWrapper>, bool readOnly);
</span><span class="cx">
</span><span class="cx"> void doCleanup();
</span><span class="cx">
</span><del>- void enqueueStatementBackend(std::unique_ptr<SQLStatementBackend>);
</del><ins>+ void enqueueStatementBackend(std::unique_ptr<SQLStatement>);
</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<SQLTransaction> m_frontend; // Has a reference cycle, and will break in doCleanup().
</span><del>- std::unique_ptr<SQLStatementBackend> m_currentStatementBackend;
</del><ins>+ std::unique_ptr<SQLStatement> m_currentStatementBackend;
</ins><span class="cx">
</span><span class="cx"> RefPtr<Database> m_database;
</span><span class="cx"> RefPtr<SQLTransactionWrapper> 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<std::unique_ptr<SQLStatementBackend>> m_statementQueue;
</del><ins>+ Deque<std::unique_ptr<SQLStatement>> m_statementQueue;
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<SQLiteTransaction> m_sqliteTransaction;
</span><span class="cx"> RefPtr<OriginLock> 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"> <ClCompile Include="..\Modules\webdatabase\SQLException.cpp" />
</span><span class="cx"> <ClCompile Include="..\Modules\webdatabase\SQLResultSet.cpp" />
</span><span class="cx"> <ClCompile Include="..\Modules\webdatabase\SQLResultSetRowList.cpp" />
</span><del>- <ClCompile Include="..\Modules\webdatabase\SQLStatementBackend.cpp" />
</del><ins>+ <ClCompile Include="..\Modules\webdatabase\SQLStatement.cpp" />
</ins><span class="cx"> <ClCompile Include="..\Modules\webdatabase\SQLTransaction.cpp" />
</span><span class="cx"> <ClCompile Include="..\Modules\webdatabase\SQLTransactionBackend.cpp" />
</span><span class="cx"> <ClCompile Include="..\Modules\webdatabase\SQLTransactionClient.cpp" />
</span><span class="lines">@@ -20561,7 +20561,7 @@
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLException.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLResultSet.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLResultSetRowList.h" />
</span><del>- <ClInclude Include="..\Modules\webdatabase\SQLStatementBackend.h" />
</del><ins>+ <ClInclude Include="..\Modules\webdatabase\SQLStatement.h" />
</ins><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLStatementCallback.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLStatementErrorCallback.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLTransaction.h" />
</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"> <ClCompile Include="..\Modules\webdatabase\SQLResultSetRowList.cpp">
</span><span class="cx"> <Filter>Modules\webdatabase</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\Modules\webdatabase\SQLStatementBackend.cpp">
</del><ins>+ <ClCompile Include="..\Modules\webdatabase\SQLStatement.cpp">
</ins><span class="cx"> <Filter>Modules\webdatabase</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\Modules\webdatabase\SQLTransaction.cpp">
</span><span class="lines">@@ -7487,7 +7487,7 @@
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLResultSetRowList.h">
</span><span class="cx"> <Filter>Modules\webdatabase</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\Modules\webdatabase\SQLStatementBackend.h">
</del><ins>+ <ClInclude Include="..\Modules\webdatabase\SQLStatement.h">
</ins><span class="cx"> <Filter>Modules\webdatabase</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\SQLStatementCallback.h">
</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 = "<group>"; };
</span><span class="cx">                 FE80DA6D0E9C472F000D6F75 /* JSPositionError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPositionError.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FE80DA6E0E9C472F000D6F75 /* JSPositionError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionError.h; sourceTree = "<group>"; };
</span><del>-                FE8A674516CDD19E00930BF8 /* SQLStatementBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatementBackend.cpp; sourceTree = "<group>"; };
-                FE8A674616CDD19E00930BF8 /* SQLStatementBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatementBackend.h; sourceTree = "<group>"; };
</del><ins>+                FE8A674516CDD19E00930BF8 /* SQLStatement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatement.cpp; sourceTree = "<group>"; };
+                FE8A674616CDD19E00930BF8 /* SQLStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatement.h; sourceTree = "<group>"; };
</ins><span class="cx">                 FE9E89F916E2DC0400A908F8 /* OriginLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginLock.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FE9E89FA16E2DC0400A908F8 /* OriginLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginLock.h; sourceTree = "<group>"; };
</span><span class="cx">                 FEAF6653167970070062D0C5 /* DatabaseServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseServer.h; sourceTree = "<group>"; };
</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>