Bug 159280

Summary: [iOS] Process suspension is prevented for 30 seconds after closing a tab
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, barraclough, beidson, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 159284    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch without Gavin's refactoring
none
Patch with Gavin's refactoring
none
Patch none

Description Chris Dumez 2016-06-29 15:54:07 PDT
Process suspension is prevented for 30 seconds after closing a tab due to ConnectionTerminationWatchdog holding a background assertion.
Comment 1 Chris Dumez 2016-06-29 15:54:27 PDT
<rdar://problem/27014867>
Comment 2 Chris Dumez 2016-06-29 16:11:30 PDT
Created attachment 282385 [details]
Patch
Comment 3 WebKit Commit Bot 2016-06-29 16:13:48 PDT
Attachment 282385 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:156:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Chris Dumez 2016-06-29 17:00:47 PDT
Created attachment 282392 [details]
Patch
Comment 5 WebKit Commit Bot 2016-06-29 17:01:46 PDT
Attachment 282392 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:156:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Chris Dumez 2016-06-29 18:59:32 PDT
Created attachment 282407 [details]
Patch without Gavin's refactoring
Comment 7 WebKit Commit Bot 2016-06-29 19:00:56 PDT
Attachment 282407 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:157:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Chris Dumez 2016-06-29 19:01:22 PDT
The patch fixes the issue. However, I will need to rebaseline after Gavin lands his refactoring patch in Bug 159284.
Comment 9 Chris Dumez 2016-06-29 19:34:41 PDT
Created attachment 282409 [details]
Patch with Gavin's refactoring
Comment 10 WebKit Commit Bot 2016-06-29 19:36:03 PDT
Attachment 282409 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:158:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Gavin Barraclough 2016-06-30 11:18:22 PDT
Comment on attachment 282409 [details]
Patch with Gavin's refactoring

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

> Source/WebKit2/UIProcess/ProcessAssertion.h:63
> +    bool isValid() const { return m_isValid; }

Suggestion – make this an enum with three states – one for uninitialized.

Currently while uninitialized this enum disagrees with the state of BKSProcessAssertion.

> Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:158
> +    m_assertion.get().invalidationHandler = ^() {

I'm worried about the lifetime of this callback – I think you should reset this in the destructor.
Comment 12 Chris Dumez 2016-06-30 12:26:07 PDT
Created attachment 282455 [details]
Patch
Comment 13 WebKit Commit Bot 2016-06-30 12:27:49 PDT
Attachment 282455 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:158:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 WebKit Commit Bot 2016-06-30 13:17:54 PDT
Comment on attachment 282455 [details]
Patch

Clearing flags on attachment: 282455

Committed r202696: <http://trac.webkit.org/changeset/202696>
Comment 15 WebKit Commit Bot 2016-06-30 13:17:59 PDT
All reviewed patches have been landed.  Closing bug.