⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248445 in webkit


Ignore:
Timestamp:
Aug 8, 2019, 3:10:36 PM (7 years ago)
Author:
Chris Dumez
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248444 r248445  
     12019-08-08  Chris Dumez  <cdumez@apple.com>
     2
     3        ScrollingStateNode is not ThreadSafeRefCounted but is ref'd / deref'd from several threads
     4        https://bugs.webkit.org/show_bug.cgi?id=200545
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The ScrollingStateTree and its ScrollingStateNodes are being passed to the scrolling thread.
     9        ScrollingStateNode is not ThreadSafeRefCounted, which is potentially unsafe. Make it
     10        ThreadSafeRefCounted for safety in this patch given that using RefCounted here is either
     11        wrong or fragile.
     12
     13        * page/scrolling/ScrollingStateNode.h:
     14
    1152019-08-08  Brent Fulgham  <bfulgham@apple.com>
    216
  • trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp

    r247734 r248445  
    5555        setLayer(stateNode.layer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
    5656
    57     relaxAdoptionRequirement();
    5857    scrollingStateTree().addNode(*this);
    5958}
  • trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h

    r246723 r248445  
    3131#include "ScrollingCoordinator.h"
    3232#include <stdint.h>
    33 #include <wtf/RefCounted.h>
     33#include <wtf/ThreadSafeRefCounted.h>
    3434#include <wtf/TypeCasts.h>
    3535#include <wtf/Vector.h>
     
    181181};
    182182
    183 class ScrollingStateNode : public RefCounted<ScrollingStateNode> {
     183class ScrollingStateNode : public ThreadSafeRefCounted<ScrollingStateNode> {
    184184    WTF_MAKE_FAST_ALLOCATED;
    185185public:
    186     ScrollingStateNode(ScrollingNodeType, ScrollingStateTree&, ScrollingNodeID);
    187186    virtual ~ScrollingStateNode();
    188187   
     
    249248protected:
    250249    ScrollingStateNode(const ScrollingStateNode&, ScrollingStateTree&);
     250    ScrollingStateNode(ScrollingNodeType, ScrollingStateTree&, ScrollingNodeID);
    251251
    252252    virtual void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const;
Note: See TracChangeset for help on using the changeset viewer.