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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 } | 463 } |
464 | 464 |
465 void SQLTransactionBackend::setShouldRetryCurrentStatement(bool shouldRetry) { | 465 void SQLTransactionBackend::setShouldRetryCurrentStatement(bool shouldRetry) { |
466 ASSERT(!m_shouldRetryCurrentStatement); | 466 ASSERT(!m_shouldRetryCurrentStatement); |
467 m_shouldRetryCurrentStatement = shouldRetry; | 467 m_shouldRetryCurrentStatement = shouldRetry; |
468 } | 468 } |
469 | 469 |
470 SQLTransactionBackend::StateFunction SQLTransactionBackend::stateFunctionFor( | 470 SQLTransactionBackend::StateFunction SQLTransactionBackend::stateFunctionFor( |
471 SQLTransactionState state) { | 471 SQLTransactionState state) { |
472 static const StateFunction stateFunctions[] = { | 472 static const StateFunction stateFunctions[] = { |
473 &SQLTransactionBackend::unreachableState, // 0. end | 473 &SQLTransactionBackend::unreachableState, // 0. end |
474 &SQLTransactionBackend::unreachableState, // 1. idle | 474 &SQLTransactionBackend::unreachableState, // 1. idle |
475 &SQLTransactionBackend::acquireLock, // 2. | 475 &SQLTransactionBackend::acquireLock, // 2. |
476 &SQLTransactionBackend::openTransactionAndPreflight, // 3. | 476 &SQLTransactionBackend::openTransactionAndPreflight, // 3. |
477 &SQLTransactionBackend::runStatements, // 4. | 477 &SQLTransactionBackend::runStatements, // 4. |
478 &SQLTransactionBackend::postflightAndCommit, // 5. | 478 &SQLTransactionBackend::postflightAndCommit, // 5. |
479 &SQLTransactionBackend::cleanupAndTerminate, // 6. | 479 &SQLTransactionBackend::cleanupAndTerminate, // 6. |
480 &SQLTransactionBackend::cleanupAfterTransactionErrorCallback, // 7. | 480 &SQLTransactionBackend:: |
481 // 8. deliverTransactionCallback | 481 cleanupAfterTransactionErrorCallback, // 7. |
| 482 // 8. |
| 483 // deliverTransactionCallback |
482 &SQLTransactionBackend::sendToFrontendState, | 484 &SQLTransactionBackend::sendToFrontendState, |
483 // 9. deliverTransactionErrorCallback | 485 // 9. deliverTransactionErrorCallback |
484 &SQLTransactionBackend::sendToFrontendState, | 486 &SQLTransactionBackend::sendToFrontendState, |
485 // 10. deliverStatementCallback | 487 // 10. deliverStatementCallback |
486 &SQLTransactionBackend::sendToFrontendState, | 488 &SQLTransactionBackend::sendToFrontendState, |
487 // 11. deliverQuotaIncreaseCallback | 489 // 11. deliverQuotaIncreaseCallback |
488 &SQLTransactionBackend::sendToFrontendState, | 490 &SQLTransactionBackend::sendToFrontendState, |
489 // 12. deliverSuccessCallback | 491 // 12. deliverSuccessCallback |
490 &SQLTransactionBackend::sendToFrontendState, | 492 &SQLTransactionBackend::sendToFrontendState, |
491 }; | 493 }; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 return SQLTransactionState::End; | 891 return SQLTransactionState::End; |
890 } | 892 } |
891 | 893 |
892 SQLTransactionState SQLTransactionBackend::sendToFrontendState() { | 894 SQLTransactionState SQLTransactionBackend::sendToFrontendState() { |
893 ASSERT(m_nextState != SQLTransactionState::Idle); | 895 ASSERT(m_nextState != SQLTransactionState::Idle); |
894 m_frontend->requestTransitToState(m_nextState); | 896 m_frontend->requestTransitToState(m_nextState); |
895 return SQLTransactionState::Idle; | 897 return SQLTransactionState::Idle; |
896 } | 898 } |
897 | 899 |
898 } // namespace blink | 900 } // namespace blink |
OLD | NEW |