Chromium Code Reviews| Index: Source/modules/webdatabase/SQLTransaction.cpp |
| diff --git a/Source/modules/webdatabase/SQLTransaction.cpp b/Source/modules/webdatabase/SQLTransaction.cpp |
| index 89d2d42f3b3bc82baf486dfd8d4b9c2f5f8dd191..e6268527be6497703929a76c517d0d0c6f70bec2 100644 |
| --- a/Source/modules/webdatabase/SQLTransaction.cpp |
| +++ b/Source/modules/webdatabase/SQLTransaction.cpp |
| @@ -157,7 +157,7 @@ SQLTransactionState SQLTransaction::deliverTransactionCallback() |
| SQLTransactionState nextState = SQLTransactionState::RunStatements; |
| if (shouldDeliverErrorCallback) { |
| m_database->reportStartTransactionResult(5, SQLError::UNKNOWN_ERR, 0); |
| - m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "the SQLTransactionCallback was null or threw an exception"); |
| + m_transactionError = SQLErrorData::create(SQLError::UNKNOWN_ERR, "the SQLTransactionCallback was null or threw an exception"); |
| nextState = SQLTransactionState::DeliverTransactionErrorCallback; |
| } |
| m_database->reportStartTransactionResult(0, -1, 0); // OK |
| @@ -174,11 +174,12 @@ SQLTransactionState SQLTransaction::deliverTransactionErrorCallback() |
| // must be waiting in the idle state waiting for this state to finish. |
| // Hence, it's thread safe to fetch the backend transactionError without |
| // a lock. |
| - if (!m_transactionError) |
| - m_transactionError = m_backend->transactionError(); |
| + if (!m_transactionError && m_backend->transactionError()) |
| + m_transactionError = SQLErrorData::create(*m_backend->transactionError()); |
|
haraken
2014/03/25 11:50:05
I think you should add ASSERT(m_backend->transacti
tkent
2014/03/25 22:07:13
Done.
|
| ASSERT(m_transactionError); |
| - errorCallback->handleEvent(m_transactionError.get()); |
| + RefPtrWillBeRawPtr<SQLError> error = SQLError::create(*m_transactionError); |
| + errorCallback->handleEvent(error.get()); |
| m_transactionError = nullptr; |
| } |
| @@ -205,7 +206,7 @@ SQLTransactionState SQLTransaction::deliverStatementCallback() |
| if (result) { |
| m_database->reportCommitTransactionResult(2, SQLError::UNKNOWN_ERR, 0); |
| - m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "the statement callback raised an exception or statement error callback did not return false"); |
| + m_transactionError = SQLErrorData::create(SQLError::UNKNOWN_ERR, "the statement callback raised an exception or statement error callback did not return false"); |
| return nextStateForTransactionError(); |
| } |
| return SQLTransactionState::RunStatements; |