Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: da5ff6caa5e892f109769af060b1e2e0761134e7
      
https://github.com/WebKit/WebKit/commit/da5ff6caa5e892f109769af060b1e2e0761134e7
  Author: Simon Pena <[email protected]>
  Date:   2026-07-09 (Thu, 09 Jul 2026)

  Changed paths:
    M Source/WebKit/UIProcess/XR/PlatformXRCoordinator.h
    M Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp
    M Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.cpp
    M Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.h
    A 
Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/TestOpenXRInstanceLifecycle.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/TestWebKitWebXR.cpp
    A Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/WebXRTestHelpers.h
    M Tools/TestWebKitAPI/glib/CMakeLists.txt
    A Tools/TestWebKitAPI/openxr-mock/MockOpenXRRuntime.cpp

  Log Message:
  -----------
  [OpenXR] Instance is never released when no session is started
https://bugs.webkit.org/show_bug.cgi?id=317657

Reviewed by Dan Glastonbury and Sergio Villar Senin.

When enumerating OpenXR devices, an OpenXR instance is created and kept
idle. If the page never starts a session, this instance is leaked, even
after the view is closed.

Destroy the idle instance on teardown, adding a test and a mock OpenXR
runtime to help verify creation / destruction parity.

* Source/WebKit/UIProcess/XR/PlatformXRCoordinator.h:
(WebKit::PlatformXRCoordinator::stopWhenIdle):
* Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp:
(WebKit::PlatformXRSystem::invalidate):
* Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.cpp:
(WebKit::OpenXRCoordinator::stopWhenIdle):
* Source/WebKit/UIProcess/XR/openxr/PlatformXROpenXR.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/TestOpenXRInstanceLifecycle.cpp: 
Added.
(mockEventCallback):
(destroyWaitTimeout):
(MockOpenXRControl::setEventCallback):
(openMockOpenXRControl):
(WebXRInstanceLifecycleTest::WebXRInstanceLifecycleTest):
(WebXRInstanceLifecycleTest::terminateWebProcess):
(WebXRInstanceLifecycleTest::waitForInstanceDestroyed):
(testOpenXRInstanceReleasedOnTeardown):
(beforeAll):
(afterAll):
* Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/TestWebKitWebXR.cpp:
(testWebKitXRHitTest):
(findFeature): Deleted.
(relaxDMABufRequirement): Deleted.
* Tools/TestWebKitAPI/Tests/WebKit/WKPage/glib/WebXRTestHelpers.h: Added.
(relaxDMABufRequirement):
* Tools/TestWebKitAPI/glib/CMakeLists.txt:
* Tools/TestWebKitAPI/openxr-mock/MockOpenXRRuntime.cpp: Added.
(mock_openxr_set_event_callback):
(xrNegotiateLoaderRuntimeInterface):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to