Bug 203370 - Simplify ProcessThrottler implementation
Summary: Simplify ProcessThrottler implementation
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-24 10:00 PDT by Chris Dumez
Modified: 2019-10-25 10:56 PDT (History)
4 users (show)

See Also:


Attachments
Patch (37.98 KB, patch)
2019-10-24 12:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (37.95 KB, patch)
2019-10-24 15:46 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 2019-10-24 10:00:05 PDT
Simplify ProcessThrottler implementation.
Comment 1 Chris Dumez 2019-10-24 12:38:04 PDT
Created attachment 381833 [details]
Patch
Comment 2 Alex Christensen 2019-10-24 13:26:48 PDT
Comment on attachment 381833 [details]
Patch

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

> Source/WebKit/ChangeLog:13
> +        - Wether the suspension is imminent or not, the child process now always responds with

Whether

> Source/WebKit/NetworkProcess/NetworkProcess.cpp:2087
> +void NetworkProcess::prepareToSuspend(uint64_t requestToSuspendID, bool isSuspensionImminent)

Could this be made a typed identifier?  Since it's only used for a reply, could you use sendWithAsyncReply instead?
Comment 3 Chris Dumez 2019-10-24 13:53:35 PDT
(In reply to Alex Christensen from comment #2)
> Comment on attachment 381833 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=381833&action=review
> 
> > Source/WebKit/ChangeLog:13
> > +        - Wether the suspension is imminent or not, the child process now always responds with
> 
> Whether
> 
> > Source/WebKit/NetworkProcess/NetworkProcess.cpp:2087
> > +void NetworkProcess::prepareToSuspend(uint64_t requestToSuspendID, bool isSuspensionImminent)
> 
> Could this be made a typed identifier?  Since it's only used for a reply,
> could you use sendWithAsyncReply instead?

Since the ProcessThrottler needs to know if the response is for the *last* request to suspend, I think the ProcessThrottler will still need an identifier, even if I use sendWithAsyncReply() for the IPC.
Using sendWithAsyncReply() for the IPC is likely feasible, I will try it out to see how it look.
Comment 4 Chris Dumez 2019-10-24 15:46:40 PDT
Created attachment 381850 [details]
Patch
Comment 5 Chris Dumez 2019-10-24 17:00:40 PDT
<rdar://problem/56547883>
Comment 6 Chris Dumez 2019-10-24 17:03:02 PDT
(In reply to Chris Dumez from comment #3)
> (In reply to Alex Christensen from comment #2)
> > Comment on attachment 381833 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=381833&action=review
> > 
> > > Source/WebKit/ChangeLog:13
> > > +        - Wether the suspension is imminent or not, the child process now always responds with
> > 
> > Whether
> > 
> > > Source/WebKit/NetworkProcess/NetworkProcess.cpp:2087
> > > +void NetworkProcess::prepareToSuspend(uint64_t requestToSuspendID, bool isSuspensionImminent)
> > 
> > Could this be made a typed identifier?  Since it's only used for a reply,
> > could you use sendWithAsyncReply instead?
> 
> Since the ProcessThrottler needs to know if the response is for the *last*
> request to suspend, I think the ProcessThrottler will still need an
> identifier, even if I use sendWithAsyncReply() for the IPC.
> Using sendWithAsyncReply() for the IPC is likely feasible, I will try it out
> to see how it look.

If you don't mind, I'd like to do this refactoring in a follow-up.
Comment 7 Alex Christensen 2019-10-24 17:31:20 PDT
Comment on attachment 381850 [details]
Patch

Sure
Comment 8 Chris Dumez 2019-10-24 18:07:13 PDT
Comment on attachment 381850 [details]
Patch

Clearing flags on attachment: 381850

Committed r251577: <https://trac.webkit.org/changeset/251577>
Comment 9 Chris Dumez 2019-10-24 18:07:15 PDT
All reviewed patches have been landed.  Closing bug.