Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d16c38c482d57d25a73a30aeaef9d16a16767e76
https://github.com/WebKit/WebKit/commit/d16c38c482d57d25a73a30aeaef9d16a16767e76
Author: Sihui Liu <[email protected]>
Date: 2025-03-10 (Mon, 10 Mar 2025)
Changed paths:
M Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h
M Source/WebCore/Modules/indexeddb/server/MemoryCursor.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryCursor.h
M Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryIndex.h
M Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.h
M Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h
M Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp
M Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h
Log Message:
-----------
Use smart pointer for MemoryCursor
https://bugs.webkit.org/show_bug.cgi?id=289264
rdar://143027385
Reviewed by Per Arne Vollan.
This change was originally landed in 291810@main and reverted in 291839@main
since it caused crashes in IndexedDB tests.
The cause is 291810@main didn't preserve `copyToVector(m_cleanCursors)` in
`MemoryIndex::notifyCursorsOfValueChange()`
and `MemoryIndex::notifyCursorsOfAllRecordsChanged()`. The copy is important
because `MemoryIndex::indexValueChanged`
and `MemoryIndex::notifyCursorsOfValueChange` can lead to m_cleanCursors being
modified (via
`MemoryIndex::cursorDidBecomeDirty()`). The new patch adds `copyToVector` back,
and tests will no longer crash.
* Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::cursor const):
(WebCore::IDBServer::MemoryBackingStoreTransaction::addCursor):
* Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Source/WebCore/Modules/indexeddb/server/MemoryCursor.cpp:
(WebCore::IDBServer::MemoryCursor::MemoryCursor):
(WebCore::IDBServer::MemoryCursor::~MemoryCursor):
(): Deleted.
(WebCore::IDBServer::MemoryCursor::cursorForIdentifier): Deleted.
* Source/WebCore/Modules/indexeddb/server/MemoryCursor.h:
(WebCore::IDBServer::MemoryCursor::info const):
* Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::cursorDidBecomeClean):
(WebCore::IDBServer::MemoryIndex::cursorDidBecomeDirty):
(WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange):
(WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged):
(WebCore::IDBServer::MemoryIndex::maybeOpenCursor):
* Source/WebCore/Modules/indexeddb/server/MemoryIndex.h:
* Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::create):
(WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
(WebCore::IDBServer::MemoryIndexCursor::currentData):
(WebCore::IDBServer::MemoryIndexCursor::iterate):
* Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.h:
* Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::maybeOpenCursor):
* Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h:
* Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::create):
(WebCore::IDBServer::MemoryObjectStoreCursor::MemoryObjectStoreCursor):
(WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
* Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h:
Canonical link: https://commits.webkit.org/291909@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes