Remove superfluous Mojo bindings includes in //content headers

Commit: bd9ba8bf | 2025-11-17 23:56:34+00:00

← Back to List

Remove superfluous Mojo bindings includes in //content headers

Minor
Commit Hash: bd9ba8bf2cca67c926ff56ce7c716a2563cf7ffe
Commit Time: 2025-11-17 23:56:34+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This commit primarily performs code cleanup by removing unused Mojo binding-related include statements from header files in the //content directory. Specifically removed includes are:
- mojo/public/cpp/bindings/receiver.h (in files not referencing mojo::Receiver)
- mojo/public/cpp/bindings/remote.h (in files not referencing mojo::Remote)
- mojo/public/cpp/bindings/pending_remote.h (in files not referencing mojo::PendingRemote)
- mojo/public/cpp/bindings/pending_receiver.h (in files not referencing mojo::PendingReceiver)
- mojo/public/cpp/bindings/pending_associated_receiver.h and other associated types

This cleanup affects 88 files. The only file directly related to Remote Cocoa is content/app_shim_remote_cocoa/render_widget_host_view_cocoa.h, which had the "mojo/public/cpp/bindings/remote.h" include removed (though file inspection shows this include still exists, suggesting it was re-added or the diff information is incomplete). Some .cc implementation files had necessary includes added to fix IWYU (Include What You Use) issues.

🎯 Impact Analysis

This change has minimal impact on WebView2Mac, being purely a code cleanup refactoring:

1. **Compilation Impact**: The change only removes superfluous include statements from headers without affecting actually used types and interfaces. Since the removed includes were for unused declarations, no compilation errors will occur.

2. **Remote Cocoa Related Impact**: The only affected Remote Cocoa file is render_widget_host_view_cocoa.h. Inspection of the complete file content shows it still contains "mojo/public/cpp/bindings/remote.h", indicating this include is actually needed (possibly used in implementation files, or the diff is incomplete).

3. **Interface Stability**: No Mojo interface definitions (.mojom files) or implementation logic were modified. All core Remote Cocoa classes and interfaces remain unchanged, including:
- remote_cocoa::mojom::RenderWidgetHostNSViewHost
- All public methods and properties of RenderWidgetHostViewCocoa
- NSView bridging mechanisms

4. **Downstream Dependency Impact**: WebView2Mac's classes like HostingNSWindowBridge and HostingApplicationBridge that inherit and use upstream interfaces are completely unaffected.

5. **Future Maintenance**: This cleanup helps reduce unnecessary dependencies and speeds up compilation, which is beneficial for project health in the long term.

Impacted Classes:

RenderWidgetHostViewCocoa