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

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

Issue 589363002: Oilpan: DatabaseThread::m_thread should not get destructed during sweeping (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class SQLTransactionCoordinator; 51 class SQLTransactionCoordinator;
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 terminate();
62 bool terminationRequested(TaskSynchronizer* = 0) const; 62 bool terminationRequested(TaskSynchronizer* = 0) 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() ; }
73 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo ordinator.get(); } 73 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCo ordinator.get(); }
74 74
75 private: 75 private:
76 DatabaseThread(); 76 DatabaseThread();
77 77
78 void setupDatabaseThread(); 78 void setupDatabaseThread();
79 void cleanupDatabaseThread(); 79 void cleanupDatabaseThread();
80 void cleanupDatabaseThreadCompleted(); 80 void cleanupDatabaseThreadCompleted();
81 81
82 OwnPtr<WebThreadSupportingGC> m_thread; 82 OwnPtr<WebThreadSupportingGC> m_thread;
83 83
84 // This set keeps track of the open databases that have been used on this th read. 84 // This set keeps track of the open databases that have been used on this th read.
85 // This must be updated in the database thread though it is constructed and 85 // This must be updated in the database thread though it is constructed and
86 // destructed in the context thread. 86 // destructed in the context thread.
87 WillBeHeapHashSet<RefPtrWillBeMember<DatabaseBackend> > m_openDatabaseSet; 87 WillBeHeapHashSet<RefPtrWillBeMember<DatabaseBackend> > m_openDatabaseSet;
88 88
89 OwnPtr<SQLTransactionClient> m_transactionClient; 89 OwnPtr<SQLTransactionClient> m_transactionClient;
90 OwnPtrWillBeMember<SQLTransactionCoordinator> m_transactionCoordinator; 90 OwnPtrWillBeMember<SQLTransactionCoordinator> m_transactionCoordinator;
91 TaskSynchronizer* m_cleanupSync;
92 91
93 mutable Mutex m_terminationRequestedMutex; 92 mutable Mutex m_terminationRequestedMutex;
94 bool m_terminationRequested; 93 bool m_terminationRequested;
95 }; 94 };
96 95
97 } // namespace blink 96 } // namespace blink
98 97
99 #endif // DatabaseThread_h 98 #endif // DatabaseThread_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698