| 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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 ASSERT(callback == originalErrorCallback); | 842 ASSERT(callback == originalErrorCallback); |
| 843 if (callback) { | 843 if (callback) { |
| 844 OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_
ERR, "database has been closed"); | 844 OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_
ERR, "database has been closed"); |
| 845 executionContext()->postTask(createCrossThreadTask(&callTransactionE
rrorCallback, callback, error.release())); | 845 executionContext()->postTask(createCrossThreadTask(&callTransactionE
rrorCallback, callback, error.release())); |
| 846 } | 846 } |
| 847 } | 847 } |
| 848 } | 848 } |
| 849 | 849 |
| 850 // This object is constructed in a database thread, and destructed in the | 850 // This object is constructed in a database thread, and destructed in the |
| 851 // context thread. | 851 // context thread. |
| 852 class DeliverPendingCallbackTask FINAL : public ExecutionContextTask { | 852 class DeliverPendingCallbackTask final : public ExecutionContextTask { |
| 853 public: | 853 public: |
| 854 static PassOwnPtr<DeliverPendingCallbackTask> create(SQLTransaction* transac
tion) | 854 static PassOwnPtr<DeliverPendingCallbackTask> create(SQLTransaction* transac
tion) |
| 855 { | 855 { |
| 856 return adoptPtr(new DeliverPendingCallbackTask(transaction)); | 856 return adoptPtr(new DeliverPendingCallbackTask(transaction)); |
| 857 } | 857 } |
| 858 | 858 |
| 859 virtual void performTask(ExecutionContext*) OVERRIDE | 859 virtual void performTask(ExecutionContext*) override |
| 860 { | 860 { |
| 861 m_transaction->performPendingCallback(); | 861 m_transaction->performPendingCallback(); |
| 862 } | 862 } |
| 863 | 863 |
| 864 private: | 864 private: |
| 865 DeliverPendingCallbackTask(SQLTransaction* transaction) | 865 DeliverPendingCallbackTask(SQLTransaction* transaction) |
| 866 : m_transaction(transaction) | 866 : m_transaction(transaction) |
| 867 { | 867 { |
| 868 } | 868 } |
| 869 | 869 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 SecurityOrigin* Database::securityOrigin() const | 924 SecurityOrigin* Database::securityOrigin() const |
| 925 { | 925 { |
| 926 if (executionContext()->isContextThread()) | 926 if (executionContext()->isContextThread()) |
| 927 return m_contextThreadSecurityOrigin.get(); | 927 return m_contextThreadSecurityOrigin.get(); |
| 928 if (databaseContext()->databaseThread()->isDatabaseThread()) | 928 if (databaseContext()->databaseThread()->isDatabaseThread()) |
| 929 return m_databaseThreadSecurityOrigin.get(); | 929 return m_databaseThreadSecurityOrigin.get(); |
| 930 return 0; | 930 return 0; |
| 931 } | 931 } |
| 932 | 932 |
| 933 } // namespace blink | 933 } // namespace blink |
| OLD | NEW |