Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ad1a65843e9e1fd4264ac34a4777729fa43f943f
      
https://github.com/WebKit/WebKit/commit/ad1a65843e9e1fd4264ac34a4777729fa43f943f
  Author: Chris Dumez <[email protected]>
  Date:   2024-08-07 (Wed, 07 Aug 2024)

  Changed paths:
    M Source/WebKit/Platform/IPC/Connection.cpp
    M Source/WebKit/Platform/IPC/Connection.h
    M Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm

  Log Message:
  -----------
  Fix logic for terminating a child process spamming us with IPC
https://bugs.webkit.org/show_bug.cgi?id=277746

Reviewed by Per Arne Vollan.

Make the following fixes to the logic:
1. Once the message queue size reaches 
maxPendingIncomingMessagesKillingThreshold, only
   call dispatchToClientWithIncomingMessagesLock() once to terminate the child 
process
   on the main thread. We used to dispatch a task for each message over the 
threshold,
   which was unnecessary.
2. After calling m_client->requestRemoteProcessTermination(), check if 
Connection::m_wasKilled
   is true. If it's not, call Connection::kill(). This used to be guaranteed 
when using XPC
   services since calling requestRemoteProcessTermination() would terminate the 
xpc connection.
   However, when using ExtensionKit (on iOS currently), it no longer kills the 
XPC connection
   since it is not required to terminate the child extension. This is useful 
because having
   Connection::m_wasKilled set to true causes 
Connection::enqueueIncomingMessage() do early
   return instead of doing work for every new incoming message while waiting 
for the child
   process to exit.

* Source/WebKit/Platform/IPC/Connection.cpp:
(IPC::Connection::enqueueIncomingMessage):

Canonical link: https://commits.webkit.org/281969@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to