Remove kTextInputClientUseNestedLoop feature from TextInputClientMac

提交: babe9336 | 2026-04-29 22:44:31

← 返回列表

Remove kTextInputClientUseNestedLoop feature from TextInputClientMac

Minor
提交哈希: babe933658602752104b6580174f1ece78059913
提交时间: 2026-04-29 22:44:31
影响等级: Minor
生成工具: chromium-watcher
上游审核链接: 查看上游审核 🔗

📋 摘要

This commit removes the kTextInputClientUseNestedLoop feature flag and all associated code paths from TextInputClientMac. The feature used a nested RunLoop for synchronous text input operations (GetCharacterIndexAtPoint and GetFirstRectForRange) but was always disabled by default. Only the ConditionVariable-based waiting implementation is retained. Also removes NS_VALID_UNTIL_END_OF_SCOPE strong self references in RenderWidgetHostViewCocoa that were added to keep objects alive during nested RunLoops, and simplifies the unit test by removing TextInputClientMacTestBase and the NestedLoopFeatureState test parameter.

🎯 影响分析

The impact on WebView2Mac is minor. The change touches content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm (part of the Remote Cocoa layer), removing keepSelfAlive strong references in characterIndexForPoint: and firstRectForCharacterRange:actualRange: methods. Since kTextInputClientUseNestedLoop was never enabled in production (disabled by default), there is no runtime behavior change. The Edge downstream repo still references this feature flag (5 occurrences in content/browser/renderer_host/text_input_client_mac.mm), so merge conflicts will arise, but this is purely a code cleanup with no functional impact. No Mojo interface changes or Bridge/Host communication protocol modifications are involved.

受影响的类:

content::TextInputClientMac RenderWidgetHostViewCocoa