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

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

Issue 183883005: DatabaseBackend objects should be destructed in the originator thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Delete copy in cleanupDatabaseThread 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*);
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
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