| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ~DatabaseThread(); | 54 ~DatabaseThread(); |
| 55 | 55 |
| 56 void start(); | 56 void start(); |
| 57 void requestTermination(DatabaseTaskSynchronizer* cleanupSync); | 57 void requestTermination(DatabaseTaskSynchronizer* cleanupSync); |
| 58 bool terminationRequested(DatabaseTaskSynchronizer* taskSynchronizer = 0) co
nst; | 58 bool terminationRequested(DatabaseTaskSynchronizer* taskSynchronizer = 0) co
nst; |
| 59 | 59 |
| 60 void scheduleTask(PassOwnPtr<DatabaseTask>); | 60 void scheduleTask(PassOwnPtr<DatabaseTask>); |
| 61 | 61 |
| 62 void recordDatabaseOpen(DatabaseBackend*); | 62 void recordDatabaseOpen(DatabaseBackend*); |
| 63 void recordDatabaseClosed(DatabaseBackend*); | 63 void recordDatabaseClosed(DatabaseBackend*); |
| 64 bool isDatabaseOpen(DatabaseBackend*); | |
| 65 | 64 |
| 66 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } | 65 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } |
| 67 | 66 |
| 68 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } | 67 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } |
| 69 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo
ordinator.get(); } | 68 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo
ordinator.get(); } |
| 70 | 69 |
| 71 private: | 70 private: |
| 72 DatabaseThread(); | 71 DatabaseThread(); |
| 73 | 72 |
| 74 void cleanupDatabaseThread(); | 73 void cleanupDatabaseThread(); |
| 75 | 74 |
| 76 OwnPtr<blink::WebThread> m_thread; | 75 OwnPtr<blink::WebThread> m_thread; |
| 77 | 76 |
| 78 // This set keeps track of the open databases that have been used on this th
read. | 77 // This set keeps track of the open databases that have been used on this th
read. |
| 79 typedef HashSet<RefPtr<DatabaseBackend> > DatabaseSet; | 78 typedef HashSet<RefPtr<DatabaseBackend> > DatabaseSet; |
| 80 DatabaseSet m_openDatabaseSet; | 79 DatabaseSet m_openDatabaseSet; |
| 81 | 80 |
| 82 OwnPtr<SQLTransactionClient> m_transactionClient; | 81 OwnPtr<SQLTransactionClient> m_transactionClient; |
| 83 OwnPtr<SQLTransactionCoordinator> m_transactionCoordinator; | 82 OwnPtr<SQLTransactionCoordinator> m_transactionCoordinator; |
| 84 DatabaseTaskSynchronizer* m_cleanupSync; | 83 DatabaseTaskSynchronizer* m_cleanupSync; |
| 85 | 84 |
| 86 mutable Mutex m_terminationRequestedMutex; | 85 mutable Mutex m_terminationRequestedMutex; |
| 87 bool m_terminationRequested; | 86 bool m_terminationRequested; |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 } // namespace WebCore | 89 } // namespace WebCore |
| 91 | 90 |
| 92 #endif // DatabaseThread_h | 91 #endif // DatabaseThread_h |
| OLD | NEW |