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*); |
64 | 65 |
65 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } | 66 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } |
66 | 67 |
67 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } | 68 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } |
68 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo
ordinator.get(); } | 69 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo
ordinator.get(); } |
69 | 70 |
70 private: | 71 private: |
71 DatabaseThread(); | 72 DatabaseThread(); |
72 | 73 |
73 void cleanupDatabaseThread(); | 74 void cleanupDatabaseThread(); |
74 | 75 |
75 OwnPtr<blink::WebThread> m_thread; | 76 OwnPtr<blink::WebThread> m_thread; |
76 | 77 |
77 // 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. |
78 typedef HashSet<RefPtr<DatabaseBackend> > DatabaseSet; | 79 typedef HashSet<RefPtr<DatabaseBackend> > DatabaseSet; |
79 DatabaseSet m_openDatabaseSet; | 80 DatabaseSet m_openDatabaseSet; |
80 | 81 |
81 OwnPtr<SQLTransactionClient> m_transactionClient; | 82 OwnPtr<SQLTransactionClient> m_transactionClient; |
82 OwnPtr<SQLTransactionCoordinator> m_transactionCoordinator; | 83 OwnPtr<SQLTransactionCoordinator> m_transactionCoordinator; |
83 DatabaseTaskSynchronizer* m_cleanupSync; | 84 DatabaseTaskSynchronizer* m_cleanupSync; |
84 | 85 |
85 mutable Mutex m_terminationRequestedMutex; | 86 mutable Mutex m_terminationRequestedMutex; |
86 bool m_terminationRequested; | 87 bool m_terminationRequested; |
87 }; | 88 }; |
88 | 89 |
89 } // namespace WebCore | 90 } // namespace WebCore |
90 | 91 |
91 #endif // DatabaseThread_h | 92 #endif // DatabaseThread_h |
OLD | NEW |