| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 static_cast<int>(SQLTransactionState::NumberOfStates)); | 494 static_cast<int>(SQLTransactionState::NumberOfStates)); |
| 495 ASSERT(state < SQLTransactionState::NumberOfStates); | 495 ASSERT(state < SQLTransactionState::NumberOfStates); |
| 496 | 496 |
| 497 return stateFunctions[static_cast<int>(state)]; | 497 return stateFunctions[static_cast<int>(state)]; |
| 498 } | 498 } |
| 499 | 499 |
| 500 void SQLTransactionBackend::enqueueStatementBackend( | 500 void SQLTransactionBackend::enqueueStatementBackend( |
| 501 SQLStatementBackend* statementBackend) { | 501 SQLStatementBackend* statementBackend) { |
| 502 DCHECK(isMainThread()); | 502 DCHECK(isMainThread()); |
| 503 MutexLocker locker(m_statementMutex); | 503 MutexLocker locker(m_statementMutex); |
| 504 m_statementQueue.append(statementBackend); | 504 m_statementQueue.push_back(statementBackend); |
| 505 } | 505 } |
| 506 | 506 |
| 507 void SQLTransactionBackend::computeNextStateAndCleanupIfNeeded() { | 507 void SQLTransactionBackend::computeNextStateAndCleanupIfNeeded() { |
| 508 DCHECK( | 508 DCHECK( |
| 509 database()->getDatabaseContext()->databaseThread()->isDatabaseThread()); | 509 database()->getDatabaseContext()->databaseThread()->isDatabaseThread()); |
| 510 // Only honor the requested state transition if we're not supposed to be | 510 // Only honor the requested state transition if we're not supposed to be |
| 511 // cleaning up and shutting down: | 511 // cleaning up and shutting down: |
| 512 if (m_database->opened()) { | 512 if (m_database->opened()) { |
| 513 setStateToRequestedState(); | 513 setStateToRequestedState(); |
| 514 ASSERT(m_nextState == SQLTransactionState::AcquireLock || | 514 ASSERT(m_nextState == SQLTransactionState::AcquireLock || |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 return SQLTransactionState::End; | 889 return SQLTransactionState::End; |
| 890 } | 890 } |
| 891 | 891 |
| 892 SQLTransactionState SQLTransactionBackend::sendToFrontendState() { | 892 SQLTransactionState SQLTransactionBackend::sendToFrontendState() { |
| 893 ASSERT(m_nextState != SQLTransactionState::Idle); | 893 ASSERT(m_nextState != SQLTransactionState::Idle); |
| 894 m_frontend->requestTransitToState(m_nextState); | 894 m_frontend->requestTransitToState(m_nextState); |
| 895 return SQLTransactionState::Idle; | 895 return SQLTransactionState::Idle; |
| 896 } | 896 } |
| 897 | 897 |
| 898 } // namespace blink | 898 } // namespace blink |
| OLD | NEW |