[webkit-changes] [WebKit/WebKit] 674067: PlatformXR::Device should inherit from ThreadSafeR...

Commit Queue noreply at github.com
Mon Aug 21 17:31:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 67406716ae559868268762cfc8cd5350a4eb1f73
      https://github.com/WebKit/WebKit/commit/67406716ae559868268762cfc8cd5350a4eb1f73
  Author: David Kilzer <ddkilzer at apple.com>
  Date:   2023-08-21 (Mon, 21 Aug 2023)

  Changed paths:
    M Source/WebCore/Modules/webxr/WebXRSession.cpp
    M Source/WebCore/Modules/webxr/WebXRSession.h
    M Source/WebCore/Modules/webxr/WebXRSystem.cpp
    M Source/WebCore/Modules/webxr/WebXRSystem.h
    M Source/WebCore/platform/xr/PlatformXR.h
    M Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp
    M Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h
    M Source/WebCore/testing/WebFakeXRDevice.cpp
    M Source/WebCore/testing/WebFakeXRDevice.h
    M Source/WebKit/Shared/XR/XRDeviceProxy.cpp

  Log Message:
  -----------
  PlatformXR::Device should inherit from ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<>
https://bugs.webkit.org/show_bug.cgi?id=258494
<rdar://111265303>

Reviewed by Alex Christensen.

* Source/WebCore/Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::WebXRSession):
- Use `device` argument instead of calling m_device.get().
(WebCore::WebXRSession::~WebXRSession):
(WebCore::WebXRSession::referenceSpaceIsSupported const):
(WebCore::WebXRSession::requestReferenceSpace):
(WebCore::WebXRSession::recommendedWebGLFramebufferResolution const):
(WebCore::WebXRSession::supportsViewportScaling const):
(WebCore::WebXRSession::shutdown):
(WebCore::WebXRSession::didCompleteShutdown):
(WebCore::WebXRSession::requestFrameIfNeeded):
(WebCore::WebXRSession::onFrame):
* Source/WebCore/Modules/webxr/WebXRSession.h:
* Source/WebCore/Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::WebXRSystem):
- Switch to use DummyInlineDevice::create().
(WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected):
(WebCore::WebXRSystem::obtainCurrentDevice):
(WebCore::WebXRSystem::isSessionSupported):
(WebCore::WebXRSystem::resolveRequestedFeatures const):
(WebCore::WebXRSystem::resolveFeaturePermissions const):
(WebCore::WebXRSystem::requestSession):
(WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting):
(WebCore::WebXRSystem::DummyInlineDevice::create): Add.
* Source/WebCore/Modules/webxr/WebXRSystem.h:
(WebCore::WebXRSystem::hasActiveImmersiveXRDevice):
- Switch from using `PlatformXR::Device*` to
  `ThreadSafeWeakPtr<PlatformXR::Device>`.
(WebCore::WebXRSystem::DummyInlineDevice::create): Add.

* Source/WebCore/platform/xr/PlatformXR.h:
- Change PlatformXR::Device to inherit from
  ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<> since it currently
  inherits from ThreadSafeRefCounted<> and CanMakeWeakPtr<> separately.
(PlatformXR::Device::ref const): Add.
(PlatformXR::Device::deref const): Add.
(PlatformXR::Device::controlBlock const): Add.
- Add methods needed for
  ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<>.

* Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::~OpenXRDevice): Remove.
(PlatformXR::OpenXRDevice::endSession):
(PlatformXR::OpenXRDevice::updateInteractionProfile):
- Switch from using `WeakPtr<PlatformXR::Device>` to
  `ThreadSafeWeakPtr<PlatformXR::Device>`.
* Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h:
(WebCore::PlatformXR::OpenXRDevice::~OpenXRDevice):
- Make destructor virtual and define as default here.

* Source/WebCore/testing/WebFakeXRDevice.cpp:
(WebCore::SimulatedXRDevice::initializeTrackingAndRendering):
- Switch from using `WeakPtr<PlatformXR::Device>` to
  `ThreadSafeWeakPtr<PlatformXR::Device>`.
* Source/WebCore/testing/WebFakeXRDevice.h:
(WebCore::SimulatedXRDevice::~SimulatedXRDevice):
- Make destructor virtual.
* Source/WebKit/Shared/XR/XRDeviceProxy.cpp:
(WebKit::XRDeviceProxy::initializeTrackingAndRendering):
- Switch from using `WeakPtr<PlatformXR::Device>` to
  `ThreadSafeWeakPtr<PlatformXR::Device>`.

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




More information about the webkit-changes mailing list