Bug 240125

Summary: [WP] Wait for Launch Services database after Network process connection has been established
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ggaren, sihui_liu, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Per Arne Vollan 2022-05-05 09:21:44 PDT
Since the Launch Services database is provided to the WebContent process by the Network process, it makes sense to wait for the database when we're certain that the Network process is running. This should fix main thread hangs in the cases where we before started waiting for the database before the Network process had launched. To support this move, we also need to delay the initialization of accessibility in NSApplication, since that depends on having the database available. This is now being done in WebPage::platformInitializeAccessibility, which is a natural place for this initialization to take place.
Comment 1 Per Arne Vollan 2022-05-05 09:28:19 PDT
Created attachment 458880 [details]
Patch
Comment 2 Per Arne Vollan 2022-05-05 09:30:34 PDT
Created attachment 458881 [details]
Patch
Comment 3 Per Arne Vollan 2022-05-05 09:35:35 PDT
Created attachment 458883 [details]
Patch
Comment 4 Per Arne Vollan 2022-05-05 09:39:15 PDT
<rdar://92107043>
Comment 5 Geoffrey Garen 2022-05-05 15:03:50 PDT
Comment on attachment 458883 [details]
Patch

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

r=me

> Source/WebKit/WebProcess/WebProcess.cpp:1201
> +        // The NSApplication initialization is being done in [NSApplication _accessibilityInitialize]

No need to call accessibilityInitialize here.
Comment 6 Per Arne Vollan 2022-05-06 07:45:01 PDT
(In reply to Geoffrey Garen from comment #5)
> Comment on attachment 458883 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=458883&action=review
> 
> r=me
> 
> > Source/WebKit/WebProcess/WebProcess.cpp:1201
> > +        // The NSApplication initialization is being done in [NSApplication _accessibilityInitialize]
> 
> No need to call accessibilityInitialize here.

Looking closer, this actually seems to be inside a comment. Line wrapping made it look like a separate statement when we last looked at this.

Thanks for reviewing!
Comment 7 EWS 2022-05-06 08:24:35 PDT
Committed r293892 (250350@main): <https://commits.webkit.org/250350@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 458883 [details].
Comment 8 Geoffrey Garen 2022-05-06 10:17:00 PDT
Haha, that's the last time I review a patch on my phone! :P
Comment 9 Per Arne Vollan 2022-05-06 10:38:48 PDT
(In reply to Geoffrey Garen from comment #8)
> Haha, that's the last time I review a patch on my phone! :P

:)