Bug 203633

Summary: [iOS][WK2] Simplify process assertion handling for the network process and service worker processes
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, commit-queue, ggaren, koivisto, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

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>