Bug 197674 - Simplify logic to prevent App Nap in WebPage
Summary: Simplify logic to prevent App Nap in WebPage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-07 14:07 PDT by Chris Dumez
Modified: 2019-05-07 18:29 PDT (History)
6 users (show)

See Also:


Attachments
Patch (6.09 KB, patch)
2019-05-07 14:09 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.08 KB, patch)
2019-05-07 14:09 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.05 KB, patch)
2019-05-07 14:19 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews215 for win-future (13.38 MB, application/zip)
2019-05-07 16:52 PDT, Build Bot
no flags Details
Patch (6.00 KB, patch)
2019-05-07 18:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2019-05-07 14:07:28 PDT
Simplify logic to prevent App Nap login in WebPage. We do not need both m_userActivityHysteresis and m_userActivity since UserActivity is already a HysteresisActivity.
Comment 1 Chris Dumez 2019-05-07 14:09:09 PDT
Created attachment 369326 [details]
Patch
Comment 2 Chris Dumez 2019-05-07 14:09:51 PDT
Created attachment 369327 [details]
Patch
Comment 3 Geoffrey Garen 2019-05-07 14:17:24 PDT
Comment on attachment 369327 [details]
Patch

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

r=me

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:768
> +    bool shouldAllowAppNapGivenPageState = m_isAppNapEnabled && !isActive && isVisuallyIdle;

Maybe call this isAppNapEnabledInThisPage. The if-then ("A given B") style of naming threw me off a bit.
Comment 4 Chris Dumez 2019-05-07 14:19:50 PDT
Created attachment 369329 [details]
Patch
Comment 5 Build Bot 2019-05-07 16:52:56 PDT
Comment on attachment 369329 [details]
Patch

Attachment 369329 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/12127898

New failing tests:
http/tests/css/filters-on-iframes.html
Comment 6 Build Bot 2019-05-07 16:52:58 PDT
Created attachment 369334 [details]
Archive of layout-test-results from ews215 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews215  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 7 Alex Christensen 2019-05-07 17:13:55 PDT
Comment on attachment 369329 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:419
> +    , m_isAppNapEnabled(true)

While we're touching these, could we use initializer lists in the header?
Comment 8 Chris Dumez 2019-05-07 17:53:50 PDT
(In reply to Alex Christensen from comment #7)
> Comment on attachment 369329 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=369329&action=review
> 
> > Source/WebKit/WebProcess/WebPage/WebPage.cpp:419
> > +    , m_isAppNapEnabled(true)
> 
> While we're touching these, could we use initializer lists in the header?

Good point, will fix before landing.
Comment 9 Chris Dumez 2019-05-07 18:02:00 PDT
Created attachment 369345 [details]
Patch
Comment 10 WebKit Commit Bot 2019-05-07 18:28:31 PDT
Comment on attachment 369345 [details]
Patch

Clearing flags on attachment: 369345

Committed r245048: <https://trac.webkit.org/changeset/245048>
Comment 11 WebKit Commit Bot 2019-05-07 18:28:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2019-05-07 18:29:25 PDT
<rdar://problem/50564901>