Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 46084296a9c53dcb0fbf6e2ea6f36f611c3f0df3
      
https://github.com/WebKit/WebKit/commit/46084296a9c53dcb0fbf6e2ea6f36f611c3f0df3
  Author: Ruthvik Konda <[email protected]>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M Source/WebCore/Modules/webxr/WebXRHitTestSource.cpp
    M Source/WebCore/Modules/webxr/WebXRInputSource.cpp
    M Source/WebCore/Modules/webxr/WebXRSession.cpp
    M Source/WebCore/Modules/webxr/WebXRSystem.cpp
    M Source/WebCore/Modules/webxr/WebXRTransientInputHitTestSource.cpp

  Log Message:
  -----------
  Reduce use of `.get()` for smart pointers in WebXR
https://bugs.webkit.org/show_bug.cgi?id=315623
rdar://177997024

Reviewed by Mike Wyrzykowski.

Follow-up to the WebGPU `.get()` cleanup. `RefPtr<T>` has constructors
that take `WeakPtr<T>` and `ThreadSafeWeakPtr<T>` directly (RefPtr.h:104,
L106), each calling `.get()` internally. Removing redundant `.get()`
calls at eighteen sites across six files in `Source/WebCore/Modules/webxr/`
simplifies the code without changing behavior — the constructor invokes
`.get()` itself.

For the fourteen statement-form `RefPtr` initializations from `WeakPtr`
or `ThreadSafeWeakPtr`, also switched from copy-init (`=`) to brace-init
(`{}`) per current WebKit style.

No new tests needed (no behavioral change).

* Source/WebCore/Modules/webxr/WebXRHitTestSource.cpp:
(WebCore::WebXRHitTestSource::cancel):
* Source/WebCore/Modules/webxr/WebXRInputSource.cpp:
(WebCore::WebXRInputSource::update):
(WebCore::WebXRInputSource::pollEvents):
* Source/WebCore/Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::~WebXRSession):
(WebCore::WebXRSession::referenceSpaceIsSupported):
(WebCore::WebXRSession::requestReferenceSpace):
(WebCore::WebXRSession::recommendedWebGLFramebufferResolution):
(WebCore::WebXRSession::supportsViewportScaling):
(WebCore::WebXRSession::shutdown):
(WebCore::WebXRSession::didCompleteShutdown):
(WebCore::WebXRSession::requestFrameIfNeeded):
(WebCore::WebXRSession::onFrame):
(WebCore::WebXRSession::maxRenderLayers):
* Source/WebCore/Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected):
(WebCore::WebXRSystem::isSessionSupported):
(WebCore::WebXRSystem::requestSession):
* Source/WebCore/Modules/webxr/WebXRTransientInputHitTestSource.cpp:
(WebCore::WebXRTransientInputHitTestSource::cancel):

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



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

Reply via email to