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 14 matching lines...) Expand all Loading... | |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 #ifndef DatabaseTask_h | 28 #ifndef DatabaseTask_h |
| 29 #define DatabaseTask_h | 29 #define DatabaseTask_h |
| 30 | 30 |
| 31 #include "modules/webdatabase/DatabaseBackend.h" | 31 #include "modules/webdatabase/DatabaseBackend.h" |
| 32 #include "modules/webdatabase/DatabaseBasicTypes.h" | 32 #include "modules/webdatabase/DatabaseBasicTypes.h" |
| 33 #include "modules/webdatabase/DatabaseError.h" | 33 #include "modules/webdatabase/DatabaseError.h" |
| 34 #include "modules/webdatabase/SQLTransactionBackend.h" | 34 #include "modules/webdatabase/SQLTransactionBackend.h" |
| 35 #include "platform/Task.h" | |
|
michaeln
2013/11/18 17:16:29
Looks like all you need here for now is...
#includ
| |
| 35 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
| 36 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
| 37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/Threading.h" | 39 #include "wtf/Threading.h" |
| 39 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
| 40 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
| 41 | 42 |
| 42 namespace WebCore { | 43 namespace WebCore { |
| 43 | 44 |
| 44 // Can be used to wait until DatabaseTask is completed. | 45 // Can be used to wait until DatabaseTask is completed. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 bool m_taskCompleted; | 64 bool m_taskCompleted; |
| 64 Mutex m_synchronousMutex; | 65 Mutex m_synchronousMutex; |
| 65 ThreadCondition m_synchronousCondition; | 66 ThreadCondition m_synchronousCondition; |
| 66 #ifndef NDEBUG | 67 #ifndef NDEBUG |
| 67 bool m_hasCheckedForTermination; | 68 bool m_hasCheckedForTermination; |
| 68 #endif | 69 #endif |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 class DatabaseTask { | 72 class DatabaseTask : public blink::WebThread::Task { |
| 72 WTF_MAKE_NONCOPYABLE(DatabaseTask); WTF_MAKE_FAST_ALLOCATED; | 73 WTF_MAKE_NONCOPYABLE(DatabaseTask); WTF_MAKE_FAST_ALLOCATED; |
| 73 public: | 74 public: |
| 74 virtual ~DatabaseTask(); | 75 virtual ~DatabaseTask(); |
| 75 | 76 |
| 76 void performTask(); | 77 virtual void run() OVERRIDE; |
| 77 | 78 |
| 78 DatabaseBackend* database() const { return m_database; } | 79 DatabaseBackend* database() const { return m_database; } |
| 79 #ifndef NDEBUG | 80 #ifndef NDEBUG |
| 80 bool hasSynchronizer() const { return m_synchronizer; } | 81 bool hasSynchronizer() const { return m_synchronizer; } |
| 81 bool hasCheckedForTermination() const { return m_synchronizer->hasCheckedFor Termination(); } | 82 bool hasCheckedForTermination() const { return m_synchronizer->hasCheckedFor Termination(); } |
| 82 #endif | 83 #endif |
| 83 | 84 |
| 84 protected: | 85 protected: |
| 85 DatabaseTask(DatabaseBackend*, DatabaseTaskSynchronizer*); | 86 DatabaseTask(DatabaseBackend*, DatabaseTaskSynchronizer*); |
| 86 | 87 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 #if !LOG_DISABLED | 172 #if !LOG_DISABLED |
| 172 virtual const char* debugTaskName() const; | 173 virtual const char* debugTaskName() const; |
| 173 #endif | 174 #endif |
| 174 | 175 |
| 175 Vector<String>& m_tableNames; | 176 Vector<String>& m_tableNames; |
| 176 }; | 177 }; |
| 177 | 178 |
| 178 } // namespace WebCore | 179 } // namespace WebCore |
| 179 | 180 |
| 180 #endif // DatabaseTask_h | 181 #endif // DatabaseTask_h |
| OLD | NEW |