Annotate unsafe buffer operations in tool_tip_base_view.mm with UNSAFE_BUFFERS macro

Commit: 17948cb9 | 2026-01-23 17:36:19

← Back to List

Annotate unsafe buffer operations in tool_tip_base_view.mm with UNSAFE_BUFFERS macro

Minor
Commit Hash: 17948cb976e4556802612d93f3f144ea3e50426f
Commit Time: 2026-01-23 17:36:19
Impact Level: Minor
Generated By: webview2-upstream-sentry

📋 Summary

This commit replaces the file-level #pragma allow_unsafe_buffers in ui/base/cocoa/tool_tip_base_view.mm with a more precise UNSAFE_BUFFERS() macro annotation. The change only affects array access to the tags parameter in the _removeTrackingRects:count: method, moving from a blanket file-wide unsafe buffer exemption to a single-point annotation with a SAFETY comment noting that count is provided by the caller. This is part of the Chromium security hardening effort (crbug.com/40285824) to incrementally migrate code to safer buffer access patterns.

🎯 Impact Analysis

This change has virtually no impact on WebView2Mac. The modification is limited to a safety annotation refactoring in ui/base/cocoa/tool_tip_base_view.mm with no changes to functional logic, interfaces, or runtime behavior. ToolTipBaseView is a base tooltip implementation in the Cocoa view layer that may be indirectly used by WebView2Mac's view hierarchy, but this change does not alter any behavior. No downstream patch is needed.

Impacted Classes:

ToolTipBaseView