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

Changeset 284823 in webkit


Ignore:
Timestamp:
Oct 25, 2021, 2:33:50 PM (5 years ago)
Author:
achristensen@apple.com
Message:

Use xpc_connection_copy_invalidation_reason where available for debugging daemon connection failures
https://bugs.webkit.org/show_bug.cgi?id=232152

Reviewed by Brady Eidson.

Source/WebKit:

  • Platform/IPC/cocoa/DaemonConnectionCocoa.mm:

(WebKit::Daemon::ConnectionToMachService<Traits>::initializeConnectionIfNeeded const):

  • Shared/Daemon/DaemonUtilities.mm:

(WebKit::startListeningForMachServiceConnections):

Source/WTF:

  • wtf/PlatformHave.h:
  • wtf/spi/darwin/XPCSPI.h:
Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r284822 r284823  
     12021-10-25  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use xpc_connection_copy_invalidation_reason where available for debugging daemon connection failures
     4        https://bugs.webkit.org/show_bug.cgi?id=232152
     5
     6        Reviewed by Brady Eidson.
     7
     8        * wtf/PlatformHave.h:
     9        * wtf/spi/darwin/XPCSPI.h:
     10
    1112021-10-25  Ayumi Kojima  <ayumi_kojima@apple.com>
    212
  • trunk/Source/WTF/wtf/PlatformHave.h

    r284822 r284823  
    950950#define HAVE_AUDIO_OBJECT_PROPERTY_ELEMENT_MAIN 1
    951951#define HAVE_IMAGE_RESTRICTED_DECODING 1
     952#define HAVE_XPC_CONNECTION_COPY_INVALIDATION_REASON 1
    952953#endif
    953954
  • trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h

    r284233 r284823  
    138138extern "C" const char * const XPC_ACTIVITY_RANDOM_INITIAL_DELAY;
    139139extern "C" const char * const XPC_ACTIVITY_REQUIRE_NETWORK_CONNECTIVITY;
     140
     141#if HAVE(XPC_CONNECTION_COPY_INVALIDATION_REASON)
     142extern "C" char * xpc_connection_copy_invalidation_reason(xpc_connection_t connection);
     143#endif
    140144
    141145#if OS_OBJECT_USE_OBJC
  • trunk/Source/WebKit/ChangeLog

    r284819 r284823  
     12021-10-25  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use xpc_connection_copy_invalidation_reason where available for debugging daemon connection failures
     4        https://bugs.webkit.org/show_bug.cgi?id=232152
     5
     6        Reviewed by Brady Eidson.
     7
     8        * Platform/IPC/cocoa/DaemonConnectionCocoa.mm:
     9        (WebKit::Daemon::ConnectionToMachService<Traits>::initializeConnectionIfNeeded const):
     10        * Shared/Daemon/DaemonUtilities.mm:
     11        (WebKit::startListeningForMachServiceConnections):
     12
    1132021-10-25  Kate Cheney  <katherine_cheney@apple.com>
    214
  • trunk/Source/WebKit/Platform/IPC/cocoa/DaemonConnectionCocoa.mm

    r284129 r284823  
    6464        if (!weakThis)
    6565            return;
    66         if (event == XPC_ERROR_CONNECTION_INVALID)
     66        if (event == XPC_ERROR_CONNECTION_INVALID) {
     67#if HAVE(XPC_CONNECTION_COPY_INVALIDATION_REASON)
     68            auto reason = std::unique_ptr<char[]>(xpc_connection_copy_invalidation_reason(weakThis->m_connection.get()));
     69            WTFLogAlways("Failed to connect to mach service %s, reason: %s", weakThis->m_machServiceName.data(), reason.get());
     70#else
    6771            WTFLogAlways("Failed to connect to mach service %s, likely because it is not registered with launchd", weakThis->m_machServiceName.data());
     72#endif
     73        }
    6874        if (event == XPC_ERROR_CONNECTION_INTERRUPTED) {
    6975            // Daemon crashed, we will need to make a new connection to a new instance of the daemon.
  • trunk/Source/WebKit/Shared/Daemon/DaemonUtilities.mm

    r284203 r284823  
    4848
    4949        xpc_connection_set_event_handler(peer, ^(xpc_object_t event) {
    50             if (event == XPC_ERROR_CONNECTION_INVALID)
     50            if (event == XPC_ERROR_CONNECTION_INVALID) {
     51#if HAVE(XPC_CONNECTION_COPY_INVALIDATION_REASON)
     52                auto reason = std::unique_ptr<char[]>(xpc_connection_copy_invalidation_reason(peer));
     53                NSLog(@"Failed to start listening for connections to mach service %s, reason: %s", serviceName, reason.get());
     54#else
    5155                NSLog(@"Failed to start listening for connections to mach service %s, likely because it is not registered with launchd", serviceName);
     56#endif
     57            }
    5258            if (event == XPC_ERROR_CONNECTION_INTERRUPTED) {
    5359                NSLog(@"Removing peer connection %p", peer);
Note: See TracChangeset for help on using the changeset viewer.