Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 86df89933752ae06accd35c8fa2702268da1824c
      
https://github.com/WebKit/WebKit/commit/86df89933752ae06accd35c8fa2702268da1824c
  Author: Sihui Liu <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    M Source/WebCore/Modules/indexeddb/server/IndexValueEntry.cpp
    M Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h
    M Source/WebCore/Modules/indexeddb/server/IndexValueStore.h

  Log Message:
  -----------
  Use Variant instead of raw pointer union in IndexValueEntry
https://bugs.webkit.org/show_bug.cgi?id=311777
rdar://174363490

Reviewed by Ryosuke Niwa.

Replace the union of raw IDBKeyData*/IDBKeyDataSet* with 
Variant<std::optional<IDBKeyData>, IDBKeyDataSet>, which
manages lifetime automatically and provides type safety via WTF::switchOn. This 
eliminates the manual destructor, the
m_unique bool, and all heap allocations for the unique-index case.

Remove some NODELETE annotations since new implementation gets "it contains 
code that could destruct an object" SaferCPP
error because of them.

* Source/WebCore/Modules/indexeddb/server/IndexValueEntry.cpp:
(WebCore::IDBServer::constructEmptyKeys):
(WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
(WebCore::IDBServer::IndexValueEntry::addKey):
(WebCore::IDBServer::IndexValueEntry::removeKey):
(WebCore::IDBServer::IndexValueEntry::contains):
(WebCore::IDBServer::IndexValueEntry::getCount const):
(WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
(WebCore::IDBServer::IndexValueEntry::Iterator::key const):
(WebCore::IDBServer::IndexValueEntry::Iterator::isValid const):
(WebCore::IDBServer::IndexValueEntry::Iterator::operator++):
(WebCore::IDBServer::IndexValueEntry::keys const):
(WebCore::IDBServer::IndexValueEntry::~IndexValueEntry): Deleted.
* Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h:
(WebCore::IDBServer::IndexValueEntry::isUnique const):
(WebCore::IDBServer::IndexValueEntry::unique const): Deleted.
* Source/WebCore/Modules/indexeddb/server/IndexValueStore.h:

Canonical link: https://commits.webkit.org/311131@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to