| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // Spec 4.3.2 4: Invoke the transaction callback with the new SQLTransaction
object | 157 // Spec 4.3.2 4: Invoke the transaction callback with the new SQLTransaction
object |
| 158 if (SQLTransactionCallback* callback = m_callback.release()) { | 158 if (SQLTransactionCallback* callback = m_callback.release()) { |
| 159 m_executeSqlAllowed = true; | 159 m_executeSqlAllowed = true; |
| 160 shouldDeliverErrorCallback = !callback->handleEvent(this); | 160 shouldDeliverErrorCallback = !callback->handleEvent(this); |
| 161 m_executeSqlAllowed = false; | 161 m_executeSqlAllowed = false; |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Spec 4.3.2 5: If the transaction callback was null or raised an exception
, jump to the error callback | 164 // Spec 4.3.2 5: If the transaction callback was null or raised an exception
, jump to the error callback |
| 165 SQLTransactionState nextState = SQLTransactionState::RunStatements; | 165 SQLTransactionState nextState = SQLTransactionState::RunStatements; |
| 166 if (shouldDeliverErrorCallback) { | 166 if (shouldDeliverErrorCallback) { |
| 167 m_database->reportStartTransactionResult(5, SQLError::UNKNOWN_ERR, 0); | 167 m_database->reportStartTransactionResult(5, SQLError::kUnknownErr, 0); |
| 168 m_transactionError = SQLErrorData::create(SQLError::UNKNOWN_ERR, "the SQ
LTransactionCallback was null or threw an exception"); | 168 m_transactionError = SQLErrorData::create(SQLError::kUnknownErr, "the SQ
LTransactionCallback was null or threw an exception"); |
| 169 nextState = SQLTransactionState::DeliverTransactionErrorCallback; | 169 nextState = SQLTransactionState::DeliverTransactionErrorCallback; |
| 170 } | 170 } |
| 171 m_database->reportStartTransactionResult(0, -1, 0); // OK | 171 m_database->reportStartTransactionResult(0, -1, 0); // OK |
| 172 return nextState; | 172 return nextState; |
| 173 } | 173 } |
| 174 | 174 |
| 175 SQLTransactionState SQLTransaction::deliverTransactionErrorCallback() | 175 SQLTransactionState SQLTransaction::deliverTransactionErrorCallback() |
| 176 { | 176 { |
| 177 InspectorInstrumentation::AsyncTask asyncTask(m_database->getExecutionContex
t(), this); | 177 InspectorInstrumentation::AsyncTask asyncTask(m_database->getExecutionContex
t(), this); |
| 178 InspectorInstrumentation::asyncTaskCanceled(m_database->getExecutionContext(
), this); | 178 InspectorInstrumentation::asyncTaskCanceled(m_database->getExecutionContext(
), this); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 208 m_executeSqlAllowed = true; | 208 m_executeSqlAllowed = true; |
| 209 | 209 |
| 210 SQLStatement* currentStatement = m_backend->currentStatement(); | 210 SQLStatement* currentStatement = m_backend->currentStatement(); |
| 211 ASSERT(currentStatement); | 211 ASSERT(currentStatement); |
| 212 | 212 |
| 213 bool result = currentStatement->performCallback(this); | 213 bool result = currentStatement->performCallback(this); |
| 214 | 214 |
| 215 m_executeSqlAllowed = false; | 215 m_executeSqlAllowed = false; |
| 216 | 216 |
| 217 if (result) { | 217 if (result) { |
| 218 m_database->reportCommitTransactionResult(2, SQLError::UNKNOWN_ERR, 0); | 218 m_database->reportCommitTransactionResult(2, SQLError::kUnknownErr, 0); |
| 219 m_transactionError = SQLErrorData::create(SQLError::UNKNOWN_ERR, "the st
atement callback raised an exception or statement error callback did not return
false"); | 219 m_transactionError = SQLErrorData::create(SQLError::kUnknownErr, "the st
atement callback raised an exception or statement error callback did not return
false"); |
| 220 return nextStateForTransactionError(); | 220 return nextStateForTransactionError(); |
| 221 } | 221 } |
| 222 return SQLTransactionState::RunStatements; | 222 return SQLTransactionState::RunStatements; |
| 223 } | 223 } |
| 224 | 224 |
| 225 SQLTransactionState SQLTransaction::deliverQuotaIncreaseCallback() | 225 SQLTransactionState SQLTransaction::deliverQuotaIncreaseCallback() |
| 226 { | 226 { |
| 227 DCHECK(isMainThread()); | 227 DCHECK(isMainThread()); |
| 228 ASSERT(m_backend->currentStatement()); | 228 ASSERT(m_backend->currentStatement()); |
| 229 | 229 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 m_successCallback.clear(); | 338 m_successCallback.clear(); |
| 339 m_errorCallback.clear(); | 339 m_errorCallback.clear(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 SQLTransactionErrorCallback* SQLTransaction::releaseErrorCallback() | 342 SQLTransactionErrorCallback* SQLTransaction::releaseErrorCallback() |
| 343 { | 343 { |
| 344 return m_errorCallback.release(); | 344 return m_errorCallback.release(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace blink | 347 } // namespace blink |
| OLD | NEW |