Title: [248445] trunk/Source/WebCore
Revision
248445
Author
[email protected]
Date
2019-08-08 15:10:36 -0700 (Thu, 08 Aug 2019)

Log Message

ScrollingStateNode is not ThreadSafeRefCounted but is ref'd / deref'd from several threads
https://bugs.webkit.org/show_bug.cgi?id=200545

Reviewed by Antti Koivisto.

The ScrollingStateTree and its ScrollingStateNodes are being passed to the scrolling thread.
ScrollingStateNode is not ThreadSafeRefCounted, which is potentially unsafe. Make it
ThreadSafeRefCounted for safety in this patch given that using RefCounted here is either
wrong or fragile.

* page/scrolling/ScrollingStateNode.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (248444 => 248445)


--- trunk/Source/WebCore/ChangeLog	2019-08-08 22:03:58 UTC (rev 248444)
+++ trunk/Source/WebCore/ChangeLog	2019-08-08 22:10:36 UTC (rev 248445)
@@ -1,3 +1,17 @@
+2019-08-08  Chris Dumez  <[email protected]>
+
+        ScrollingStateNode is not ThreadSafeRefCounted but is ref'd / deref'd from several threads
+        https://bugs.webkit.org/show_bug.cgi?id=200545
+
+        Reviewed by Antti Koivisto.
+
+        The ScrollingStateTree and its ScrollingStateNodes are being passed to the scrolling thread.
+        ScrollingStateNode is not ThreadSafeRefCounted, which is potentially unsafe. Make it
+        ThreadSafeRefCounted for safety in this patch given that using RefCounted here is either
+        wrong or fragile.
+
+        * page/scrolling/ScrollingStateNode.h:
+
 2019-08-08  Brent Fulgham  <[email protected]>
 
         [FTW] Get WebKit, WebKit2, and MiniBrowser building and executing

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp (248444 => 248445)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp	2019-08-08 22:03:58 UTC (rev 248444)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp	2019-08-08 22:10:36 UTC (rev 248445)
@@ -54,7 +54,6 @@
     if (hasChangedProperty(Layer))
         setLayer(stateNode.layer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
 
-    relaxAdoptionRequirement();
     scrollingStateTree().addNode(*this);
 }
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h (248444 => 248445)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h	2019-08-08 22:03:58 UTC (rev 248444)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h	2019-08-08 22:10:36 UTC (rev 248445)
@@ -30,7 +30,7 @@
 #include "GraphicsLayer.h"
 #include "ScrollingCoordinator.h"
 #include <stdint.h>
-#include <wtf/RefCounted.h>
+#include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/TypeCasts.h>
 #include <wtf/Vector.h>
 
@@ -180,10 +180,9 @@
     Type m_representation { EmptyRepresentation };
 };
 
-class ScrollingStateNode : public RefCounted<ScrollingStateNode> {
+class ScrollingStateNode : public ThreadSafeRefCounted<ScrollingStateNode> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    ScrollingStateNode(ScrollingNodeType, ScrollingStateTree&, ScrollingNodeID);
     virtual ~ScrollingStateNode();
     
     ScrollingNodeType nodeType() const { return m_nodeType; }
@@ -248,6 +247,7 @@
 
 protected:
     ScrollingStateNode(const ScrollingStateNode&, ScrollingStateTree&);
+    ScrollingStateNode(ScrollingNodeType, ScrollingStateTree&, ScrollingNodeID);
 
     virtual void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to