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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 void Database::scheduleTransaction() | 326 void Database::scheduleTransaction() |
327 { | 327 { |
328 ASSERT(!m_transactionInProgressMutex.tryLock()); // Locked by caller. | 328 ASSERT(!m_transactionInProgressMutex.tryLock()); // Locked by caller. |
329 SQLTransactionBackend* transaction = nullptr; | 329 SQLTransactionBackend* transaction = nullptr; |
330 | 330 |
331 if (m_isTransactionQueueEnabled && !m_transactionQueue.isEmpty()) | 331 if (m_isTransactionQueueEnabled && !m_transactionQueue.isEmpty()) |
332 transaction = m_transactionQueue.takeFirst(); | 332 transaction = m_transactionQueue.takeFirst(); |
333 | 333 |
334 if (transaction && getDatabaseContext()->databaseThreadAvailable()) { | 334 if (transaction && getDatabaseContext()->databaseThreadAvailable()) { |
335 OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(t
ransaction); | 335 OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(t
ransaction); |
336 WTF_LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transacti
on %p\n", task.get(), task->transaction()); | 336 WTF_LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transacti
on %p\n", task.get(), task->transaction().unsafeGet()); |
337 m_transactionInProgress = true; | 337 m_transactionInProgress = true; |
338 getDatabaseContext()->databaseThread()->scheduleTask(std::move(task)); | 338 getDatabaseContext()->databaseThread()->scheduleTask(std::move(task)); |
339 } else { | 339 } else { |
340 m_transactionInProgress = false; | 340 m_transactionInProgress = false; |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 void Database::scheduleTransactionStep(SQLTransactionBackend* transaction) | 344 void Database::scheduleTransactionStep(SQLTransactionBackend* transaction) |
345 { | 345 { |
346 if (!getDatabaseContext()->databaseThreadAvailable()) | 346 if (!getDatabaseContext()->databaseThreadAvailable()) |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 return m_databaseThreadSecurityOrigin.get(); | 903 return m_databaseThreadSecurityOrigin.get(); |
904 return 0; | 904 return 0; |
905 } | 905 } |
906 | 906 |
907 bool Database::opened() | 907 bool Database::opened() |
908 { | 908 { |
909 return static_cast<bool>(acquireLoad(&m_opened)); | 909 return static_cast<bool>(acquireLoad(&m_opened)); |
910 } | 910 } |
911 | 911 |
912 } // namespace blink | 912 } // namespace blink |
OLD | NEW |