Branch: refs/heads/webkitglib/2.46 Home: https://github.com/WebKit/WebKit Commit: cdf8f11cd1d858124bfc4a305d091bb7a5b3c62f https://github.com/WebKit/WebKit/commit/cdf8f11cd1d858124bfc4a305d091bb7a5b3c62f Author: Lauro Moura <lmo...@igalia.com> Date: 2024-09-03 (Tue, 03 Sep 2024)
Changed paths: M Source/WebDriver/glib/SessionHostGlib.cpp Log Message: ----------- Cherry-pick 283061@main (b00d19a0d891). https://bugs.webkit.org/show_bug.cgi?id=278804 [WebDriver][GLIB] Segfault with connection being closed by empty SetTargetList not related to disconnection https://bugs.webkit.org/show_bug.cgi?id=278804 Reviewed by Carlos Garcia Campos. 282489@main improved the teardown process for WebDriver sessions, but assumed `SessionHostGlib.cpp` `setTargetList` would receive an empty target list when the `RemoteInspector` requested `WebDriverService` to disconnect. But `setTargetList` might receive an empty list despite being still connected, as the message handler callback filters non-Automation targets out of the list before forwarding the list to the `setTargetList` method. For example, testing with GTK's MiniBrowser it always sends a first listing of a single WebPage target before sending the Automation target. Assuming the connection had been disconnected, `SessionHostGlib` then called `connectionDidClose`, leaving it in an inconsistent state when the proper `Automation` target arrived in a following `setTargetList` call, leading to segfaults. This commit changes the behavior to call `connectionDidClose` for empty lists _only_ when we already had received a valid Automation target before and we're connected to it. Also some drive-by cleanups, removing uneeded assertions already handled by earlier checks and clarifying comments. * Source/WebDriver/glib/SessionHostGlib.cpp: (WebDriver::SessionHost::setTargetList): Canonical link: https://commits.webkit.org/283061@main Canonical link: https://commits.webkit.org/282416.42@webkitglib/2.46 To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes