<!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>[204357] 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/204357">204357</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-08-10 14:54:29 -0700 (Wed, 10 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move more functions to from SQLTransactionBackend to SQLTransaction
https://bugs.webkit.org/show_bug.cgi?id=160752
Reviewed by Tim Horton.
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::acquireLock):
(WebCore::SQLTransaction::openTransactionAndPreflight):
(WebCore::SQLTransaction::runStatements):
(WebCore::SQLTransaction::cleanupAndTerminate):
(WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::acquireLock):
(WebCore::SQLTransactionBackend::openTransactionAndPreflight):
(WebCore::SQLTransactionBackend::runStatements):
(WebCore::SQLTransactionBackend::cleanupAndTerminate):
(WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):</pre>
<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionh">trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204356 => 204357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-10 21:31:07 UTC (rev 204356)
+++ trunk/Source/WebCore/ChangeLog        2016-08-10 21:54:29 UTC (rev 204357)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2016-08-10 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><ins>+ Move more functions to from SQLTransactionBackend to SQLTransaction
+ https://bugs.webkit.org/show_bug.cgi?id=160752
+
+ Reviewed by Tim Horton.
+
+ * Modules/webdatabase/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::acquireLock):
+ (WebCore::SQLTransaction::openTransactionAndPreflight):
+ (WebCore::SQLTransaction::runStatements):
+ (WebCore::SQLTransaction::cleanupAndTerminate):
+ (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
+ * Modules/webdatabase/SQLTransaction.h:
+ * Modules/webdatabase/SQLTransactionBackend.cpp:
+ (WebCore::SQLTransactionBackend::acquireLock):
+ (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
+ (WebCore::SQLTransactionBackend::runStatements):
+ (WebCore::SQLTransactionBackend::cleanupAndTerminate):
+ (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
+
+2016-08-10 Anders Carlsson <andersca@apple.com>
+
</ins><span class="cx"> Begin moving member functions from SQLTransactionBackend to SQLTransaction
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=160747
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp (204356 => 204357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp        2016-08-10 21:31:07 UTC (rev 204356)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp        2016-08-10 21:54:29 UTC (rev 204357)
</span><span class="lines">@@ -42,7 +42,8 @@
</span><span class="cx"> #include "SQLStatementErrorCallback.h"
</span><span class="cx"> #include "SQLTransactionBackend.h"
</span><span class="cx"> #include "SQLTransactionCallback.h"
</span><del>-#include "SQLTransactionClient.h" // FIXME: Should be used in the backend only.
</del><ins>+#include "SQLTransactionClient.h"
+#include "SQLTransactionCoordinator.h"
</ins><span class="cx"> #include "SQLTransactionErrorCallback.h"
</span><span class="cx"> #include "SQLiteTransaction.h"
</span><span class="cx"> #include "VoidCallback.h"
</span><span class="lines">@@ -162,6 +163,161 @@
</span><span class="cx"> m_database->scheduleTransactionCallback(this);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void SQLTransaction::acquireLock()
+{
+ m_database->transactionCoordinator()->acquireLock(*this);
+}
+
+void SQLTransaction::openTransactionAndPreflight()
+{
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+ ASSERT(m_lockAcquired);
+
+ LOG(StorageAPI, "Opening and preflighting transaction %p", this);
+
+ // If the database was deleted, jump to the error callback
+ if (m_database->deleted()) {
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to open a transaction, because the user deleted the database");
+
+ handleTransactionError();
+ return;
+ }
+
+ // Set the maximum usage for this transaction if this transactions is not read-only
+ if (!m_readOnly) {
+ acquireOriginLock();
+ m_database->sqliteDatabase().setMaximumSize(m_database->maximumSize());
+ }
+
+ ASSERT(!m_sqliteTransaction);
+ m_sqliteTransaction = std::make_unique<SQLiteTransaction>(m_database->sqliteDatabase(), m_readOnly);
+
+ m_database->resetDeletes();
+ m_database->disableAuthorizer();
+ m_sqliteTransaction->begin();
+ m_database->enableAuthorizer();
+
+ // Spec 4.3.2.1+2: Open a transaction to the database, jumping to the error callback if that fails
+ if (!m_sqliteTransaction->inProgress()) {
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+ m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to begin transaction", m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
+ m_sqliteTransaction = nullptr;
+
+ handleTransactionError();
+ return;
+ }
+
+ // Note: We intentionally retrieve the actual version even with an empty expected version.
+ // In multi-process browsers, we take this opportinutiy to update the cached value for
+ // the actual version. In single-process browsers, this is just a map lookup.
+ String actualVersion;
+ if (!m_database->getActualVersionForTransaction(actualVersion)) {
+ m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to read version", m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
+ m_database->disableAuthorizer();
+ m_sqliteTransaction = nullptr;
+ m_database->enableAuthorizer();
+
+ handleTransactionError();
+ return;
+ }
+
+ m_hasVersionMismatch = !m_database->expectedVersion().isEmpty() && (m_database->expectedVersion() != actualVersion);
+
+ // Spec 4.3.2.3: Perform preflight steps, jumping to the error callback if they fail
+ if (m_wrapper && !m_wrapper->performPreflight(*this)) {
+ m_database->disableAuthorizer();
+ m_sqliteTransaction = nullptr;
+ m_database->enableAuthorizer();
+ m_transactionError = m_wrapper->sqlError();
+ if (!m_transactionError)
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unknown error occurred during transaction preflight");
+
+ handleTransactionError();
+ return;
+ }
+
+ // Spec 4.3.2.4: Invoke the transaction callback with the new SQLTransaction object
+ if (m_callbackWrapper.hasCallback()) {
+ requestTransitToState(SQLTransactionState::DeliverTransactionCallback);
+ return;
+ }
+
+ // If we have no callback to make, skip pass to the state after:
+ runStatements();
+}
+
+void SQLTransaction::runStatements()
+{
+ ASSERT(m_lockAcquired);
+
+ // If there is a series of statements queued up that are all successful and have no associated
+ // SQLStatementCallback objects, then we can burn through the queue
+ do {
+ if (m_shouldRetryCurrentStatement && !m_sqliteTransaction->wasRolledBackBySqlite()) {
+ m_shouldRetryCurrentStatement = false;
+ // FIXME - Another place that needs fixing up after <rdar://problem/5628468> is addressed.
+ // See ::openTransactionAndPreflight() for discussion
+
+ // Reset the maximum size here, as it was increased to allow us to retry this statement.
+ // m_shouldRetryCurrentStatement is set to true only when a statement exceeds
+ // the quota, which can happen only in a read-write transaction. Therefore, there
+ // is no need to check here if the transaction is read-write.
+ m_database->sqliteDatabase().setMaximumSize(m_database->maximumSize());
+ } else {
+ // If the current statement has already been run, failed due to quota constraints, and we're not retrying it,
+ // that means it ended in an error. Handle it now
+ if (m_currentStatement && m_currentStatement->lastExecutionFailedDueToQuota()) {
+ handleCurrentStatementError();
+ break;
+ }
+
+ // Otherwise, advance to the next statement
+ getNextStatement();
+ }
+ } while (runCurrentStatement());
+
+ // If runCurrentStatement() returned false, that means either there was no current statement to run,
+ // or the current statement requires a callback to complete. In the later case, it also scheduled
+ // the callback or performed any other additional work so we can return.
+ if (!m_currentStatement)
+ postflightAndCommit();
+}
+
+void SQLTransaction::cleanupAndTerminate()
+{
+ ASSERT(m_lockAcquired);
+
+ // Spec 4.3.2.9: End transaction steps. There is no next step.
+ LOG(StorageAPI, "Transaction %p is complete\n", this);
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+
+ // Phase 5 cleanup. See comment on the SQLTransaction life-cycle above.
+ m_backend.doCleanup();
+ m_database->inProgressTransactionCompleted();
+}
+
+void SQLTransaction::cleanupAfterTransactionErrorCallback()
+{
+ ASSERT(m_lockAcquired);
+
+ LOG(StorageAPI, "Transaction %p is complete with an error\n", this);
+ m_database->disableAuthorizer();
+ if (m_sqliteTransaction) {
+ // Spec 4.3.2.10: Rollback the transaction.
+ m_sqliteTransaction->rollback();
+
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+ m_sqliteTransaction = nullptr;
+ }
+ m_database->enableAuthorizer();
+
+ releaseOriginLockIfNeeded();
+
+ ASSERT(!m_database->sqliteDatabase().transactionInProgress());
+
+ cleanupAndTerminate();
+}
+
</ins><span class="cx"> void SQLTransaction::deliverTransactionCallback()
</span><span class="cx"> {
</span><span class="cx"> bool shouldDeliverErrorCallback = false;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h (204356 => 204357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h        2016-08-10 21:31:07 UTC (rev 204356)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h        2016-08-10 21:54:29 UTC (rev 204357)
</span><span class="lines">@@ -89,6 +89,11 @@
</span><span class="cx"> void computeNextStateAndCleanupIfNeeded();
</span><span class="cx">
</span><span class="cx"> // State functions:
</span><ins>+ void acquireLock();
+ void openTransactionAndPreflight();
+ void runStatements();
+ void cleanupAndTerminate();
+ void cleanupAfterTransactionErrorCallback();
</ins><span class="cx"> void deliverTransactionCallback();
</span><span class="cx"> void deliverTransactionErrorCallback();
</span><span class="cx"> void deliverStatementCallback();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (204356 => 204357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2016-08-10 21:31:07 UTC (rev 204356)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2016-08-10 21:54:29 UTC (rev 204357)
</span><span class="lines">@@ -480,157 +480,27 @@
</span><span class="cx">
</span><span class="cx"> void SQLTransactionBackend::acquireLock()
</span><span class="cx"> {
</span><del>- m_frontend.m_database->transactionCoordinator()->acquireLock(m_frontend);
</del><ins>+ m_frontend.acquireLock();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SQLTransactionBackend::openTransactionAndPreflight()
</span><span class="cx"> {
</span><del>- ASSERT(!m_frontend.m_database->sqliteDatabase().transactionInProgress());
- ASSERT(m_frontend.m_lockAcquired);
-
- LOG(StorageAPI, "Opening and preflighting transaction %p", this);
-
- // If the database was deleted, jump to the error callback
- if (m_frontend.m_database->deleted()) {
- m_frontend.m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to open a transaction, because the user deleted the database");
-
- m_frontend.handleTransactionError();
- return;
- }
-
- // Set the maximum usage for this transaction if this transactions is not read-only
- if (!m_frontend.m_readOnly) {
- m_frontend.acquireOriginLock();
- m_frontend.m_database->sqliteDatabase().setMaximumSize(m_frontend.m_database->maximumSize());
- }
-
- ASSERT(!m_frontend.m_sqliteTransaction);
- m_frontend.m_sqliteTransaction = std::make_unique<SQLiteTransaction>(m_frontend.m_database->sqliteDatabase(), m_frontend.m_readOnly);
-
- m_frontend.m_database->resetDeletes();
- m_frontend.m_database->disableAuthorizer();
- m_frontend.m_sqliteTransaction->begin();
- m_frontend.m_database->enableAuthorizer();
-
- // Spec 4.3.2.1+2: Open a transaction to the database, jumping to the error callback if that fails
- if (!m_frontend.m_sqliteTransaction->inProgress()) {
- ASSERT(!m_frontend.m_database->sqliteDatabase().transactionInProgress());
- m_frontend.m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to begin transaction", m_frontend.m_database->sqliteDatabase().lastError(), m_frontend.m_database->sqliteDatabase().lastErrorMsg());
- m_frontend.m_sqliteTransaction = nullptr;
-
- m_frontend.handleTransactionError();
- return;
- }
-
- // Note: We intentionally retrieve the actual version even with an empty expected version.
- // In multi-process browsers, we take this opportinutiy to update the cached value for
- // the actual version. In single-process browsers, this is just a map lookup.
- String actualVersion;
- if (!m_frontend.m_database->getActualVersionForTransaction(actualVersion)) {
- m_frontend.m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to read version", m_frontend.m_database->sqliteDatabase().lastError(), m_frontend.m_database->sqliteDatabase().lastErrorMsg());
- m_frontend.m_database->disableAuthorizer();
- m_frontend.m_sqliteTransaction = nullptr;
- m_frontend.m_database->enableAuthorizer();
-
- m_frontend.handleTransactionError();
- return;
- }
-
- m_frontend.m_hasVersionMismatch = !m_frontend.m_database->expectedVersion().isEmpty() && (m_frontend.m_database->expectedVersion() != actualVersion);
-
- // Spec 4.3.2.3: Perform preflight steps, jumping to the error callback if they fail
- if (m_frontend.m_wrapper && !m_frontend.m_wrapper->performPreflight(m_frontend)) {
- m_frontend.m_database->disableAuthorizer();
- m_frontend.m_sqliteTransaction = nullptr;
- m_frontend.m_database->enableAuthorizer();
- m_frontend.m_transactionError = m_frontend.m_wrapper->sqlError();
- if (!m_frontend.m_transactionError)
- m_frontend.m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unknown error occurred during transaction preflight");
-
- m_frontend.handleTransactionError();
- return;
- }
-
- // Spec 4.3.2.4: Invoke the transaction callback with the new SQLTransaction object
- if (m_frontend.m_callbackWrapper.hasCallback()) {
- m_frontend.requestTransitToState(SQLTransactionState::DeliverTransactionCallback);
- return;
- }
-
- // If we have no callback to make, skip pass to the state after:
- runStatements();
</del><ins>+ m_frontend.openTransactionAndPreflight();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SQLTransactionBackend::runStatements()
</span><span class="cx"> {
</span><del>- ASSERT(m_frontend.m_lockAcquired);
-
- // If there is a series of statements queued up that are all successful and have no associated
- // SQLStatementCallback objects, then we can burn through the queue
- do {
- if (m_frontend.m_shouldRetryCurrentStatement && !m_frontend.m_sqliteTransaction->wasRolledBackBySqlite()) {
- m_frontend.m_shouldRetryCurrentStatement = false;
- // FIXME - Another place that needs fixing up after <rdar://problem/5628468> is addressed.
- // See ::openTransactionAndPreflight() for discussion
-
- // Reset the maximum size here, as it was increased to allow us to retry this statement.
- // m_shouldRetryCurrentStatement is set to true only when a statement exceeds
- // the quota, which can happen only in a read-write transaction. Therefore, there
- // is no need to check here if the transaction is read-write.
- m_frontend.m_database->sqliteDatabase().setMaximumSize(m_frontend.m_database->maximumSize());
- } else {
- // If the current statement has already been run, failed due to quota constraints, and we're not retrying it,
- // that means it ended in an error. Handle it now
- if (m_frontend.m_currentStatement && m_frontend.m_currentStatement->lastExecutionFailedDueToQuota()) {
- m_frontend.handleCurrentStatementError();
- break;
- }
-
- // Otherwise, advance to the next statement
- m_frontend.getNextStatement();
- }
- } while (m_frontend.runCurrentStatement());
-
- // If runCurrentStatement() returned false, that means either there was no current statement to run,
- // or the current statement requires a callback to complete. In the later case, it also scheduled
- // the callback or performed any other additional work so we can return.
- if (!m_frontend.m_currentStatement)
- m_frontend.postflightAndCommit();
</del><ins>+ m_frontend.runStatements();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SQLTransactionBackend::cleanupAndTerminate()
</span><span class="cx"> {
</span><del>- ASSERT(m_frontend.m_lockAcquired);
-
- // Spec 4.3.2.9: End transaction steps. There is no next step.
- LOG(StorageAPI, "Transaction %p is complete\n", this);
- ASSERT(!m_frontend.m_database->sqliteDatabase().transactionInProgress());
-
- // Phase 5 cleanup. See comment on the SQLTransaction life-cycle above.
- doCleanup();
- m_frontend.m_database->inProgressTransactionCompleted();
</del><ins>+ m_frontend.cleanupAndTerminate();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SQLTransactionBackend::cleanupAfterTransactionErrorCallback()
</span><span class="cx"> {
</span><del>- ASSERT(m_frontend.m_lockAcquired);
-
- LOG(StorageAPI, "Transaction %p is complete with an error\n", this);
- m_frontend.m_database->disableAuthorizer();
- if (m_frontend.m_sqliteTransaction) {
- // Spec 4.3.2.10: Rollback the transaction.
- m_frontend.m_sqliteTransaction->rollback();
-
- ASSERT(!m_frontend.m_database->sqliteDatabase().transactionInProgress());
- m_frontend.m_sqliteTransaction = nullptr;
- }
- m_frontend.m_database->enableAuthorizer();
-
- m_frontend.releaseOriginLockIfNeeded();
-
- ASSERT(!m_frontend.m_database->sqliteDatabase().transactionInProgress());
-
- cleanupAndTerminate();
</del><ins>+ m_frontend.cleanupAfterTransactionErrorCallback();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // requestTransitToState() can be called from the frontend. Hence, it should
</span></span></pre>
</div>
</div>
</body>
</html>