| Summary: | [Web Animations] Make AnimationList ref-counted | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> | ||||||
| Component: | Animations | Assignee: | Antoine Quint <graouts> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | dino, esprehn+autocc, ews-watchlist, glenn, koivisto, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Antoine Quint
2020-01-23 08:25:33 PST
Created attachment 388549 [details]
Patch
Comment on attachment 388549 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388549&action=review > Source/WebCore/platform/animation/AnimationList.cpp:36 > +AnimationList::AnimationList() You can say = default > Source/WebCore/platform/animation/AnimationList.h:34 > +class AnimationList : public RefCounted<AnimationList> { You still want WTF_MAKE_FAST_ALLOCATED or one of its variants. > Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp:152 > - , animations(o.animations ? makeUnique<AnimationList>(*o.animations) : nullptr) > - , transitions(o.transitions ? makeUnique<AnimationList>(*o.transitions) : nullptr) > + , animations(o.animations) > + , transitions(o.transitions) This no longer copies Created attachment 388558 [details]
Patch
> > Source/WebCore/platform/animation/AnimationList.h:34
> > +class AnimationList : public RefCounted<AnimationList> {
>
> You still want WTF_MAKE_FAST_ALLOCATED or one of its variants.
No need, RefCounted is WTF_MAKE_FAST_ALLOCATED.
Comment on attachment 388558 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=388558&action=review > Source/WebCore/platform/animation/AnimationList.h:38 > + static Ref<AnimationList> create(const AnimationList& other) { return adoptRef(*new AnimationList(other)); } copy() member function would be nicer. (In reply to Antti Koivisto from comment #5) > Comment on attachment 388558 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=388558&action=review > > > Source/WebCore/platform/animation/AnimationList.h:38 > > + static Ref<AnimationList> create(const AnimationList& other) { return adoptRef(*new AnimationList(other)); } > > copy() member function would be nicer. Will fix in commit, thanks. |