Bug 209911

Summary: [macOS] Remove redundant call to check in with Launch Services
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
darin: review+
Patch none

Description Per Arne Vollan 2020-04-02 09:11:37 PDT
There is no need to explicitly check in with Launch Services or call RegisterApplication in the WebContent process, since this is handled when calling [NSApplication _accessibilityInitialize].
Comment 1 Radar WebKit Bug Importer 2020-04-02 09:11:56 PDT
<rdar://problem/61210496>
Comment 2 Per Arne Vollan 2020-04-02 09:18:43 PDT
Created attachment 395271 [details]
Patch
Comment 3 Darin Adler 2020-04-02 09:24:46 PDT
Comment on attachment 395271 [details]
Patch

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

r=me assuming it builds and passes tests

> Source/WebCore/PAL/pal/spi/cocoa/CoreServicesSPI.h:28
> +extern "C" void _CSCheckFixDisable();

I would have expected this earlier in the file:

#if USE(APPLE_INTERNAL_SDK)

#include <CarbonCore/RuntimePriv.h>

#endif

Unless there is some reason we can’t or shouldn’t do that?

> Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h:108
> +typedef bool (^LSServerConnectionAllowedBlock) (CFDictionaryRef optionsRef);
> +extern "C" void _LSSetApplicationLaunchServicesServerConnectionStatus(uint64_t flags, LSServerConnectionAllowedBlock block);
> +extern "C" CFDictionaryRef _LSApplicationCheckIn(LSSessionID sessionID, CFDictionaryRef applicationInfo);

Similarly, kind of expected, within the #if USE(APPLE_INTERNAL_SDK) section:

#import <LaunchServices/LSApplicationServicesPriv.h>

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:542
> +    // _CSCheckFixDisable() needs to be called before checking in with Launch Services.

This comment leaves out critical context. It’s not obvious how this is the right place to do this. How is this place "before checking in with Launch Services"? The comment should say.
Comment 4 Per Arne Vollan 2020-04-02 10:27:51 PDT
Created attachment 395278 [details]
Patch
Comment 5 Per Arne Vollan 2020-04-02 10:28:57 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 395271 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=395271&action=review
> 
> r=me assuming it builds and passes tests
> 
> > Source/WebCore/PAL/pal/spi/cocoa/CoreServicesSPI.h:28
> > +extern "C" void _CSCheckFixDisable();
> 
> I would have expected this earlier in the file:
> 
> #if USE(APPLE_INTERNAL_SDK)
> 
> #include <CarbonCore/RuntimePriv.h>
> 
> #endif
> 
> Unless there is some reason we can’t or shouldn’t do that?
>

Fixed.
 
> > Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h:108
> > +typedef bool (^LSServerConnectionAllowedBlock) (CFDictionaryRef optionsRef);
> > +extern "C" void _LSSetApplicationLaunchServicesServerConnectionStatus(uint64_t flags, LSServerConnectionAllowedBlock block);
> > +extern "C" CFDictionaryRef _LSApplicationCheckIn(LSSessionID sessionID, CFDictionaryRef applicationInfo);
> 
> Similarly, kind of expected, within the #if USE(APPLE_INTERNAL_SDK) section:
> 
> #import <LaunchServices/LSApplicationServicesPriv.h>
> 

Added.

> > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:542
> > +    // _CSCheckFixDisable() needs to be called before checking in with Launch Services.
> 
> This comment leaves out critical context. It’s not obvious how this is the
> right place to do this. How is this place "before checking in with Launch
> Services"? The comment should say.

Fixed.

Thanks for reviewing!
Comment 6 EWS 2020-04-02 11:26:32 PDT
Committed r259396: <https://trac.webkit.org/changeset/259396>

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