Bug 165289 - [iOS] Add a WebView private configuration for changing the WebContent update frequency
Summary: [iOS] Add a WebView private configuration for changing the WebContent update ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-12-01 16:45 PST by Said Abou-Hallawa
Modified: 2016-12-02 19:59 PST (History)
9 users (show)

See Also:


Attachments
Patch (5.50 KB, patch)
2016-12-01 18:00 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (8.00 KB, patch)
2016-12-02 17:29 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (7.88 KB, patch)
2016-12-02 18:19 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (8.16 KB, patch)
2016-12-02 18:55 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2016-12-01 16:45:14 PST
We need a expose a preference which allows us to control the fps of web content updates.
Comment 1 Said Abou-Hallawa 2016-12-01 18:00:47 PST
Created attachment 295919 [details]
Patch
Comment 2 Tim Horton 2016-12-01 18:06:01 PST
Comment on attachment 295919 [details]
Patch

I think this should be a private WKWebViewConfiguration parameter instead. It's set-once, and shouldn't be adjustable by apps.
Comment 3 Jon Lee 2016-12-01 19:17:25 PST
rdar://problem/27928609
Comment 4 Said Abou-Hallawa 2016-12-02 17:29:56 PST
Created attachment 296029 [details]
Patch
Comment 5 Tim Horton 2016-12-02 17:35:17 PST
Comment on attachment 296029 [details]
Patch

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

> Source/WebKit2/UIProcess/API/APIPageConfiguration.h:122
> +    uint32_t m_contentUpdateFrequency = 0;

modern style would be uint32_t m_contentUpdateFrequency { 0 }

> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:480
> +- (NSNumber *)_contentUpdateFrequency

Why is this still NSNumber? NSUInteger or unsigned or something, no need for the boxing.

> Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:139
> +uint32_t RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency() const

Isn't this code compiled on Mac?
Comment 6 Said Abou-Hallawa 2016-12-02 18:19:38 PST
Created attachment 296031 [details]
Patch
Comment 7 Said Abou-Hallawa 2016-12-02 18:25:54 PST
Comment on attachment 296029 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/APIPageConfiguration.h:122
>> +    uint32_t m_contentUpdateFrequency = 0;
> 
> modern style would be uint32_t m_contentUpdateFrequency { 0 }

Fixed.

>> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:480
>> +- (NSNumber *)_contentUpdateFrequency
> 
> Why is this still NSNumber? NSUInteger or unsigned or something, no need for the boxing.

I changed it to NSUInteger.

>> Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:139
>> +uint32_t RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency() const
> 
> Isn't this code compiled on Mac?

Yes, you are right. I kept the function but I make it return a 0 for Mac. This is to avoid adding if the header file and WKOneShotDisplayLinkHandler initWithDrawingAreaProxy function.
Comment 8 Tim Horton 2016-12-02 18:29:24 PST
(In reply to comment #7)
> Comment on attachment 296029 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296029&action=review
> 
> >> Source/WebKit2/UIProcess/API/APIPageConfiguration.h:122
> >> +    uint32_t m_contentUpdateFrequency = 0;
> > 
> > modern style would be uint32_t m_contentUpdateFrequency { 0 }
> 
> Fixed.
> 
> >> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:480
> >> +- (NSNumber *)_contentUpdateFrequency
> > 
> > Why is this still NSNumber? NSUInteger or unsigned or something, no need for the boxing.
> 
> I changed it to NSUInteger.

OK.

> >> Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:139
> >> +uint32_t RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency() const
> > 
> > Isn't this code compiled on Mac?
> 
> Yes, you are right. I kept the function but I make it return a 0 for Mac.
> This is to avoid adding if the header file and WKOneShotDisplayLinkHandler
> initWithDrawingAreaProxy function.

WKOneShotDisplayLinkHandler is already #if'd
Comment 9 Said Abou-Hallawa 2016-12-02 18:55:53 PST
Created attachment 296032 [details]
Patch
Comment 10 WebKit Commit Bot 2016-12-02 19:59:19 PST
Comment on attachment 296032 [details]
Patch

Clearing flags on attachment: 296032

Committed r209294: <http://trac.webkit.org/changeset/209294>
Comment 11 WebKit Commit Bot 2016-12-02 19:59:22 PST
All reviewed patches have been landed.  Closing bug.