Bug 197674

Summary: Simplify logic to prevent App Nap in WebPage
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, commit-queue, ews-watchlist, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews215 for win-future
none
Patch none

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 EWS Watchlist 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 EWS Watchlist 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>