Changeset 45594 in webkit for trunk/WebCore/storage/DatabaseThread.cpp
- Timestamp:
- Jul 7, 2009, 7:29:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/storage/DatabaseThread.cpp
r43663 r45594 100 100 LOG(StorageAPI, "About to detach thread %i and clear the ref to DatabaseThread %p, which currently has %i ref(s)", m_threadID, this, refCount()); 101 101 102 // Close the databases that we ran transactions on. This ensures that if any transactions are still open, they are rolled back and we don't leave the database in an 103 // inconsistent or locked state. 104 if (m_openDatabaseSet.size() > 0) { 105 // As the call to close will modify the original set, we must take a copy to iterate over. 106 DatabaseSet openSetCopy; 107 openSetCopy.swap(m_openDatabaseSet); 108 DatabaseSet::iterator end = openSetCopy.end(); 109 for (DatabaseSet::iterator it = openSetCopy.begin(); it != end; ++it) 110 (*it)->close(); 111 } 112 102 113 // Detach the thread so its resources are no longer of any concern to anyone else 103 114 detachThread(m_threadID); … … 107 118 108 119 return 0; 120 } 121 122 void DatabaseThread::recordDatabaseOpen(Database* database) 123 { 124 ASSERT(currentThread() == m_threadID); 125 ASSERT(database); 126 ASSERT(!m_openDatabaseSet.contains(database)); 127 m_openDatabaseSet.add(database); 128 } 129 130 void DatabaseThread::recordDatabaseClosed(Database* database) 131 { 132 ASSERT(currentThread() == m_threadID); 133 ASSERT(database); 134 ASSERT(m_queue.killed() || m_openDatabaseSet.contains(database)); 135 m_openDatabaseSet.remove(database); 109 136 } 110 137
Note:
See TracChangeset
for help on using the changeset viewer.