Changeset 278179 in webkit
- Timestamp:
- May 27, 2021, 2:55:40 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/CrossThreadQueue.h (modified) (1 diff)
-
WTF/wtf/CrossThreadTask.h (modified) (1 diff)
-
WTF/wtf/CrossThreadTaskHandler.cpp (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp (modified) (1 diff)
-
WebKit/NetworkProcess/IndexedDB/WebIDBServer.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r278178 r278179 1 2021-05-27 Sihui Liu <sihui_liu@apple.com> 2 3 Abandon pending tasks on background thread when WebIDBServer is closed 4 https://bugs.webkit.org/show_bug.cgi?id=226295 5 6 Reviewed by Chris Dumez. 7 8 Make the wait end with either a new message or queue being killed. 9 10 * wtf/CrossThreadQueue.h: 11 (WTF::CrossThreadQueue<DataType>::waitForMessage): 12 * wtf/CrossThreadTask.h: 13 (WTF::CrossThreadTask::operator bool const): 14 * wtf/CrossThreadTaskHandler.cpp: 15 (WTF::CrossThreadTaskHandler::taskRunLoop): 16 1 17 2021-05-27 Don Olmstead <don.olmstead@sony.com> 2 18 -
trunk/Source/WTF/wtf/CrossThreadQueue.h
r277958 r278179 74 74 75 75 auto found = m_queue.end(); 76 while ( found == m_queue.end()) {76 while (!m_killed && found == m_queue.end()) { 77 77 found = m_queue.begin(); 78 78 if (found != m_queue.end()) -
trunk/Source/WTF/wtf/CrossThreadTask.h
r248546 r278179 49 49 m_taskFunction(); 50 50 } 51 52 explicit operator bool() const { return !!m_taskFunction; } 51 53 52 54 protected: -
trunk/Source/WTF/wtf/CrossThreadTaskHandler.cpp
r277847 r278179 75 75 } 76 76 77 while ( !m_taskQueue.isKilled()) {77 while (auto task = m_taskQueue.waitForMessage()) { 78 78 std::unique_ptr<AutodrainedPool> autodrainedPool = (m_useAutodrainedPool == AutodrainedPoolForRunLoop::Use) ? makeUnique<AutodrainedPool>() : nullptr; 79 79 80 m_taskQueue.waitForMessage().performTask();80 task.performTask(); 81 81 } 82 82 } -
trunk/Source/WebCore/ChangeLog
r278175 r278179 1 2021-05-27 Sihui Liu <sihui_liu@apple.com> 2 3 Abandon pending tasks on background thread when WebIDBServer is closed 4 https://bugs.webkit.org/show_bug.cgi?id=226295 5 6 Reviewed by Chris Dumez. 7 8 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Disable threading check as we may 9 abort transactions on the main thread. 10 (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): 11 1 12 2021-05-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 13 -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
r278150 r278179 1005 1005 return IDBError { UnknownError, "Unable to open database file on disk"_s }; 1006 1006 1007 m_sqliteDB->disableThreadingChecks(); 1007 1008 m_sqliteDB->enableAutomaticWALTruncation(); 1008 1009 -
trunk/Source/WebKit/ChangeLog
r278176 r278179 1 2021-05-27 Sihui Liu <sihui_liu@apple.com> 2 3 Abandon pending tasks on background thread when WebIDBServer is closed 4 https://bugs.webkit.org/show_bug.cgi?id=226295 5 6 Reviewed by Chris Dumez. 7 8 When WebIDBServer is closed, it means there is no open connection to client, so we don't need to handle pending 9 tasks. We can ditch them by killing the CrossThreadQueue. For ongoing task, it can be blocked on quota check, so 10 let's just stop database activities on the main thread to make sure database lock is released. 11 12 * NetworkProcess/IndexedDB/WebIDBServer.cpp: 13 (WebKit::WebIDBServer::close): 14 * NetworkProcess/IndexedDB/WebIDBServer.h: 15 1 16 2021-05-27 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.cpp
r277943 r278179 416 416 connection->removeThreadMessageReceiver(Messages::WebIDBServer::messageReceiverName()); 417 417 418 CrossThreadTaskHandler::setCompletionCallback([protectedThis = makeRef(*this)]() mutable { 419 ASSERT(!RunLoop::isMain()); 420 callOnMainRunLoop([protectedThis = WTFMove(protectedThis)]() mutable { }); 421 }); 422 423 postTask([this]() mutable { 418 CrossThreadTaskHandler::setCompletionCallback([this, protectedThis = makeRef(*this)]() mutable { 419 ASSERT(!RunLoop::isMain()); 420 424 421 m_connectionMap.clear(); 425 426 422 Locker locker { m_serverLock }; 427 423 m_server = nullptr; 428 CrossThreadTaskHandler::kill(); 429 }); 424 425 callOnMainRunLoop([protectedThis = WTFMove(protectedThis)] { }); 426 }); 427 428 { 429 Locker locker { m_serverLock }; 430 if (m_server) 431 m_server->stopDatabaseActivitiesOnMainThread(); 432 } 433 434 CrossThreadTaskHandler::kill(); 430 435 431 436 m_closeCallback(); -
trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h
r275891 r278179 99 99 100 100 Lock m_serverLock; 101 std::unique_ptr<WebCore::IDBServer::IDBServer> m_server ;101 std::unique_ptr<WebCore::IDBServer::IDBServer> m_server WTF_GUARDED_BY_LOCK(m_serverLock); 102 102 bool m_isSuspended { false }; 103 103
Note:
See TracChangeset
for help on using the changeset viewer.