| 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 bool readOnly, | 853 bool readOnly, |
| 854 const ChangeVersionData* changeVersionData) { | 854 const ChangeVersionData* changeVersionData) { |
| 855 if (!getExecutionContext()) | 855 if (!getExecutionContext()) |
| 856 return; | 856 return; |
| 857 | 857 |
| 858 ASSERT(getExecutionContext()->isContextThread()); | 858 ASSERT(getExecutionContext()->isContextThread()); |
| 859 // FIXME: Rather than passing errorCallback to SQLTransaction and then | 859 // FIXME: Rather than passing errorCallback to SQLTransaction and then |
| 860 // sometimes firing it ourselves, this code should probably be pushed down | 860 // sometimes firing it ourselves, this code should probably be pushed down |
| 861 // into Database so that we only create the SQLTransaction if we're | 861 // into Database so that we only create the SQLTransaction if we're |
| 862 // actually going to run it. | 862 // actually going to run it. |
| 863 #if ENABLE(ASSERT) | 863 #if DCHECK_IS_ON() |
| 864 SQLTransactionErrorCallback* originalErrorCallback = errorCallback; | 864 SQLTransactionErrorCallback* originalErrorCallback = errorCallback; |
| 865 #endif | 865 #endif |
| 866 SQLTransaction* transaction = SQLTransaction::create( | 866 SQLTransaction* transaction = SQLTransaction::create( |
| 867 this, callback, successCallback, errorCallback, readOnly); | 867 this, callback, successCallback, errorCallback, readOnly); |
| 868 SQLTransactionBackend* transactionBackend = | 868 SQLTransactionBackend* transactionBackend = |
| 869 runTransaction(transaction, readOnly, changeVersionData); | 869 runTransaction(transaction, readOnly, changeVersionData); |
| 870 if (!transactionBackend) { | 870 if (!transactionBackend) { |
| 871 SQLTransactionErrorCallback* callback = transaction->releaseErrorCallback(); | 871 SQLTransactionErrorCallback* callback = transaction->releaseErrorCallback(); |
| 872 ASSERT(callback == originalErrorCallback); | 872 ASSERT(callback == originalErrorCallback); |
| 873 if (callback) { | 873 if (callback) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 if (getDatabaseContext()->databaseThread()->isDatabaseThread()) | 946 if (getDatabaseContext()->databaseThread()->isDatabaseThread()) |
| 947 return m_databaseThreadSecurityOrigin.get(); | 947 return m_databaseThreadSecurityOrigin.get(); |
| 948 return nullptr; | 948 return nullptr; |
| 949 } | 949 } |
| 950 | 950 |
| 951 bool Database::opened() { | 951 bool Database::opened() { |
| 952 return static_cast<bool>(acquireLoad(&m_opened)); | 952 return static_cast<bool>(acquireLoad(&m_opened)); |
| 953 } | 953 } |
| 954 | 954 |
| 955 } // namespace blink | 955 } // namespace blink |
| OLD | NEW |