RESOLVED FIXED 226530
Style::Scope should use CheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=226530
Summary Style::Scope should use CheckedPtr
Antti Koivisto
Reported 2021-06-02 03:41:23 PDT
Instead of WeakPtr.
Attachments
patch (2.79 KB, patch)
2021-06-02 03:45 PDT, Antti Koivisto
ews-feeder: commit-queue-
patch (3.62 KB, patch)
2021-06-02 04:00 PDT, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2021-06-02 03:45:12 PDT
Antti Koivisto
Comment 2 2021-06-02 04:00:16 PDT
EWS
Comment 3 2021-06-02 09:21:23 PDT
Committed r278355 (238387@main): <https://commits.webkit.org/238387@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430333 [details].
Radar WebKit Bug Importer
Comment 4 2021-06-02 09:22:19 PDT
Fujii Hironori
Comment 5 2021-06-02 14:12:15 PDT
Comment on attachment 430333 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=430333&action=review > Source/WebCore/style/StyleScope.cpp:671 > + resolverScopes.add(makeRef(*resolver), Vector<CheckedPtr<Scope>> { }).iterator->value.append(&scope); You add an empty vector, and append a single Scope. Does this vector always have only a single Scope? If so, why is ResolverScopes's ValueType using Vector<CheckedPtr<Scope>>?
Chris Dumez
Comment 6 2021-06-02 14:18:25 PDT
Comment on attachment 430333 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=430333&action=review >> Source/WebCore/style/StyleScope.cpp:671 >> + resolverScopes.add(makeRef(*resolver), Vector<CheckedPtr<Scope>> { }).iterator->value.append(&scope); > > You add an empty vector, and append a single Scope. > Does this vector always have only a single Scope? > If so, why is ResolverScopes's ValueType using Vector<CheckedPtr<Scope>>? We're in a loop so we may add more scope than one to the Vector. (Note that add() is a no-op if the key already exists)
Antti Koivisto
Comment 7 2021-06-02 23:35:33 PDT
It would be nice to have a single-argument version of add (or ensure) where the value is default constructed.
Ryosuke Niwa
Comment 8 2021-06-02 23:55:49 PDT
(In reply to Antti Koivisto from comment #7) > It would be nice to have a single-argument version of add (or ensure) where > the value is default constructed. Maybe we can just add the default argument value to it...
Note You need to log in before you can comment on or make changes to this bug.