Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class DatabaseTask { | 46 class DatabaseTask { |
| 47 WTF_MAKE_NONCOPYABLE(DatabaseTask); USING_FAST_MALLOC(DatabaseTask); | 47 WTF_MAKE_NONCOPYABLE(DatabaseTask); USING_FAST_MALLOC(DatabaseTask); |
| 48 public: | 48 public: |
| 49 virtual ~DatabaseTask(); | 49 virtual ~DatabaseTask(); |
| 50 | 50 |
| 51 void run(); | 51 void run(); |
| 52 | 52 |
| 53 Database* database() const { return m_database.get(); } | 53 const CrossThreadPersistent<Database>& database() const { return m_database; } |
| 54 #if ENABLE(ASSERT) | 54 #if ENABLE(ASSERT) |
| 55 bool hasSynchronizer() const { return m_synchronizer; } | 55 bool hasSynchronizer() const { return m_synchronizer; } |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 DatabaseTask(Database*, TaskSynchronizer*); | 59 DatabaseTask(Database*, TaskSynchronizer*); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 virtual void doPerformTask() = 0; | 62 virtual void doPerformTask() = 0; |
| 63 virtual void taskCancelled() { } | 63 virtual void taskCancelled() { } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 class Database::DatabaseTransactionTask final : public DatabaseTask { | 111 class Database::DatabaseTransactionTask final : public DatabaseTask { |
| 112 public: | 112 public: |
| 113 ~DatabaseTransactionTask() override; | 113 ~DatabaseTransactionTask() override; |
| 114 | 114 |
| 115 // Transaction task is never synchronous, so no 'synchronizer' parameter. | 115 // Transaction task is never synchronous, so no 'synchronizer' parameter. |
| 116 static PassOwnPtr<DatabaseTransactionTask> create(SQLTransactionBackend* tra nsaction) | 116 static PassOwnPtr<DatabaseTransactionTask> create(SQLTransactionBackend* tra nsaction) |
| 117 { | 117 { |
| 118 return adoptPtr(new DatabaseTransactionTask(transaction)); | 118 return adoptPtr(new DatabaseTransactionTask(transaction)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 SQLTransactionBackend* transaction() const { return m_transaction.get(); } | 121 CrossThreadPersistent<SQLTransactionBackend> transaction() const { return m_ transaction; } |
|
sof
2016/06/02 07:00:11
You're creating a CrossThreadPersistent<> here, is
| |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 explicit DatabaseTransactionTask(SQLTransactionBackend*); | 124 explicit DatabaseTransactionTask(SQLTransactionBackend*); |
| 125 | 125 |
| 126 void doPerformTask() override; | 126 void doPerformTask() override; |
| 127 void taskCancelled() override; | 127 void taskCancelled() override; |
| 128 #if !LOG_DISABLED | 128 #if !LOG_DISABLED |
| 129 const char* debugTaskName() const override; | 129 const char* debugTaskName() const override; |
| 130 #endif | 130 #endif |
| 131 | 131 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 146 #if !LOG_DISABLED | 146 #if !LOG_DISABLED |
| 147 const char* debugTaskName() const override; | 147 const char* debugTaskName() const override; |
| 148 #endif | 148 #endif |
| 149 | 149 |
| 150 Vector<String>& m_tableNames; | 150 Vector<String>& m_tableNames; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| 154 | 154 |
| 155 #endif // DatabaseTask_h | 155 #endif // DatabaseTask_h |
| OLD | NEW |