Bug 209911 - [macOS] Remove redundant call to check in with Launch Services
Summary: [macOS] Remove redundant call to check in with Launch Services
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-02 09:11 PDT by Per Arne Vollan
Modified: 2020-04-02 11:26 PDT (History)
3 users (show)

See Also:


Attachments
Patch (10.02 KB, patch)
2020-04-02 09:18 PDT, Per Arne Vollan
darin: review+
Details | Formatted Diff | Diff
Patch (10.48 KB, patch)
2020-04-02 10:27 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].