Bug 159280 - [iOS] Process suspension is prevented for 30 seconds after closing a tab
Summary: [iOS] Process suspension is prevented for 30 seconds after closing a tab
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: 159284
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-29 15:54 PDT by Chris Dumez
Modified: 2016-06-30 13:17 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.83 KB, patch)
2016-06-29 16:11 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.28 KB, patch)
2016-06-29 17:00 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch without Gavin's refactoring (6.23 KB, patch)
2016-06-29 18:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch with Gavin's refactoring (8.50 KB, patch)
2016-06-29 19:34 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (7.68 KB, patch)
2016-06-30 12:26 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 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.