Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 34b6dd893e5eaf874599683d8fe1947125400f24
      
https://github.com/WebKit/WebKit/commit/34b6dd893e5eaf874599683d8fe1947125400f24
  Author: Sergio Villar Senin <[email protected]>
  Date:   2026-06-26 (Fri, 26 Jun 2026)

  Changed paths:
    M Source/WebCore/Modules/webxr/XRLayerBacking.h
    M Source/WebCore/Modules/webxr/XRWebGLBinding.cpp
    M Source/WebCore/Modules/webxr/XRWebGLLayerBacking.h

  Log Message:
  -----------
  [SaferCPP][WebXR] Use safer downcasts for WebGL layer backings
https://bugs.webkit.org/show_bug.cgi?id=317911

Reviewed by Dan Glastonbury.

Use downcast<> instead of static_cast<> as recommended by the safer cpp
guidelines[1] as it validates the type at runtime.

No new tests required.

[1] 
https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines#use-downcast-when-casting-to-a-subclass-type

* Source/WebCore/Modules/webxr/XRLayerBacking.h:
(WebCore::XRLayerBacking::isWebGLBacking const):
* Source/WebCore/Modules/webxr/XRWebGLBinding.cpp:
(WebCore::XRWebGLBinding::allocateColorTexturesForLayer):
(WebCore::XRWebGLBinding::allocateDepthTexturesForLayer):
(WebCore::XRWebGLBinding::allocateColorTexturesForProjectionLayer):
(WebCore::XRWebGLBinding::allocateDepthTexturesForProjectionLayer):
* Source/WebCore/Modules/webxr/XRWebGLLayerBacking.h:
(isType):

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



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

Reply via email to