Bug 218170

Summary: Use a WeakHashSet for Document::m_captionPreferencesChangedElements
Product: WebKit Reporter: youenn fablet <youennf>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, eric.carlson, esprehn+autocc, ews-watchlist, kangil.han, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description youenn fablet 2020-10-26 02:52:00 PDT
Use a WeakHashSet for Document::m_captionPreferencesChangedElements for extra safety
Comment 1 youenn fablet 2020-10-26 03:00:52 PDT
<rdar://problem/64485217>
Comment 2 youenn fablet 2020-10-26 03:02:30 PDT
Created attachment 412299 [details]
Patch
Comment 3 youenn fablet 2020-10-26 04:24:49 PDT
Created attachment 412305 [details]
Patch
Comment 4 youenn fablet 2020-10-26 05:17:25 PDT
Created attachment 412308 [details]
Patch
Comment 5 youenn fablet 2020-10-26 06:10:46 PDT
Created attachment 412313 [details]
Patch
Comment 6 youenn fablet 2020-10-26 07:55:22 PDT
Comment on attachment 412313 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412313&action=review

> Source/WTF/wtf/WeakHashSet.h:-142
> -        for (auto& item : map(m_set, [](auto& item) { return makeWeakPtr(item->template get<T>()); })) {

We need a static_cast here like weak hashset iterator is doing.
I changed the code so that wincairo compiles it, which requires removal of some autos.
Comment 7 EWS 2020-10-26 08:35:39 PDT
Committed r268979: <https://trac.webkit.org/changeset/268979>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412313 [details].