Bug 82083 - Too many ScrollAnimators are allocated on pages with frames
Summary: Too many ScrollAnimators are allocated on pages with frames
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-23 13:15 PDT by Beth Dakin
Modified: 2012-03-24 01:58 PDT (History)
5 users (show)

See Also:


Attachments
Patch (9.13 KB, patch)
2012-03-23 13:22 PDT, Beth Dakin
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2012-03-23 13:15:09 PDT
Currently, ScrollableArea::scrollAnimator() will create a ScrollAnimator to return if m_scrollAnimator is null. Because of this, we end up creating a ScrollAnimator for nearly every frame on webpages. For example, we allocate 22 ScrollAnimators on  http://www.disboards.com/showthread.php?t=2512881 even though only the main document needs one.

<rdar://problem/11070121>
Patch forthcoming.
Comment 1 Beth Dakin 2012-03-23 13:22:11 PDT
Created attachment 133547 [details]
Patch
Comment 2 Geoffrey Garen 2012-03-23 13:25:17 PDT
Comment on attachment 133547 [details]
Patch

nepotism=me
Comment 3 Beth Dakin 2012-03-23 13:37:08 PDT
Thanks Geoff! Committed http://trac.webkit.org/changeset/111896
Comment 4 Simon Fraser (smfr) 2012-03-23 13:41:16 PDT
Comment on attachment 133547 [details]
Patch

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

> Source/WebCore/platform/ScrollableArea.h:99
> +    ScrollAnimator* getExistingScrollAnimator() const { return m_scrollAnimator.get(); }

We usually avoid 'get' in accessors like this.
Comment 5 Beth Dakin 2012-03-23 13:42:14 PDT
(In reply to comment #4)
> (From update of attachment 133547 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=133547&action=review
> 
> > Source/WebCore/platform/ScrollableArea.h:99
> > +    ScrollAnimator* getExistingScrollAnimator() const { return m_scrollAnimator.get(); }
> 
> We usually avoid 'get' in accessors like this.

Would you prefer existingScrollAnmator()?
Comment 6 Beth Dakin 2012-03-23 14:03:21 PDT
Changed the name to existingScrollAnimator() : http://trac.webkit.org/changeset/111901
Comment 7 Nikolas Zimmermann 2012-03-24 01:58:07 PDT
(In reply to comment #6)
> Changed the name to existingScrollAnimator() : http://trac.webkit.org/changeset/111901

Hm, I'm still confused by your terminology.
I would have suggested to rename scrollAnimator() to ensureScrollAnimator(), and existingScrollAnimator() to scrollAnimator() - that's how we do it in numerous other places in WebCore.

scrollAnimator() sounds just like a simple accessor, anyone not reading the comment in the header, won't know it creates something. Would you want to prepare another patch? :-)