Bug 140019 - Move scrolling code off of WTF::bind
Summary: Move scrolling code off of WTF::bind
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-31 13:13 PST by Sam Weinig
Modified: 2015-01-01 13:20 PST (History)
5 users (show)

See Also:


Attachments
Patch (14.19 KB, patch)
2014-12-31 13:15 PST, Sam Weinig
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2014-12-31 13:13:22 PST
Move scolling code off of WTF::bind
Comment 1 Sam Weinig 2014-12-31 13:15:32 PST
Created attachment 243852 [details]
Patch
Comment 2 Darin Adler 2014-12-31 20:52:05 PST
Comment on attachment 243852 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243852&action=review

> Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp:62
> +    RefPtr<ThreadedScrollingTree> threadedScrollingTree(this);

Can this be Ref instead of RefPtr?

> Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp:106
> +    RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;

Can this be Ref instead of RefPtr?

> Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp:120
> +    RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;

Can this be Ref instead of RefPtr?

> Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp:89
> +    RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;

Can this be Ref instead of RefPtr?

> Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm:74
>      RefPtr<ThreadedScrollingTree> scrollingTree = static_pointer_cast<ThreadedScrollingTree>(releaseScrollingTree());

Can this be Ref instead of RefPtr?

> Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm:97
> +    RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree());

Can this be Ref instead of RefPtr?

> Source/WebCore/platform/MemoryPressureHandler.cpp:146
> +        ScrollingThread::dispatch([] {
> +            WTF::releaseFastMallocFreeMemory();
> +        });

Does this work?

    ScrollingThread::dispatch(WTF::releaseFastMallocFreeMemory);

If not, why not?

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp:149
> +    RefPtr<EventDispatcher> eventDispatcher(this);

Can this be Ref instead of RefPtr?

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp:192
> +        RefPtr<EventDispatcher> eventDispatcher(this);

Can this be Ref instead of RefPtr?

> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:195
> +        RefPtr<ScrollingTree> scrollingTree = scrollingCoordinator->scrollingTree();

Can this be Ref instead of RefPtr?
Comment 3 Sam Weinig 2014-12-31 23:24:08 PST
I don't think they can be Refs, since Ref doesn't have a copy constructor. When we have new enough compilers, we should be able to use Refs and move them into the lambda (using the fun [std::move(refVariable)] syntax), but I don't think we can do that right now.
Comment 4 Sam Weinig 2015-01-01 13:20:20 PST
Committed r177848: <http://trac.webkit.org/changeset/177848>