Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: Source/modules/webdatabase/DatabaseThread.h

Issue 178103007: Revert of DatabaseBackend objects should be destructed in the originator thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DatabaseTask.cpp ('k') | Source/modules/webdatabase/DatabaseThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698