Changeset 195652 in webkit
- Timestamp:
- Jan 26, 2016 7:45:09 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195648 r195652 1 2016-01-26 Chris Dumez <cdumez@apple.com> 2 3 fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes 4 https://bugs.webkit.org/show_bug.cgi?id=153525 5 6 Reviewed by Andreas Kling. 7 8 Unskip fast/history/page-cache-webdatabase-no-transaction-db.html now 9 that it no longer crashes. 10 11 * TestExpectations: 12 1 13 2016-01-26 Brady Eidson <beidson@apple.com> 2 14 -
trunk/LayoutTests/TestExpectations
r195638 r195652 849 849 http/tests/security/contentSecurityPolicy/1.1/stylehash-default-src.html # Needs expected file. 850 850 851 # This test flakily crashes, skip it until the crash is fixed.852 webkit.org/b/153525 fast/history/page-cache-webdatabase-no-transaction-db.html [ Skip ]853 854 851 # These state object tests purposefully stress a resource limit, and take multiple seconds to run. 855 852 loader/stateobjects/pushstate-size-iframe.html [ Slow ] -
trunk/Source/WebCore/ChangeLog
r195649 r195652 1 2016-01-26 Chris Dumez <cdumez@apple.com> 2 3 fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes 4 https://bugs.webkit.org/show_bug.cgi?id=153525 5 6 Reviewed by Andreas Kling. 7 8 The test was crashing because DatabaseThread::hasPendingDatabaseActivity() 9 was accessing m_openDatabaseSet from the main thread without any locking 10 mechanism. This is an issue because m_openDatabaseSet is altered by the 11 database thread. 12 13 No new tests, already covered by fast/history/page-cache-webdatabase-no-transaction-db.html. 14 15 * Modules/webdatabase/DatabaseThread.cpp: 16 (WebCore::DatabaseThread::databaseThread): 17 (WebCore::DatabaseThread::recordDatabaseOpen): 18 (WebCore::DatabaseThread::recordDatabaseClosed): 19 (WebCore::DatabaseThread::hasPendingDatabaseActivity): 20 * Modules/webdatabase/DatabaseThread.h: 21 1 22 2016-01-26 Joseph Pecoraro <pecoraro@apple.com> 2 23 -
trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp
r194496 r195652 118 118 // 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 119 119 // inconsistent or locked state. 120 if (m_openDatabaseSet.size() > 0) { 121 // As the call to close will modify the original set, we must take a copy to iterate over. 122 DatabaseSet openSetCopy; 123 openSetCopy.swap(m_openDatabaseSet); 124 for (auto& openDatabase : openSetCopy) 125 openDatabase->close(); 126 } 120 DatabaseSet openSetCopy; 121 { 122 LockHolder lock(m_openDatabaseSetMutex); 123 if (m_openDatabaseSet.size() > 0) { 124 // As the call to close will modify the original set, we must take a copy to iterate over. 125 openSetCopy.swap(m_openDatabaseSet); 126 } 127 } 128 129 for (auto& openDatabase : openSetCopy) 130 openDatabase->close(); 127 131 128 132 // Detach the thread so its resources are no longer of any concern to anyone else … … 140 144 void DatabaseThread::recordDatabaseOpen(Database* database) 141 145 { 146 LockHolder lock(m_openDatabaseSetMutex); 147 142 148 ASSERT(currentThread() == m_threadID); 143 149 ASSERT(database); … … 148 154 void DatabaseThread::recordDatabaseClosed(Database* database) 149 155 { 156 LockHolder lock(m_openDatabaseSetMutex); 157 150 158 ASSERT(currentThread() == m_threadID); 151 159 ASSERT(database); … … 184 192 bool DatabaseThread::hasPendingDatabaseActivity() const 185 193 { 194 LockHolder lock(m_openDatabaseSetMutex); 186 195 for (auto& database : m_openDatabaseSet) { 187 196 if (database->hasPendingCreationEvent() || database->hasPendingTransaction()) -
trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.h
r188594 r195652 81 81 // This set keeps track of the open databases that have been used on this thread. 82 82 typedef HashSet<RefPtr<Database>> DatabaseSet; 83 mutable Lock m_openDatabaseSetMutex; 83 84 DatabaseSet m_openDatabaseSet; 84 85
Note: See TracChangeset
for help on using the changeset viewer.