Bug 218170 - Use a WeakHashSet for Document::m_captionPreferencesChangedElements
Summary: Use a WeakHashSet for Document::m_captionPreferencesChangedElements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-26 02:52 PDT by youenn fablet
Modified: 2020-10-26 08:35 PDT (History)
8 users (show)

See Also:


Attachments
Patch (3.94 KB, patch)
2020-10-26 03:02 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.06 KB, patch)
2020-10-26 04:24 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.22 KB, patch)
2020-10-26 05:17 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (4.22 KB, patch)
2020-10-26 06:10 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].