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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 class TaskSynchronizer; | 52 class TaskSynchronizer; |
53 | 53 |
54 class DatabaseThread : public ThreadSafeRefCountedWillBeGarbageCollectedFinalize
d<DatabaseThread> { | 54 class DatabaseThread : public ThreadSafeRefCountedWillBeGarbageCollectedFinalize
d<DatabaseThread> { |
55 public: | 55 public: |
56 static PassRefPtrWillBeRawPtr<DatabaseThread> create() { return adoptRefWill
BeNoop(new DatabaseThread); } | 56 static PassRefPtrWillBeRawPtr<DatabaseThread> create() { return adoptRefWill
BeNoop(new DatabaseThread); } |
57 ~DatabaseThread(); | 57 ~DatabaseThread(); |
58 void trace(Visitor*); | 58 void trace(Visitor*); |
59 | 59 |
60 void start(); | 60 void start(); |
61 void requestTermination(TaskSynchronizer* cleanupSync); | 61 void requestTermination(TaskSynchronizer* cleanupSync); |
62 bool terminationRequested(TaskSynchronizer* = 0) const; | 62 bool terminationRequested() const; |
63 | 63 |
64 void scheduleTask(PassOwnPtr<DatabaseTask>); | 64 void scheduleTask(PassOwnPtr<DatabaseTask>); |
65 | 65 |
66 void recordDatabaseOpen(DatabaseBackend*); | 66 void recordDatabaseOpen(DatabaseBackend*); |
67 void recordDatabaseClosed(DatabaseBackend*); | 67 void recordDatabaseClosed(DatabaseBackend*); |
68 bool isDatabaseOpen(DatabaseBackend*); | 68 bool isDatabaseOpen(DatabaseBackend*); |
69 | 69 |
70 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } | 70 bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); } |
71 | 71 |
72 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } | 72 SQLTransactionClient* transactionClient() { return m_transactionClient.get()
; } |
(...skipping 17 matching lines...) Expand all Loading... |
90 OwnPtrWillBeMember<SQLTransactionCoordinator> m_transactionCoordinator; | 90 OwnPtrWillBeMember<SQLTransactionCoordinator> m_transactionCoordinator; |
91 TaskSynchronizer* m_cleanupSync; | 91 TaskSynchronizer* m_cleanupSync; |
92 | 92 |
93 mutable Mutex m_terminationRequestedMutex; | 93 mutable Mutex m_terminationRequestedMutex; |
94 bool m_terminationRequested; | 94 bool m_terminationRequested; |
95 }; | 95 }; |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // DatabaseThread_h | 99 #endif // DatabaseThread_h |
OLD | NEW |