Title: [255650] branches/safari-610.1.1-branch/Source/WebCore
Revision
255650
Author
[email protected]
Date
2020-02-03 19:09:45 -0800 (Mon, 03 Feb 2020)

Log Message

Cherry-pick r254991. rdar://problem/58675608

    [Web Animations] Make AnimationList ref-counted
    https://bugs.webkit.org/show_bug.cgi?id=206664

    Reviewed by Antti Koivisto.

    * platform/animation/AnimationList.cpp:
    * platform/animation/AnimationList.h:
    (WebCore::AnimationList::create):
    (WebCore::AnimationList::copy):
    (WebCore::AnimationList::AnimationList): Deleted.
    * rendering/style/RenderStyle.cpp:
    (WebCore::RenderStyle::ensureAnimations):
    (WebCore::RenderStyle::ensureTransitions):
    * rendering/style/StyleRareNonInheritedData.cpp:
    (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
    * rendering/style/StyleRareNonInheritedData.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254991 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.1-branch/Source/WebCore/ChangeLog (255649 => 255650)


--- branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:09:42 UTC (rev 255649)
+++ branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:09:45 UTC (rev 255650)
@@ -1,5 +1,47 @@
 2020-02-03  Alan Coon  <[email protected]>
 
+        Cherry-pick r254991. rdar://problem/58675608
+
+    [Web Animations] Make AnimationList ref-counted
+    https://bugs.webkit.org/show_bug.cgi?id=206664
+    
+    Reviewed by Antti Koivisto.
+    
+    * platform/animation/AnimationList.cpp:
+    * platform/animation/AnimationList.h:
+    (WebCore::AnimationList::create):
+    (WebCore::AnimationList::copy):
+    (WebCore::AnimationList::AnimationList): Deleted.
+    * rendering/style/RenderStyle.cpp:
+    (WebCore::RenderStyle::ensureAnimations):
+    (WebCore::RenderStyle::ensureTransitions):
+    * rendering/style/StyleRareNonInheritedData.cpp:
+    (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+    * rendering/style/StyleRareNonInheritedData.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-23  Antoine Quint  <[email protected]>
+
+            [Web Animations] Make AnimationList ref-counted
+            https://bugs.webkit.org/show_bug.cgi?id=206664
+
+            Reviewed by Antti Koivisto.
+
+            * platform/animation/AnimationList.cpp:
+            * platform/animation/AnimationList.h:
+            (WebCore::AnimationList::create):
+            (WebCore::AnimationList::copy):
+            (WebCore::AnimationList::AnimationList): Deleted.
+            * rendering/style/RenderStyle.cpp:
+            (WebCore::RenderStyle::ensureAnimations):
+            (WebCore::RenderStyle::ensureTransitions):
+            * rendering/style/StyleRareNonInheritedData.cpp:
+            (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+            * rendering/style/StyleRareNonInheritedData.h:
+
+2020-02-03  Alan Coon  <[email protected]>
+
         Cherry-pick r255228. rdar://problem/58858225
 
     -webkit-image-set should support resolution units other than 'x'

Modified: branches/safari-610.1.1-branch/Source/WebCore/platform/animation/AnimationList.cpp (255649 => 255650)


--- branches/safari-610.1.1-branch/Source/WebCore/platform/animation/AnimationList.cpp	2020-02-04 03:09:42 UTC (rev 255649)
+++ branches/safari-610.1.1-branch/Source/WebCore/platform/animation/AnimationList.cpp	2020-02-04 03:09:45 UTC (rev 255650)
@@ -33,6 +33,8 @@
         animation(i).propSet(animation(j).propGet()); \
 }
 
+AnimationList::AnimationList() = default;
+
 AnimationList::AnimationList(const AnimationList& other)
 {
     m_animations.reserveInitialCapacity(other.size());

Modified: branches/safari-610.1.1-branch/Source/WebCore/platform/animation/AnimationList.h (255649 => 255650)


--- branches/safari-610.1.1-branch/Source/WebCore/platform/animation/AnimationList.h	2020-02-04 03:09:42 UTC (rev 255649)
+++ branches/safari-610.1.1-branch/Source/WebCore/platform/animation/AnimationList.h	2020-02-04 03:09:45 UTC (rev 255650)
@@ -25,17 +25,18 @@
 #pragma once
 
 #include "Animation.h"
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
 
-class AnimationList {
-    WTF_MAKE_FAST_ALLOCATED;
+class AnimationList : public RefCounted<AnimationList> {
 public:
-    AnimationList() { }
-    AnimationList(const AnimationList&);
-    AnimationList(AnimationList&&) = default;
+    static Ref<AnimationList> create() { return adoptRef(*new AnimationList); }
 
+    Ref<AnimationList> copy() { return adoptRef(*new AnimationList(*this)); }
+
     void fillUnsetProperties();
     bool operator==(const AnimationList&) const;
     bool operator!=(const AnimationList& other) const
@@ -54,8 +55,10 @@
     const Animation& animation(size_t i) const { return m_animations[i].get(); }
     
 private:
+    AnimationList();
+    AnimationList(const AnimationList&);
+
     AnimationList& operator=(const AnimationList&);
-    AnimationList& operator=(AnimationList&&) = default;
 
     Vector<Ref<Animation>, 0, CrashOnOverflow, 0> m_animations;
 };    

Modified: branches/safari-610.1.1-branch/Source/WebCore/rendering/style/RenderStyle.cpp (255649 => 255650)


--- branches/safari-610.1.1-branch/Source/WebCore/rendering/style/RenderStyle.cpp	2020-02-04 03:09:42 UTC (rev 255649)
+++ branches/safari-610.1.1-branch/Source/WebCore/rendering/style/RenderStyle.cpp	2020-02-04 03:09:45 UTC (rev 255650)
@@ -1661,7 +1661,7 @@
 AnimationList& RenderStyle::ensureAnimations()
 {
     if (!m_rareNonInheritedData.access().animations)
-        m_rareNonInheritedData.access().animations = makeUnique<AnimationList>();
+        m_rareNonInheritedData.access().animations = AnimationList::create();
     return *m_rareNonInheritedData->animations;
 }
 
@@ -1668,7 +1668,7 @@
 AnimationList& RenderStyle::ensureTransitions()
 {
     if (!m_rareNonInheritedData.access().transitions)
-        m_rareNonInheritedData.access().transitions = makeUnique<AnimationList>();
+        m_rareNonInheritedData.access().transitions = AnimationList::create();
     return *m_rareNonInheritedData->transitions;
 }
 

Modified: branches/safari-610.1.1-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (255649 => 255650)


--- branches/safari-610.1.1-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2020-02-04 03:09:42 UTC (rev 255649)
+++ branches/safari-610.1.1-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2020-02-04 03:09:45 UTC (rev 255650)
@@ -147,8 +147,8 @@
     , boxShadow(o.boxShadow ? makeUnique<ShadowData>(*o.boxShadow) : nullptr)
     , willChange(o.willChange)
     , boxReflect(o.boxReflect)
-    , animations(o.animations ? makeUnique<AnimationList>(*o.animations) : nullptr)
-    , transitions(o.transitions ? makeUnique<AnimationList>(*o.transitions) : nullptr)
+    , animations(o.animations ? o.animations->copy() : o.animations)
+    , transitions(o.transitions ? o.transitions->copy() : o.transitions)
     , mask(o.mask)
     , maskBoxImage(o.maskBoxImage)
     , pageSize(o.pageSize)

Modified: branches/safari-610.1.1-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (255649 => 255650)


--- branches/safari-610.1.1-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2020-02-04 03:09:42 UTC (rev 255649)
+++ branches/safari-610.1.1-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2020-02-04 03:09:45 UTC (rev 255650)
@@ -137,8 +137,8 @@
     
     RefPtr<StyleReflection> boxReflect;
 
-    std::unique_ptr<AnimationList> animations;
-    std::unique_ptr<AnimationList> transitions;
+    RefPtr<AnimationList> animations;
+    RefPtr<AnimationList> transitions;
 
     FillLayer mask;
     NinePieceImage maskBoxImage;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to