| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 22 matching lines...) Expand all Loading... |
| 33 #include "wtf/HashMap.h" | 33 #include "wtf/HashMap.h" |
| 34 #include "wtf/ThreadingPrimitives.h" | 34 #include "wtf/ThreadingPrimitives.h" |
| 35 #include <memory> | 35 #include <memory> |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class Database; | 39 class Database; |
| 40 class DatabaseTask; | 40 class DatabaseTask; |
| 41 class SQLTransactionClient; | 41 class SQLTransactionClient; |
| 42 class SQLTransactionCoordinator; | 42 class SQLTransactionCoordinator; |
| 43 class TaskSynchronizer; | 43 class WaitableEvent; |
| 44 | 44 |
| 45 class DatabaseThread : public GarbageCollectedFinalized<DatabaseThread> { | 45 class DatabaseThread : public GarbageCollectedFinalized<DatabaseThread> { |
| 46 public: | 46 public: |
| 47 static DatabaseThread* create() { return new DatabaseThread; } | 47 static DatabaseThread* create() { return new DatabaseThread; } |
| 48 ~DatabaseThread(); | 48 ~DatabaseThread(); |
| 49 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
| 50 | 50 |
| 51 // Callable only from the main thread. | 51 // Callable only from the main thread. |
| 52 void start(); | 52 void start(); |
| 53 void terminate(); | 53 void terminate(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 std::unique_ptr<WebThreadSupportingGC> m_thread; | 74 std::unique_ptr<WebThreadSupportingGC> m_thread; |
| 75 | 75 |
| 76 // This set keeps track of the open databases that have been used on this th
read. | 76 // This set keeps track of the open databases that have been used on this th
read. |
| 77 // This must be updated in the database thread though it is constructed and | 77 // This must be updated in the database thread though it is constructed and |
| 78 // destructed in the context thread. | 78 // destructed in the context thread. |
| 79 HashSet<CrossThreadPersistent<Database>> m_openDatabaseSet; | 79 HashSet<CrossThreadPersistent<Database>> m_openDatabaseSet; |
| 80 | 80 |
| 81 std::unique_ptr<SQLTransactionClient> m_transactionClient; | 81 std::unique_ptr<SQLTransactionClient> m_transactionClient; |
| 82 CrossThreadPersistent<SQLTransactionCoordinator> m_transactionCoordinator; | 82 CrossThreadPersistent<SQLTransactionCoordinator> m_transactionCoordinator; |
| 83 TaskSynchronizer* m_cleanupSync; | 83 WaitableEvent* m_cleanupSync; |
| 84 | 84 |
| 85 Mutex m_terminationRequestedMutex; | 85 Mutex m_terminationRequestedMutex; |
| 86 bool m_terminationRequested; | 86 bool m_terminationRequested; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace blink | 89 } // namespace blink |
| 90 | 90 |
| 91 #endif // DatabaseThread_h | 91 #endif // DatabaseThread_h |
| OLD | NEW |