Bug 203633 - [iOS][WK2] Simplify process assertion handling for the network process and service worker processes
Summary: [iOS][WK2] Simplify process assertion handling for the network process and se...
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:
Blocks:
 
Reported: 2019-10-30 15:21 PDT by Chris Dumez
Modified: 2019-11-04 13:37 PST (History)
7 users (show)

See Also:


Attachments
Patch (25.20 KB, patch)
2019-10-30 15:35 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (25.00 KB, patch)
2019-10-30 15:47 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (37.82 KB, patch)
2019-11-04 11:30 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (37.81 KB, patch)
2019-11-04 12:29 PST, 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 2019-10-30 15:21:31 PDT
Simplify process assertion handling for the network process and service worker processes.
Comment 1 Chris Dumez 2019-10-30 15:35:08 PDT
Created attachment 382373 [details]
Patch
Comment 2 Chris Dumez 2019-10-30 15:47:54 PDT
Created attachment 382375 [details]
Patch
Comment 3 Chris Dumez 2019-10-31 13:31:07 PDT
Comment on attachment 382375 [details]
Patch

ping review?
Comment 4 Chris Dumez 2019-11-04 08:22:02 PST
ping review?
Comment 5 Alex Christensen 2019-11-04 08:34:29 PST
Comment on attachment 382375 [details]
Patch

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

> Source/WebKit/UIProcess/ProcessThrottler.h:95
> +    using ActivityVariant = Variant<std::nullptr_t, std::unique_ptr<BackgroundActivity>, std::unique_ptr<ForegroundActivity>>;

Could you use UniqueRef here?  You use the non-std::nullptr_t types as if they are always non-null, and right now the nullptr constructor is quite ambiguous.  I guess you only use the default constructor, but still...
Comment 6 Chris Dumez 2019-11-04 08:42:29 PST
(In reply to Alex Christensen from comment #5)
> Comment on attachment 382375 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=382375&action=review
> 
> > Source/WebKit/UIProcess/ProcessThrottler.h:95
> > +    using ActivityVariant = Variant<std::nullptr_t, std::unique_ptr<BackgroundActivity>, std::unique_ptr<ForegroundActivity>>;
> 
> Could you use UniqueRef here?  You use the non-std::nullptr_t types as if
> they are always non-null, and right now the nullptr constructor is quite
> ambiguous.  I guess you only use the default constructor, but still...

I am on the fence about this. I think this would mean having backgroundActivity() / foregroundActivity() return a UniqueRef instead of a unique_ptr, and then a lot of call sites would need to call moveToUniquePtr() to store it as a data member.
Comment 7 Chris Dumez 2019-11-04 11:30:55 PST
Created attachment 382754 [details]
Patch
Comment 8 Chris Dumez 2019-11-04 12:29:28 PST
Created attachment 382760 [details]
Patch
Comment 9 WebKit Commit Bot 2019-11-04 13:36:33 PST
Comment on attachment 382760 [details]
Patch

Clearing flags on attachment: 382760

Committed r252011: <https://trac.webkit.org/changeset/252011>
Comment 10 WebKit Commit Bot 2019-11-04 13:36:35 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2019-11-04 13:37:20 PST
<rdar://problem/56877865>