Bug 220102

Summary: Use WeakHashSet<Page> instead of HashSet<Page*>
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, ews-watchlist, hi, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Alex Christensen 2020-12-22 13:30:53 PST
Use WeakHashSet<Page> instead of HashSet<Page*>
Comment 1 Alex Christensen 2020-12-22 13:32:29 PST
Created attachment 416687 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2020-12-29 13:31:12 PST
<rdar://problem/72728030>
Comment 3 Darin Adler 2021-01-02 14:38:30 PST
Comment on attachment 416687 [details]
Patch

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

> Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp:173
> +    for (const auto& page : PageGroup::pageGroup(pageGroup->identifier())->pages())

Not sure we should have the const here. For one thing, changing the settings for a page doesn’t seem very "const".

> Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp:289
> +    for (const auto& page : PageGroup::pageGroup(pageGroup->identifier())->pages())

Ditto.

> Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp:345
> +        for (const auto& page : PageGroup::pageGroup(pageGroup->identifier())->pages()) {
> +            for (const auto* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext()) {

Could omit const here too.
Comment 4 Alex Christensen 2021-01-05 10:07:58 PST
Created attachment 417016 [details]
Patch
Comment 5 Alex Christensen 2021-01-05 10:16:17 PST
http://trac.webkit.org/r271153