Title: [269908] trunk/Source/WebKit
Revision
269908
Author
cdu...@apple.com
Date
2020-11-17 09:28:09 -0800 (Tue, 17 Nov 2020)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (269907 => 269908)


--- trunk/Source/WebKit/ChangeLog	2020-11-17 17:25:27 UTC (rev 269907)
+++ trunk/Source/WebKit/ChangeLog	2020-11-17 17:28:09 UTC (rev 269908)
@@ -1,3 +1,23 @@
+2020-11-17  Chris Dumez  <cdu...@apple.com>
+
+        [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):
+
 2020-11-17  Peng Liu  <peng.l...@apple.com>
 
         [Media In GPU Process][MSE] Add infrastructure needed to run MediaPlayerPrivateMediaSourceAVFObjC in the GPU process

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h (269907 => 269908)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2020-11-17 17:25:27 UTC (rev 269907)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2020-11-17 17:28:09 UTC (rev 269908)
@@ -91,10 +91,13 @@
     XPCServiceInitializerDelegateType delegate(WTFMove(connection), initializerMessage);
 
     // We don't want XPC to be in charge of whether the process should be terminated or not,
-    // so ensure that we have an outstanding transaction here.
+    // so ensure that we have an outstanding transaction here. This is not needed on iOS because
+    // the UIProcess takes process assertions on behalf of its child processes.
+#if PLATFORM(MAC)
 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     xpc_transaction_begin();
 ALLOW_DEPRECATED_DECLARATIONS_END
+#endif
 
     InitializeWebKit2();
 

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm (269907 => 269908)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2020-11-17 17:25:27 UTC (rev 269907)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2020-11-17 17:28:09 UTC (rev 269908)
@@ -144,10 +144,14 @@
 {
     // Make sure to destroy the priority boost message to avoid leaking a transaction.
     priorityBoostMessage = nullptr;
+
     // Balances the xpc_transaction_begin() in XPCServiceInitializer.
+#if PLATFORM(MAC)
 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     xpc_transaction_end();
 ALLOW_DEPRECATED_DECLARATIONS_END
+#endif
+
     xpc_transaction_exit_clean();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to