void SQLTransaction::scheduleCallback(void (SQLTransaction::*step)()) { m_nextStep = step; LOG(StorageAPI, "Scheduling %s for transaction %p\n", debugStepName(step), this); m_database->scheduleTransactionCallback(this); }
void SQLTransaction::performPendingCallback() { LOG(StorageAPI, "Callback %s\n", debugStepName(m_nextStep)); ASSERT(m_nextStep == &SQLTransaction::deliverTransactionCallback || m_nextStep == &SQLTransaction::deliverTransactionErrorCallback || m_nextStep == &SQLTransaction::deliverStatementCallback || m_nextStep == &SQLTransaction::deliverQuotaIncreaseCallback || m_nextStep == &SQLTransaction::deliverSuccessCallback); checkAndHandleClosedOrInterruptedDatabase(); if (m_nextStep) (this->*m_nextStep)(); }
bool SQLTransaction::performNextStep() { LOG(StorageAPI, "Step %s\n", debugStepName(m_nextStep)); ASSERT(m_nextStep == &SQLTransaction::acquireLock || m_nextStep == &SQLTransaction::openTransactionAndPreflight || m_nextStep == &SQLTransaction::runStatements || m_nextStep == &SQLTransaction::postflightAndCommit || m_nextStep == &SQLTransaction::cleanupAfterSuccessCallback || m_nextStep == &SQLTransaction::cleanupAfterTransactionErrorCallback); checkAndHandleClosedOrInterruptedDatabase(); if (m_nextStep) (this->*m_nextStep)(); // If there is no nextStep after performing the above step, the transaction is complete return !m_nextStep; }