Changeset 258512 in webkit


Ignore:
Timestamp:
Mar 16, 2020 12:50:59 PM (4 years ago)
Author:
pvollan@apple.com
Message:

[Cocoa] Only set CF prefs direct mode for the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=209091
<rdar://problem/60337842>

Reviewed by Brent Fulgham.

Currently, we enable CF prefs direct mode in XPCServiceMain. This is incorrect, it should only be enabled
for the WebContent process.

  • Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:

(WebKit::XPCServiceMain):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r258507 r258512  
     12020-03-16  Per Arne Vollan  <pvollan@apple.com>
     2
     3        [Cocoa] Only set CF prefs direct mode for the WebContent process
     4        https://bugs.webkit.org/show_bug.cgi?id=209091
     5        <rdar://problem/60337842>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Currently, we enable CF prefs direct mode in XPCServiceMain. This is incorrect, it should only be enabled
     10        for the WebContent process.
     11
     12        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
     13        (WebKit::XPCServiceMain):
     14
    1152020-03-16  David Kilzer  <ddkilzer@apple.com>
    216
  • trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm

    r257875 r258512  
    7171                    RELEASE_ASSERT_NOT_REACHED();
    7272
    73                
    7473                typedef void (*InitializerFunction)(xpc_connection_t, xpc_object_t, xpc_object_t);
    7574                InitializerFunction initializerFunctionPtr = reinterpret_cast<InitializerFunction>(CFBundleGetFunctionPointerForName(webKitBundle, entryPointFunctionName));
     
    107106}
    108107
    109 int XPCServiceMain(int, const char**)
     108int XPCServiceMain(int argc, const char** argv)
    110109{
     110    ASSERT(argc >= 1);
     111    ASSERT(argv[0]);
     112#if ENABLE(CFPREFS_DIRECT_MODE)
     113    if (argc >= 1 && argv[0] && strstr(argv[0], "com.apple.WebKit.WebContent")) {
     114        // Enable CFPrefs direct mode to avoid unsuccessfully attempting to connect to the daemon and getting blocked by the sandbox.
     115        _CFPrefsSetDirectModeEnabled(YES);
     116    }
     117#endif
     118
    111119    auto bootstrap = adoptOSObject(xpc_copy_bootstrap());
    112120#if PLATFORM(IOS_FAMILY)
     
    116124        return true;
    117125    });
    118 #endif
    119 
    120 #if ENABLE(CFPREFS_DIRECT_MODE)
    121     // Enable CF prefs direct mode to avoid connecting to the CF prefs daemon.
    122     _CFPrefsSetDirectModeEnabled(YES);
    123126#endif
    124127
Note: See TracChangeset for help on using the changeset viewer.