diff options
Diffstat (limited to 'WebCore/storage/SQLTransaction.cpp')
-rw-r--r-- | WebCore/storage/SQLTransaction.cpp | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp index dc48ae1..3331e6e 100644 --- a/WebCore/storage/SQLTransaction.cpp +++ b/WebCore/storage/SQLTransaction.cpp @@ -50,7 +50,6 @@ #include "SQLStatement.h" #include "SQLStatementCallback.h" #include "SQLStatementErrorCallback.h" -#include "SQLTransactionCoordinator.h" #include "SQLValue.h" // There's no way of knowing exactly how much more space will be required when a statement hits the quota limit. @@ -68,7 +67,7 @@ PassRefPtr<SQLTransaction> SQLTransaction::create(Database* db, PassRefPtr<SQLTr SQLTransaction::SQLTransaction(Database* db, PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback, PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionWrapper> wrapper) - : m_nextStep(&SQLTransaction::acquireLock) + : m_nextStep(&SQLTransaction::openTransactionAndPreflight) , m_executeSqlAllowed(false) , m_database(db) , m_wrapper(wrapper) @@ -77,7 +76,6 @@ SQLTransaction::SQLTransaction(Database* db, PassRefPtr<SQLTransactionCallback> , m_errorCallback(errorCallback) , m_shouldRetryCurrentStatement(false) , m_modifiedDatabase(false) - , m_lockAcquired(false) { ASSERT(m_database); } @@ -118,9 +116,7 @@ void SQLTransaction::enqueueStatement(PassRefPtr<SQLStatement> statement) #ifndef NDEBUG const char* SQLTransaction::debugStepName(SQLTransaction::TransactionStepMethod step) { - if (step == &SQLTransaction::acquireLock) - return "acquireLock"; - else if (step == &SQLTransaction::openTransactionAndPreflight) + if (step == &SQLTransaction::openTransactionAndPreflight) return "openTransactionAndPreflight"; else if (step == &SQLTransaction::runStatements) return "runStatements"; @@ -161,9 +157,6 @@ void SQLTransaction::checkAndHandleClosedDatabase() m_sqliteTransaction->stop(); m_sqliteTransaction.clear(); } - - if (m_lockAcquired) - m_database->transactionCoordinator()->releaseLock(this); } @@ -171,8 +164,7 @@ bool SQLTransaction::performNextStep() { LOG(StorageAPI, "Step %s\n", debugStepName(m_nextStep)); - ASSERT(m_nextStep == &SQLTransaction::acquireLock || - m_nextStep == &SQLTransaction::openTransactionAndPreflight || + ASSERT(m_nextStep == &SQLTransaction::openTransactionAndPreflight || m_nextStep == &SQLTransaction::runStatements || m_nextStep == &SQLTransaction::postflightAndCommit || m_nextStep == &SQLTransaction::cleanupAfterSuccessCallback || @@ -203,23 +195,9 @@ void SQLTransaction::performPendingCallback() (this->*m_nextStep)(); } -void SQLTransaction::acquireLock() -{ - m_database->transactionCoordinator()->acquireLock(this); -} - -void SQLTransaction::lockAcquired() -{ - m_lockAcquired = true; - m_nextStep = &SQLTransaction::openTransactionAndPreflight; - LOG(StorageAPI, "Scheduling openTransactionAndPreflight immediately for transaction %p\n", this); - m_database->scheduleTransactionStep(this, true); -} - void SQLTransaction::openTransactionAndPreflight() { ASSERT(!m_database->m_sqliteDatabase.transactionInProgress()); - ASSERT(m_lockAcquired); LOG(StorageAPI, "Opening and preflighting transaction %p", this); @@ -295,8 +273,6 @@ void SQLTransaction::scheduleToRunStatements() 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 { @@ -435,8 +411,6 @@ void SQLTransaction::deliverQuotaIncreaseCallback() void SQLTransaction::postflightAndCommit() { - ASSERT(m_lockAcquired); - // Transaction Step 7 - Peform postflight steps, jumping to the error callback if they fail if (m_wrapper && !m_wrapper->performPostflight(this)) { m_transactionError = m_wrapper->sqlError(); @@ -495,16 +469,11 @@ void SQLTransaction::deliverSuccessCallback() void SQLTransaction::cleanupAfterSuccessCallback() { - ASSERT(m_lockAcquired); - // Transaction Step 11 - End transaction steps // There is no next step LOG(StorageAPI, "Transaction %p is complete\n", this); ASSERT(!m_database->m_sqliteDatabase.transactionInProgress()); m_nextStep = 0; - - // Release the lock on this database - m_database->transactionCoordinator()->releaseLock(this); } void SQLTransaction::handleTransactionError(bool inCallback) @@ -547,8 +516,6 @@ void SQLTransaction::deliverTransactionErrorCallback() void SQLTransaction::cleanupAfterTransactionErrorCallback() { - ASSERT(m_lockAcquired); - m_database->m_databaseAuthorizer->disable(); if (m_sqliteTransaction) { // Transaction Step 12 - Rollback the transaction. @@ -573,9 +540,6 @@ void SQLTransaction::cleanupAfterTransactionErrorCallback() // Now release our callbacks, to break reference cycles. m_callback = 0; m_errorCallback = 0; - - // Now release the lock on this database - m_database->transactionCoordinator()->releaseLock(this); } } // namespace WebCore |