Bug 126473 - Simplify process suppression state calculation
Summary: Simplify process suppression state calculation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-03 17:00 PST by Gavin Barraclough
Modified: 2014-01-03 17:54 PST (History)
0 users

See Also:


Attachments
Fix (18.87 KB, patch)
2014-01-03 17:18 PST, Gavin Barraclough
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2014-01-03 17:00:39 PST
Don't check the application occlusion state (this is covered by the pages already), and let the page check visually idle. Remove layers of functions.
Comment 1 Gavin Barraclough 2014-01-03 17:18:54 PST
Created attachment 220358 [details]
Fix
Comment 2 Geoffrey Garen 2014-01-03 17:33:07 PST
Comment on attachment 220358 [details]
Fix

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

> ../OpenSource/Source/WebKit2/UIProcess/WebPageProxy.cpp:520
> +    return m_viewState & ViewState::IsVisuallyIdle && m_pageGroup->preferences()->pageVisibilityBasedProcessSuppressionEnabled();

Feels like this should have parens to indicate associativity.

> ../OpenSource/Source/WebKit2/UIProcess/mac/WebContextMac.mm:391
> +    for (const auto& context : WebContext::allContexts()) {

Why does this loop use "const auto&" while the other uses "auto*"?
Comment 3 Geoffrey Garen 2014-01-03 17:37:03 PST
Comment on attachment 220358 [details]
Fix

Since allContexts() is a vector of WebContext*, and since the range-based for loops do not intend to modify the contents of the vector, I think they should both just say "auto" -- neither "auto*" nor "const auto&".
Comment 4 Sam Weinig 2014-01-03 17:38:30 PST
Comment on attachment 220358 [details]
Fix

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

r=me as well.

>> ../OpenSource/Source/WebKit2/UIProcess/mac/WebContextMac.mm:391
>> +    for (const auto& context : WebContext::allContexts()) {
> 
> Why does this loop use "const auto&" while the other uses "auto*"?

This should use auto*.
Comment 5 Gavin Barraclough 2014-01-03 17:54:02 PST
Committed revision 161301.