Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 315714135986b5675269e7fa2eb1e1fe26b219fb
      
https://github.com/WebKit/WebKit/commit/315714135986b5675269e7fa2eb1e1fe26b219fb
  Author: Chris Dumez <[email protected]>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M Source/WTF/wtf/CheckedPtr.h
    M Source/WTF/wtf/CheckedRef.h
    M Source/WTF/wtf/Ref.h
    M Source/WTF/wtf/RefPtr.h
    M Source/WTF/wtf/UniqueRef.h
    M Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h
    M Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h
    M Source/WebCore/SaferCPPExpectations/ForwardDeclCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UncheckedLocalVarsCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UnretainedCallArgsCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UnretainedLocalVarsCheckerExpectations
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/accessibility/cocoa/AXCoreObjectCocoa.mm
    M Source/WebCore/accessibility/cocoa/AXTextMarkerCocoa.mm
    M Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm
    M Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm
    M Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
    M Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
    M Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
    M Source/WebCore/workers/WorkerGlobalScope.cpp
    M Source/WebCore/workers/WorkerMessagingProxy.cpp
    M Source/WebCore/workers/WorkerNotificationClient.cpp
    M Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp
    M Source/WebCore/workers/WorkerOrWorkletThread.cpp
    M Source/WebCore/workers/WorkerRunLoop.cpp
    M Source/WebCore/workers/WorkerThread.cpp
    M Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp
    M Source/WebGPU/SaferCPPExpectations/ForwardDeclCheckerExpectations
    M Source/WebGPU/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations
    M Source/WebGPU/SaferCPPExpectations/NoDeleteCheckerExpectations
    M Source/WebGPU/SaferCPPExpectations/NoUnretainedMemberCheckerExpectations
    M 
Source/WebGPU/SaferCPPExpectations/UncountedLambdaCapturesCheckerExpectations
    M Source/WebGPU/SaferCPPExpectations/UnretainedCallArgsCheckerExpectations
    M 
Source/WebGPU/SaferCPPExpectations/UnretainedLambdaCapturesCheckerExpectations
    M Source/WebGPU/SaferCPPExpectations/UnretainedLocalVarsCheckerExpectations
    M Source/WebGPU/WebGPU/APIConversions.h
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/Buffer.mm
    M Source/WebGPU/WebGPU/ComputePipeline.mm
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/ExternalTexture.h
    M Source/WebGPU/WebGPU/HardwareCapabilities.h
    M Source/WebGPU/WebGPU/WebGPUExt.h
    M 
Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI_Private_SPI/WritingToolsUISPI.h

  Log Message:
  -----------
  Address Safer C++ static analysis warnings in WebCore/accessibility, 
WebCore/workers and WebGPU
https://bugs.webkit.org/show_bug.cgi?id=325911

Reviewed by Anne van Kesteren.

Fix the Safer C++ warnings in Source/WebCore/accessibility, 
Source/WebCore/workers
and Source/WebGPU/WebGPU, plus two soft-link false positives in PAL, and update
the expectations accordingly.

Also teach CheckedPtr / RefPtr to be constructed from std::unique_ptr and
CheckedRef / Ref from UniqueRef, and make protect() on a std::unique_ptr or
UniqueRef return a RefPtr / Ref for ref-counted types and a CheckedPtr /
CheckedRef otherwise, like for WeakPtr / WeakRef.

* Source/WTF/wtf/CheckedPtr.h:
* Source/WTF/wtf/CheckedRef.h:
* Source/WTF/wtf/Ref.h:
* Source/WTF/wtf/RefPtr.h:
Add constructors and deduction guides from std::unique_ptr / UniqueRef.
* Source/WTF/wtf/UniqueRef.h:
(WTF::protect): Moved here from CheckedPtr.h / CheckedRef.h and add the
Ref / RefPtr overloads for ref-counted types.
* Source/WebCore/PAL/pal/spi/cocoa/WritingToolsUISPI.h:
* Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h:
* 
Source/WebKit/Platform/spi/Cocoa/Modules/WritingToolsUI_Private_SPI/WritingToolsUISPI.h:
Declare NSObject as the superclass of WTWritingToolsViewController and
DDContextMenuAction to address RetainPtrCtorAdopt false positives.
* Source/WebCore/SaferCPPExpectations/ForwardDeclCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UncheckedCallArgsCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UncheckedLocalVarsCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UnretainedCallArgsCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UnretainedLocalVarsCheckerExpectations:
* Source/WebCore/accessibility/AXObjectCache.cpp:
* Source/WebCore/accessibility/AXObjectCache.h:
Make m_formActivityMonitor const and initialize it with lazyInitialize().
* Source/WebCore/accessibility/AccessibilityObject.cpp:
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
Have makeFirstResponderForPlatformWidget() take a Widget&.
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/accessibility/cocoa/AXCoreObjectCocoa.mm:
* Source/WebCore/accessibility/cocoa/AXTextMarkerCocoa.mm:
* Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm:
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
* Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:
* Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm:
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* Source/WebCore/workers/WorkerGlobalScope.cpp:
* Source/WebCore/workers/WorkerMessagingProxy.cpp:
* Source/WebCore/workers/WorkerNotificationClient.cpp:
* Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp:
* Source/WebCore/workers/WorkerOrWorkletThread.cpp:
* Source/WebCore/workers/WorkerRunLoop.cpp:
* Source/WebCore/workers/WorkerThread.cpp:
* Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:
Use protect() and smart pointer locals at call sites.
* Source/WebGPU/SaferCPPExpectations/ForwardDeclCheckerExpectations:
* Source/WebGPU/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations:
* Source/WebGPU/SaferCPPExpectations/NoDeleteCheckerExpectations:
* Source/WebGPU/SaferCPPExpectations/NoUnretainedMemberCheckerExpectations:
* Source/WebGPU/SaferCPPExpectations/UncountedLambdaCapturesCheckerExpectations:
* Source/WebGPU/SaferCPPExpectations/UnretainedCallArgsCheckerExpectations:
* 
Source/WebGPU/SaferCPPExpectations/UnretainedLambdaCapturesCheckerExpectations:
* Source/WebGPU/SaferCPPExpectations/UnretainedLocalVarsCheckerExpectations:
* Source/WebGPU/WebGPU/APIConversions.h:
Add type traits for the WGPU*Impl / implementation class pairs and use 
downcast<>.
* Source/WebGPU/WebGPU/BindGroup.mm:
Use protect() and have the work-done callback own the plane textures.
* Source/WebGPU/WebGPU/Buffer.mm:
(wgpuBufferCopy): Drop incorrect NODELETE.
* Source/WebGPU/WebGPU/ComputePipeline.mm:
Include ASTExpression.h.
* Source/WebGPU/WebGPU/Device.mm:
Capture m_device by reference instead of this.
* Source/WebGPU/WebGPU/ExternalTexture.h:
Add a CF type trait for CVPixelBufferRef.
* Source/WebGPU/WebGPU/HardwareCapabilities.h:
(WebGPU::isWebGPUSwiftEnabled): Drop incorrect NODELETE.
* Source/WebGPU/WebGPU/WebGPUExt.h:
Suppress NoUnretainedMember warnings on C API struct members.

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



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

Reply via email to