| 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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 // actually going to run it. | 829 // actually going to run it. |
| 830 #if ENABLE(ASSERT) | 830 #if ENABLE(ASSERT) |
| 831 SQLTransactionErrorCallback* originalErrorCallback = errorCallback; | 831 SQLTransactionErrorCallback* originalErrorCallback = errorCallback; |
| 832 #endif | 832 #endif |
| 833 SQLTransaction* transaction = SQLTransaction::create(this, callback, success
Callback, errorCallback, readOnly); | 833 SQLTransaction* transaction = SQLTransaction::create(this, callback, success
Callback, errorCallback, readOnly); |
| 834 SQLTransactionBackend* transactionBackend = runTransaction(transaction, read
Only, changeVersionData); | 834 SQLTransactionBackend* transactionBackend = runTransaction(transaction, read
Only, changeVersionData); |
| 835 if (!transactionBackend) { | 835 if (!transactionBackend) { |
| 836 SQLTransactionErrorCallback* callback = transaction->releaseErrorCallbac
k(); | 836 SQLTransactionErrorCallback* callback = transaction->releaseErrorCallbac
k(); |
| 837 ASSERT(callback == originalErrorCallback); | 837 ASSERT(callback == originalErrorCallback); |
| 838 if (callback) { | 838 if (callback) { |
| 839 std::unique_ptr<SQLErrorData> error = SQLErrorData::create(SQLError:
:UNKNOWN_ERR, "database has been closed"); | 839 std::unique_ptr<SQLErrorData> error = SQLErrorData::create(SQLError:
:kUnknownErr, "database has been closed"); |
| 840 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTas
k(&callTransactionErrorCallback, wrapPersistent(callback), passed(std::move(erro
r)))); | 840 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTas
k(&callTransactionErrorCallback, wrapPersistent(callback), passed(std::move(erro
r)))); |
| 841 } | 841 } |
| 842 } | 842 } |
| 843 } | 843 } |
| 844 | 844 |
| 845 void Database::scheduleTransactionCallback(SQLTransaction* transaction) | 845 void Database::scheduleTransactionCallback(SQLTransaction* transaction) |
| 846 { | 846 { |
| 847 // The task is constructed in a database thread, and destructed in the | 847 // The task is constructed in a database thread, and destructed in the |
| 848 // context thread. | 848 // context thread. |
| 849 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLT
ransaction::performPendingCallback, wrapCrossThreadPersistent(transaction))); | 849 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLT
ransaction::performPendingCallback, wrapCrossThreadPersistent(transaction))); |
| (...skipping 53 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 |