Changeset 106609 in webkit


Ignore:
Timestamp:
Feb 2, 2012 6:04:51 PM (12 years ago)
Author:
andersca@apple.com
Message:

Add ScrollingTree class
https://bugs.webkit.org/show_bug.cgi?id=77695

Reviewed by Andreas Kling.

  • WebCore.xcodeproj/project.pbxproj:

Add new files.

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::ScrollingCoordinator):
Create a scrolling tree.

(WebCore::ScrollingCoordinator::~ScrollingCoordinator):
Assert that the scrolling tree is null.

(WebCore::ScrollingCoordinator::pageDestroyed):
Null out the scrolling tree member variable and tell it to invalidate itself.

  • page/scrolling/ScrollingTree.cpp: Added.

(WebCore::ScrollingTree::invalidate):
Null out the scrolling coordinator, breaking the reference cycle between the scrolling
coordinator and the scrolling tree.

  • page/scrolling/ScrollingTree.h: Added.
Location:
trunk/Source/WebCore
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106607 r106609  
     12012-02-02  Anders Carlsson  <andersca@apple.com>
     2
     3        Add ScrollingTree class
     4        https://bugs.webkit.org/show_bug.cgi?id=77695
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebCore.xcodeproj/project.pbxproj:
     9        Add new files.
     10
     11        * page/scrolling/ScrollingCoordinator.cpp:
     12        (WebCore::ScrollingCoordinator::ScrollingCoordinator):
     13        Create a scrolling tree.
     14
     15        (WebCore::ScrollingCoordinator::~ScrollingCoordinator):
     16        Assert that the scrolling tree is null.
     17
     18        (WebCore::ScrollingCoordinator::pageDestroyed):
     19        Null out the scrolling tree member variable and tell it to invalidate itself.
     20
     21        * page/scrolling/ScrollingTree.cpp: Added.
     22
     23        (WebCore::ScrollingTree::invalidate):
     24        Null out the scrolling coordinator, breaking the reference cycle between the scrolling
     25        coordinator and the scrolling tree.
     26   
     27        * page/scrolling/ScrollingTree.h: Added.
     28
    1292012-02-02  Tim Dresser  <tdresser@chromium.org>
    230
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r106565 r106609  
    489489                1AA84F05143BA7BD0051D153 /* ScrollElasticityController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA84F03143BA7BD0051D153 /* ScrollElasticityController.h */; };
    490490                1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA8798F11CBE846003C664F /* PluginStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
     491                1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */; };
     492                1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; };
    491493                1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE780C051FDE00139F4F /* zoomInCursor.png */; };
    492494                1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */; };
     
    72057207                1AA84F03143BA7BD0051D153 /* ScrollElasticityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollElasticityController.h; sourceTree = "<group>"; };
    72067208                1AA8798F11CBE846003C664F /* PluginStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginStrategy.h; sourceTree = "<group>"; };
     7209                1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTree.cpp; sourceTree = "<group>"; };
     7210                1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTree.h; sourceTree = "<group>"; };
    72077211                1AB1AE780C051FDE00139F4F /* zoomInCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomInCursor.png; sourceTree = "<group>"; };
    72087212                1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomOutCursor.png; sourceTree = "<group>"; };
     
    1392013924                                1AF62F2014DAFE790041556C /* ScrollingThread.cpp */,
    1392113925                                1AF62F2114DAFE790041556C /* ScrollingThread.h */,
     13926                                1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */,
     13927                                1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */,
    1392213928                        );
    1392313929                        path = scrolling;
     
    2409924105                                1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
    2410024106                                1AF62F2614DAFEA10041556C /* ScrollingThread.h in Headers */,
     24107                                1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */,
    2410124108                        );
    2410224109                        runOnlyForDeploymentPostprocessing = 0;
     
    2702727034                                1AF62F2414DAFE910041556C /* ScrollingThreadMac.mm in Sources */,
    2702827035                                1AF62F2514DAFE9E0041556C /* ScrollingThread.cpp in Sources */,
     27036                                1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */,
    2702927037                        );
    2703027038                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r106565 r106609  
    3737#include "ScrollAnimator.h"
    3838#include "ScrollingThread.h"
     39#include "ScrollingTree.h"
    3940#include <wtf/Functional.h>
    4041#include <wtf/MainThread.h>
     
    5051ScrollingCoordinator::ScrollingCoordinator(Page* page)
    5152    : m_page(page)
     53    , m_scrollingTree(ScrollingTree::create(this))
    5254    , m_didDispatchDidUpdateMainFrameScrollPosition(false)
    5355{
     
    5759{
    5860    ASSERT(!m_page);
     61    ASSERT(!m_scrollingTree);
    5962}
    6063
     
    6366    ASSERT(m_page);
    6467    m_page = 0;
     68
     69    // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
     70    ScrollingThread::dispatch(bind(&ScrollingTree::invalidate, m_scrollingTree.release()));
    6571}
    6672
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r106565 r106609  
    4545class Page;
    4646class PlatformWheelEvent;
     47class ScrollingTree;
    4748
    4849#if ENABLE(GESTURE_EVENTS)
     
    9798private:
    9899    Page* m_page;
     100    RefPtr<ScrollingTree> m_scrollingTree;
    99101
    100102    Mutex m_mainFrameGeometryMutex;
Note: See TracChangeset for help on using the changeset viewer.