| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void DatabaseBackend::scheduleTransaction() | 141 void DatabaseBackend::scheduleTransaction() |
| 142 { | 142 { |
| 143 ASSERT(!m_transactionInProgressMutex.tryLock()); // Locked by caller. | 143 ASSERT(!m_transactionInProgressMutex.tryLock()); // Locked by caller. |
| 144 RefPtr<SQLTransactionBackend> transaction; | 144 RefPtr<SQLTransactionBackend> transaction; |
| 145 | 145 |
| 146 if (m_isTransactionQueueEnabled && !m_transactionQueue.isEmpty()) | 146 if (m_isTransactionQueueEnabled && !m_transactionQueue.isEmpty()) |
| 147 transaction = m_transactionQueue.takeFirst(); | 147 transaction = m_transactionQueue.takeFirst(); |
| 148 | 148 |
| 149 if (transaction && databaseContext()->databaseThread()) { | 149 if (transaction && databaseContext()->databaseThread()) { |
| 150 OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(t
ransaction); | 150 OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(t
ransaction); |
| 151 LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transaction %
p\n", task.get(), task->transaction()); | 151 LOG_INFO(StorageAPI, "Scheduling DatabaseTransactionTask %p for transact
ion %p\n", task.get(), task->transaction()); |
| 152 m_transactionInProgress = true; | 152 m_transactionInProgress = true; |
| 153 databaseContext()->databaseThread()->scheduleTask(task.release()); | 153 databaseContext()->databaseThread()->scheduleTask(task.release()); |
| 154 } else | 154 } else |
| 155 m_transactionInProgress = false; | 155 m_transactionInProgress = false; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void DatabaseBackend::scheduleTransactionStep(SQLTransactionBackend* transaction
) | 158 void DatabaseBackend::scheduleTransactionStep(SQLTransactionBackend* transaction
) |
| 159 { | 159 { |
| 160 if (!databaseContext()->databaseThread()) | 160 if (!databaseContext()->databaseThread()) |
| 161 return; | 161 return; |
| 162 | 162 |
| 163 OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(trans
action); | 163 OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(trans
action); |
| 164 LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for the transaction s
tep\n", task.get()); | 164 LOG_INFO(StorageAPI, "Scheduling DatabaseTransactionTask %p for the transact
ion step\n", task.get()); |
| 165 databaseContext()->databaseThread()->scheduleTask(task.release()); | 165 databaseContext()->databaseThread()->scheduleTask(task.release()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 SQLTransactionClient* DatabaseBackend::transactionClient() const | 168 SQLTransactionClient* DatabaseBackend::transactionClient() const |
| 169 { | 169 { |
| 170 return databaseContext()->databaseThread()->transactionClient(); | 170 return databaseContext()->databaseThread()->transactionClient(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 SQLTransactionCoordinator* DatabaseBackend::transactionCoordinator() const | 173 SQLTransactionCoordinator* DatabaseBackend::transactionCoordinator() const |
| 174 { | 174 { |
| 175 return databaseContext()->databaseThread()->transactionCoordinator(); | 175 return databaseContext()->databaseThread()->transactionCoordinator(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace WebCore | 178 } // namespace WebCore |
| 179 | 179 |
| 180 #endif // ENABLE(SQL_DATABASE) | 180 #endif // ENABLE(SQL_DATABASE) |
| OLD | NEW |