Bug 221094 - [macOS] Regression(r271897) Prewarmed WebProcesses no longer get a user-friendly process name in Activity Monitor
Summary: [macOS] Regression(r271897) Prewarmed WebProcesses no longer get a user-frien...
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: 221144
Blocks: 220952
  Show dependency treegraph
 
Reported: 2021-01-28 10:39 PST by Chris Dumez
Modified: 2021-02-02 08:31 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.36 KB, patch)
2021-01-28 10:42 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (11.29 KB, patch)
2021-02-01 15:11 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 2021-01-28 10:39:13 PST
WebProcess::updateProcessName should initiate network process connection if none exists, instead of giving up and returning early in this case. Same policy applies to WebProcess::updateActivePages.
Comment 1 Chris Dumez 2021-01-28 10:39:26 PST
<rdar://73658122>
Comment 2 Chris Dumez 2021-01-28 10:42:24 PST
Created attachment 418656 [details]
Patch
Comment 3 Per Arne Vollan 2021-01-28 10:47:19 PST
Comment on attachment 418656 [details]
Patch

R=me. Thanks!
Comment 4 EWS 2021-01-28 11:42:05 PST
Committed r272020: <https://trac.webkit.org/changeset/272020>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418656 [details].
Comment 5 Chris Dumez 2021-01-28 13:58:21 PST
Follow-up build fix: <https://trac.webkit.org/changeset/272034>
Comment 6 WebKit Commit Bot 2021-01-29 11:12:52 PST
Re-opened since this is blocked by bug 221144
Comment 7 Chris Dumez 2021-02-01 13:59:45 PST
Comment on attachment 418656 [details]
Patch

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

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:467
> +    ensureNetworkProcessConnection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(displayName, Vector<String>(), auditToken), 0);

Looks like the issue is that for we need a sessionID to initiate the connection to the network process. Prewarmed WebProcesses don't get a sessionID until after they're used by an actual page.

This seems to indicate that the current design (having the network process set the WebProcess name) is not currently compatible with prewarmed WebProcesses.. One way to address this may be to allow initiating a connection to the networkProcess without a sessionID and allow the sessionID to be set later on.
Comment 8 Chris Dumez 2021-02-01 15:11:50 PST
Created attachment 418933 [details]
Patch
Comment 9 Per Arne Vollan 2021-02-02 06:02:33 PST
Comment on attachment 418933 [details]
Patch

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

Thanks! R=me.

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:482
> +        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(displayName, Vector<String>(), auditToken), 0);

Is it sufficient to only call ensureNetworkProcessConnection().send here?

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:769
> +    ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(overrideDisplayName, activePagesOrigins(m_pageMap), auditToken), 0);

Ditto.
Comment 10 Chris Dumez 2021-02-02 08:26:14 PST
(In reply to Per Arne Vollan from comment #9)
> Comment on attachment 418933 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=418933&action=review
> 
> Thanks! R=me.
> 
> > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:482
> > +        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(displayName, Vector<String>(), auditToken), 0);
> 
> Is it sufficient to only call ensureNetworkProcessConnection().send here?
> 
> > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:769
> > +    ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UpdateActivePages(overrideDisplayName, activePagesOrigins(m_pageMap), auditToken), 0);
> 
> Ditto.

No, NetworkProcessConnection has no send() message and does not subclass IPC::MessageSender currently.
Comment 11 EWS 2021-02-02 08:31:16 PST
Committed r272209: <https://trac.webkit.org/changeset/272209>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418933 [details].