⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 295287 in webkit


Ignore:
Timestamp:
Jun 6, 2022, 8:22:21 AM (4 years ago)
Author:
pvollan@apple.com
Message:

Eagerly soft link Data Detection frameworks
​https://bugs.webkit.org/show_bug.cgi?id=241267

Reviewed by Geoffrey Garen.

Eagerly soft link Data Detection frameworks in the WebContent process. There are two motivations behind this change.
First, soft linking frameworks may lead to communication with launchd. Doing the soft linking before the WebContent
process has finished launching, will help our effort in blocking launchd post launch. Second, the data detection
frameworks are normally used in every WebContent process, and eagerly soft linking them should be a performance
improvement. Ideally, these frameworks should be hard linked or weak linked. However, that would most likely create
cycles in the build dependencies.

  • Source/WebCore/PAL/pal/cocoa/DataDetectorsCoreSoftLink.h:
  • Source/WebCore/PAL/pal/cocoa/DataDetectorsCoreSoftLink.mm:
  • Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::softlinkDataDetectorsFrameworks):
(WebKit::WebProcess::platformInitializeWebProcess):

Canonical link: ​https://commits.webkit.org/251333@main

Location:
trunk/Source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/pal/cocoa/DataDetectorsCoreSoftLink.h

    r294397 r295287  
    3030#include <pal/spi/cocoa/DataDetectorsCoreSPI.h>
    3131#include <wtf/SoftLinking.h>
     32
     33SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, DataDetectorsCore);
    3234
    3335SOFT_LINK_CLASS_FOR_HEADER(PAL, DDScannerResult)
  • trunk/Source/WebCore/PAL/pal/cocoa/DataDetectorsCoreSoftLink.mm

    r294397 r295287  
    3131#include <wtf/SoftLinking.h>
    3232
    33 SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(PAL, DataDetectorsCore)
     33SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, DataDetectorsCore, PAL_EXPORT)
    3434SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, DataDetectorsCore, DDScannerResult, PAL_EXPORT)
    3535
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r295270 r295287  
    155155#endif
    156156
     157#if ENABLE(DATA_DETECTION) && PLATFORM(IOS_FAMILY)
     158#import <pal/spi/ios/DataDetectorsUISPI.h>
     159#endif
     160
    157161#import <WebCore/MediaAccessibilitySoftLink.h>
    158162#import <pal/cf/AudioToolboxSoftLink.h>
    … …  
    224228}
    225229#endif
     230
     231static void softlinkDataDetectorsFrameworks()
     232{
     233#if ENABLE(DATA_DETECTION)
     234    PAL::isDataDetectorsCoreFrameworkAvailable();
     235#if PLATFORM(IOS_FAMILY)
     236    DataDetectorsUILibrary();
     237#endif // PLATFORM(IOS_FAMILY)
     238#endif // ENABLE(DATA_DETECTION)
     239}
    226240
    227241void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
    … …  
    419433    if (!isParentProcessAFullWebBrowser(*this))
    420434        disableURLSchemeCheckInDataDetectors();
     435
     436    // Soft link frameworks related to Data Detection before we disconnect from launchd because these frameworks connect to
     437    // launchd temporarily at link time to register XPC services. See rdar://93598951 (my feature request to stop doing that)
     438    softlinkDataDetectorsFrameworks();
    421439}
    422440
Note: See TracChangeset for help on using the changeset viewer.