Index: Source/modules/webdatabase/SQLTransaction.cpp |
diff --git a/Source/modules/webdatabase/SQLTransaction.cpp b/Source/modules/webdatabase/SQLTransaction.cpp |
index 89d2d42f3b3bc82baf486dfd8d4b9c2f5f8dd191..866459773200dec024fdf94050c161647ebc98c8 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,13 @@ 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) { |
+ ASSERT(m_backend->transactionError()); |
+ m_transactionError = SQLErrorData::create(*m_backend->transactionError()); |
+ } |
ASSERT(m_transactionError); |
- errorCallback->handleEvent(m_transactionError.get()); |
+ RefPtrWillBeRawPtr<SQLError> error = SQLError::create(*m_transactionError); |
+ errorCallback->handleEvent(error.get()); |
m_transactionError = nullptr; |
} |
@@ -205,7 +207,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; |