Bug 131453

Summary: Update SPI for managing tabs
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: WebKit2Assignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, ap, mitz
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 131860    
Attachments:
Description Flags
Fix ap: review+

Description Gavin Barraclough 2014-04-09 14:26:25 PDT
.
Comment 1 Gavin Barraclough 2014-04-09 14:32:42 PDT
Created attachment 228983 [details]
Fix
Comment 2 Alexey Proskuryakov 2014-04-09 15:01:15 PDT
Comment on attachment 228983 [details]
Fix

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

Python script changes in the patch seem unrelated.

> Source/WebKit2/UIProcess/WebProcessProxy.h:226
> +    bool m_foreground;

I think that "m_assertionFlagsAreForeground" would be a more descriptive name for this.

Or perhaps we can ask m_assertion about whether it's taken?

> Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm:35
> +#define BACKGROUND_TAB_FLAGS (BKSProcessAssertionAllowIdleSleep)
> +#define FOREGROUND_TAB_FLAGS (BKSProcessAssertionAllowIdleSleep | BKSProcessAssertionPreventTaskSuspend | BKSProcessAssertionWantsForegroundResourcePriority | BKSProcessAssertionPreventTaskThrottleDown)

I'd use a const, not a #define.

> Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm:100
> +                LOG_ERROR("Unable to aquire assertion for WebContent process %d", pid);

Typo: aquire.

> Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm:104
> +        m_assertion = [[BKSProcessAssertion alloc] initWithPID:pid flags:flags reason:BKSProcessAssertionReasonExtension name:@"Web content visible" withHandler:handler];

This leaks, please use adoptNS().
Comment 3 Gavin Barraclough 2014-04-09 15:13:36 PDT
Transmitting file data ....
Committed revision 167039.
Comment 4 mitz 2014-04-09 21:10:36 PDT
(In reply to comment #2)
> (From update of attachment 228983 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=228983&action=review
> 
> Python script changes in the patch seem unrelated.
> 
> > Source/WebKit2/UIProcess/WebProcessProxy.h:226
> > +    bool m_foreground;
> 
> I think that "m_assertionFlagsAreForeground" would be a more descriptive name for this.
> 
> Or perhaps we can ask m_assertion about whether it's taken?
> 
> > Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm:35
> > +#define BACKGROUND_TAB_FLAGS (BKSProcessAssertionAllowIdleSleep)
> > +#define FOREGROUND_TAB_FLAGS (BKSProcessAssertionAllowIdleSleep | BKSProcessAssertionPreventTaskSuspend | BKSProcessAssertionWantsForegroundResourcePriority | BKSProcessAssertionPreventTaskThrottleDown)
> 
> I'd use a const, not a #define.

…and constants should be named like local variables, starting with a lowercase letter.