| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 void scheduleTask(PassOwnPtr<DatabaseTask>); | 58 void scheduleTask(PassOwnPtr<DatabaseTask>); |
| 59 | 59 |
| 60 void recordDatabaseOpen(Database*); | 60 void recordDatabaseOpen(Database*); |
| 61 void recordDatabaseClosed(Database*); | 61 void recordDatabaseClosed(Database*); |
| 62 bool isDatabaseOpen(Database*); | 62 bool isDatabaseOpen(Database*); |
| 63 | 63 |
| 64 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } | 64 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } |
| 65 | 65 |
| 66 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } | 66 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } |
| 67 SQLTransactionCoordinator* transactionCoordinator() const; | 67 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo
ordinator.get(); } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 DatabaseThread(); | 70 DatabaseThread(); |
| 71 | 71 |
| 72 void setupDatabaseThread(); | 72 void setupDatabaseThread(); |
| 73 void cleanupDatabaseThread(); | 73 void cleanupDatabaseThread(); |
| 74 void cleanupDatabaseThreadCompleted(); | 74 void cleanupDatabaseThreadCompleted(); |
| 75 | 75 |
| 76 OwnPtr<WebThreadSupportingGC> m_thread; | 76 OwnPtr<WebThreadSupportingGC> m_thread; |
| 77 | 77 |
| 78 // This set keeps track of the open databases that have been used on this th
read. | 78 // This set keeps track of the open databases that have been used on this th
read. |
| 79 // This must be updated in the database thread though it is constructed and | 79 // This must be updated in the database thread though it is constructed and |
| 80 // destructed in the context thread. | 80 // destructed in the context thread. |
| 81 HeapHashSet<Member<Database>> m_openDatabaseSet; | 81 HeapHashSet<Member<Database>> m_openDatabaseSet; |
| 82 | 82 |
| 83 OwnPtr<SQLTransactionClient> m_transactionClient; | 83 OwnPtr<SQLTransactionClient> m_transactionClient; |
| 84 Member<SQLTransactionCoordinator> m_transactionCoordinator; | 84 Member<SQLTransactionCoordinator> m_transactionCoordinator; |
| 85 TaskSynchronizer* m_cleanupSync; | 85 TaskSynchronizer* m_cleanupSync; |
| 86 | 86 |
| 87 mutable Mutex m_terminationRequestedMutex; | 87 mutable Mutex m_terminationRequestedMutex; |
| 88 bool m_terminationRequested; | 88 bool m_terminationRequested; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif // DatabaseThread_h | 93 #endif // DatabaseThread_h |
| OLD | NEW |