Bug 206664 - [Web Animations] Make AnimationList ref-counted
Summary: [Web Animations] Make AnimationList ref-counted
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-23 08:25 PST by Antoine Quint
Modified: 2020-01-23 11:25 PST (History)
9 users (show)

See Also:


Attachments
Patch (5.64 KB, patch)
2020-01-23 08:26 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (5.75 KB, patch)
2020-01-23 10:02 PST, Antoine Quint
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2020-01-23 08:25:33 PST
[Web Animations] Make AnimationList ref-counted
Comment 1 Antoine Quint 2020-01-23 08:26:13 PST
Created attachment 388549 [details]
Patch
Comment 2 Simon Fraser (smfr) 2020-01-23 09:43:32 PST
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
Comment 3 Antoine Quint 2020-01-23 10:02:01 PST
Created attachment 388558 [details]
Patch
Comment 4 Antti Koivisto 2020-01-23 10:42:22 PST
> > 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 5 Antti Koivisto 2020-01-23 10:46:31 PST
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.
Comment 6 Antoine Quint 2020-01-23 11:16:13 PST
(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.
Comment 7 Antoine Quint 2020-01-23 11:24:29 PST
https://trac.webkit.org/changeset/254991
Comment 8 Radar WebKit Bug Importer 2020-01-23 11:25:19 PST
<rdar://problem/58841851>