Bug 61700 - Need WebKit2 API to get the size of the render tree
Summary: Need WebKit2 API to get the size of the render tree
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-05-28 21:06 PDT by Beth Dakin
Modified: 2011-05-29 14:25 PDT (History)
4 users (show)

See Also:


Attachments
Patch (9.25 KB, patch)
2011-05-28 21:12 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2011-05-28 21:06:18 PDT
<rdar://problem/9512733>

We need a WebKit 2 API to get the size of the render tree.

Patch forthcoming.
Comment 1 Beth Dakin 2011-05-28 21:12:39 PDT
Created attachment 95280 [details]
Patch

Right now this is set up to send the updated render tree size to the UI process in every FrameView::performPostLayoutTasks(). Then the value is cached in the UIProcess. While convenient, we may want to improve on this later to avoid sending so many messages. In the meantime, this does not have any measurable affect on performance.
Comment 2 Simon Fraser (smfr) 2011-05-28 21:19:13 PDT
Comment on attachment 95280 [details]
Patch

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

> Source/WebCore/page/ChromeClient.h:328
> +        virtual void setRenderTreeSize(size_t) { }

'size' is ambiguous: memory use, renderer count? A more explicit name would help.

> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:801
> +    m_page->send(Messages::WebPageProxy::SetRenderTreeSize(treeSize));

Is there an existing message that we pass whose payload can be expanded to carry these data?
Comment 3 Beth Dakin 2011-05-28 23:44:20 PDT
(In reply to comment #2)
> (From update of attachment 95280 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=95280&action=review
> 
> > Source/WebCore/page/ChromeClient.h:328
> > +        virtual void setRenderTreeSize(size_t) { }
> 
> 'size' is ambiguous: memory use, renderer count? A more explicit name would help.
> 

I'll think on this.

> > Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:801
> > +    m_page->send(Messages::WebPageProxy::SetRenderTreeSize(treeSize));
> 
> Is there an existing message that we pass whose payload can be expanded to carry these data?

We could be mistaken (must consult Sam or Anders), but Geoff and I think CoreIPC automatically bundles small messages into one bigger message.
Comment 4 Darin Adler 2011-05-29 11:10:13 PDT
Comment on attachment 95280 [details]
Patch

Patch looks fine. No obvious better terminology to use beyond “render tree size”. I could imagine more-abstract names or more-concrete names.
Comment 5 Darin Adler 2011-05-29 11:13:18 PDT
Comment on attachment 95280 [details]
Patch

Clearing flags on attachment: 95280

Committed r87638: <http://trac.webkit.org/changeset/87638>
Comment 6 Darin Adler 2011-05-29 11:13:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Darin Adler 2011-05-29 12:02:46 PDT
Half the patch wasn’t landed the first time.

Committed the other half as r87639: <http://trac.webkit.org/changeset/87639>
Comment 8 Sam Weinig 2011-05-29 14:25:16 PDT
> We could be mistaken (must consult Sam or Anders), but Geoff and I think CoreIPC automatically bundles small messages into one bigger message.

CoreIPC doesn't have this functionality.  All messages get a mach message.