| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 IDB_TRACE("IDBTransactionBackendImpl::commit"); | 190 IDB_TRACE("IDBTransactionBackendImpl::commit"); |
| 191 // The last reference to this object may be released while performing the | 191 // The last reference to this object may be released while performing the |
| 192 // commit steps below. We therefore take a self reference to keep ourselves | 192 // commit steps below. We therefore take a self reference to keep ourselves |
| 193 // alive while executing this method. | 193 // alive while executing this method. |
| 194 RefPtr<IDBTransactionBackendImpl> self(this); | 194 RefPtr<IDBTransactionBackendImpl> self(this); |
| 195 ASSERT(m_state == Running); | 195 ASSERT(m_state == Running); |
| 196 ASSERT(m_taskQueue.isEmpty()); | 196 ASSERT(m_taskQueue.isEmpty()); |
| 197 | 197 |
| 198 m_state = Finished; | 198 m_state = Finished; |
| 199 closeOpenCursors(); | 199 closeOpenCursors(); |
| 200 m_transaction->commit(); | 200 if (m_transaction->commit()) |
| 201 m_callbacks->onComplete(); | 201 m_callbacks->onComplete(); |
| 202 else |
| 203 m_callbacks->onAbort(); |
| 202 m_database->transactionCoordinator()->didFinishTransaction(this); | 204 m_database->transactionCoordinator()->didFinishTransaction(this); |
| 203 m_database->transactionFinished(this); | 205 m_database->transactionFinished(this); |
| 204 m_database = 0; | 206 m_database = 0; |
| 205 } | 207 } |
| 206 | 208 |
| 207 void IDBTransactionBackendImpl::taskTimerFired(Timer<IDBTransactionBackendImpl>*
) | 209 void IDBTransactionBackendImpl::taskTimerFired(Timer<IDBTransactionBackendImpl>*
) |
| 208 { | 210 { |
| 209 IDB_TRACE("IDBTransactionBackendImpl::taskTimerFired"); | 211 IDB_TRACE("IDBTransactionBackendImpl::taskTimerFired"); |
| 210 ASSERT(!m_taskQueue.isEmpty()); | 212 ASSERT(!m_taskQueue.isEmpty()); |
| 211 | 213 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void IDBTransactionBackendImpl::closeOpenCursors() | 249 void IDBTransactionBackendImpl::closeOpenCursors() |
| 248 { | 250 { |
| 249 for (HashSet<IDBCursorBackendImpl*>::iterator i = m_openCursors.begin(); i !
= m_openCursors.end(); ++i) | 251 for (HashSet<IDBCursorBackendImpl*>::iterator i = m_openCursors.begin(); i !
= m_openCursors.end(); ++i) |
| 250 (*i)->close(); | 252 (*i)->close(); |
| 251 m_openCursors.clear(); | 253 m_openCursors.clear(); |
| 252 } | 254 } |
| 253 | 255 |
| 254 }; | 256 }; |
| 255 | 257 |
| 256 #endif // ENABLE(INDEXED_DATABASE) | 258 #endif // ENABLE(INDEXED_DATABASE) |
| OLD | NEW |