Bug 236629

Summary: Make sure there is a default Networking process to provide the Launch Services database
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, cdumez, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Per Arne Vollan 2022-02-14 19:19:09 PST
The WebContent processes relies on getting the Launch Services database from the Networking process. We should make sure there always is a Networking process to provide the database.
Comment 1 Per Arne Vollan 2022-02-14 19:25:52 PST
Created attachment 451981 [details]
Patch
Comment 2 Per Arne Vollan 2022-02-14 19:36:24 PST
Created attachment 451982 [details]
Patch
Comment 3 Per Arne Vollan 2022-02-14 19:37:20 PST
Created attachment 451983 [details]
Patch
Comment 4 Per Arne Vollan 2022-02-14 19:40:16 PST
Created attachment 451985 [details]
Patch
Comment 5 Per Arne Vollan 2022-02-15 08:04:27 PST
Created attachment 452025 [details]
Patch
Comment 6 Radar WebKit Bug Importer 2022-02-15 16:21:11 PST
<rdar://problem/88993803>
Comment 7 Per Arne Vollan 2022-02-15 17:26:23 PST
Created attachment 452113 [details]
Patch
Comment 8 Per Arne Vollan 2022-02-15 19:29:15 PST
Created attachment 452124 [details]
Patch
Comment 9 Chris Dumez 2022-02-15 19:41:41 PST
Comment on attachment 452124 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:-155
> -    while ([WKWebsiteDataStore _defaultNetworkProcessExists])

This seems like a bad regression. It is important for the network process to go away once it is no longer needed. Otherwise, any app that would use a WKWebView to display a simple help page once would carry an extra process and all its associated memory, forever.

You are essentially disabling this important API test and I don’t think it is ok.
Comment 10 Per Arne Vollan 2022-02-16 08:27:26 PST
(In reply to Chris Dumez from comment #9)
> Comment on attachment 452124 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=452124&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:-155
> > -    while ([WKWebsiteDataStore _defaultNetworkProcessExists])
> 
> This seems like a bad regression. It is important for the network process to
> go away once it is no longer needed. Otherwise, any app that would use a
> WKWebView to display a simple help page once would carry an extra process
> and all its associated memory, forever.
> 

Will it go away, though? There will still be a reference to the NetworkProcessProxy from a Website data store, preventing the Network process form exiting, I believe. I have checked the test above in the debugger, and the Network process does not exit when spinning the run loop after the test (also without the code change in this patch). Or perhaps I am mistaken?

Perhaps we should reset all references to the Network process proxy in the remaining Website data stores when the last Web process pool is deleted? I think that would make the Network process exit in the above test.
Comment 11 Per Arne Vollan 2022-02-16 14:14:37 PST
Created attachment 452248 [details]
Patch
Comment 12 Per Arne Vollan 2022-02-17 06:46:32 PST
Created attachment 452361 [details]
Patch
Comment 13 Brent Fulgham 2022-02-25 11:19:27 PST
Comment on attachment 452361 [details]
Patch

r=me
Comment 14 Per Arne Vollan 2022-02-25 11:21:53 PST
Comment on attachment 452361 [details]
Patch

Thanks for reviewing!
Comment 15 EWS 2022-02-25 12:10:11 PST
Committed r290521 (247804@main): <https://commits.webkit.org/247804@main>

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