Changeset 269908 in webkit


Ignore:
Timestamp:
Nov 17, 2020 9:28:09 AM (3 years ago)
Author:
Chris Dumez
Message:

[iOS] Stop leaking an XPC transaction in our XPC services
https://bugs.webkit.org/show_bug.cgi?id=219036

Reviewed by Geoffrey Garen.

Stop leaking an XPC transaction in our XPC services on iOS. We were doing this to control the lifetime of our child services
ourselves. However, this is not needed on iOS because the UIProcess takes RunningBoard process assertions on behalf of its
child processes.

I have verified that our child processes do not exit/jetsam early. I have verified that our child processes are in the
correct jetsam band (IDLE/0 when background and FG/10 when foreground). I have also verified that the main thread of these
processes runs at UserInitiated QoS before and after this change.

  • Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:

(WebKit::XPCServiceInitializer):

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

(WebKit::XPCServiceExit):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r269907 r269908  
     12020-11-17  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] Stop leaking an XPC transaction in our XPC services
     4        https://bugs.webkit.org/show_bug.cgi?id=219036
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Stop leaking an XPC transaction in our XPC services on iOS. We were doing this to control the lifetime of our child services
     9        ourselves. However, this is not needed on iOS because the UIProcess takes RunningBoard process assertions on behalf of its
     10        child processes.
     11
     12        I have verified that our child processes do not exit/jetsam early. I have verified that our child processes are in the
     13        correct jetsam band (IDLE/0 when background and FG/10 when foreground). I have also verified that the main thread of these
     14        processes runs at UserInitiated QoS before and after this change.
     15
     16        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
     17        (WebKit::XPCServiceInitializer):
     18        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
     19        (WebKit::XPCServiceExit):
     20
    1212020-11-17  Peng Liu  <peng.liu6@apple.com>
    222
  • trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h

    r268605 r269908  
    9292
    9393    // We don't want XPC to be in charge of whether the process should be terminated or not,
    94     // so ensure that we have an outstanding transaction here.
     94    // so ensure that we have an outstanding transaction here. This is not needed on iOS because
     95    // the UIProcess takes process assertions on behalf of its child processes.
     96#if PLATFORM(MAC)
    9597ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    9698    xpc_transaction_begin();
    9799ALLOW_DEPRECATED_DECLARATIONS_END
     100#endif
    98101
    99102    InitializeWebKit2();
  • trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm

    r269696 r269908  
    145145    // Make sure to destroy the priority boost message to avoid leaking a transaction.
    146146    priorityBoostMessage = nullptr;
     147
    147148    // Balances the xpc_transaction_begin() in XPCServiceInitializer.
     149#if PLATFORM(MAC)
    148150ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    149151    xpc_transaction_end();
    150152ALLOW_DEPRECATED_DECLARATIONS_END
     153#endif
     154
    151155    xpc_transaction_exit_clean();
    152156}
Note: See TracChangeset for help on using the changeset viewer.