Remove redundant mojom includes from content/public header files

Commit: d3d81eae | 2025-10-06 18:51:43+00:00

← Back to List

Remove redundant mojom includes from content/public header files

Minor
Commit Hash: d3d81eaebdc3521a3275ef34fea1fcbea46498ed
Commit Time: 2025-10-06 18:51:43+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission primarily removes redundant mojom include files from the //content/public header files. Since mojom code contains the "mojom::" string in its namespace, files in those headers that do not have this string do not need to include mojom header files. This change removes these unnecessary includes and performs IWYU (Include What You Use) to fix build issues. It mainly affects 38 files, involving multiple modules including browser, renderer, and public API. The only change directly related to remote_cocoa is the removal of the inclusion of "content/common/web_contents_ns_view_bridge.mojom.h" in the content/app_shim_remote_cocoa/web_contents_occlusion_checker_mac.h file.

🎯 Impact Analysis

This change has minimal impact on WebView2Mac. Although the modification involves a remote_cocoa-related header file (web_contents_occlusion_checker_mac.h), it only removes an unnecessary mojom header inclusion and does not alter any actual interface definitions, API behavior, or functional implementation. content/common/web_contents_ns_view_bridge.mojom defines the WebContentsNSView and WebContentsNSViewHost interfaces, which are used for inter-process communication in WebView2Mac. However, since the web_contents_occlusion_checker_mac.h file does not directly use these mojom interfaces (there is no usage of the mojom:: namespace), removing this inclusion will not affect compilation or runtime behavior. The other modified files mainly involve content/public API, and these changes are also limited to header file cleanup, without affecting the core remote_cocoa functionalities of WebView2Mac, such as window management, NSView bridging, and application bridging.

Impacted Classes:

WebContentsOcclusionCheckerMac