Remove unused include in associated_receiver.h

Commit: 1f256b3e | 2025-12-01 22:58:12+00:00

← Back to List

Remove unused include in associated_receiver.h

Minor
Commit Hash: 1f256b3eeb1f92a69a09d1c86f6fd59161c0cdeb
Commit Time: 2025-12-01 22:58:12+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This commit removes the unused #include of receiver.h from mojo/public/cpp/bindings/associated_receiver.h. To compensate, explicit #include "mojo/public/cpp/bindings/receiver.h" declarations were added to other source files that depend on it. Additionally, three new header includes were added to associated_receiver.h to replace type definitions previously obtained indirectly through receiver.h:
- mojo/public/cpp/bindings/connection_error_callback.h
- mojo/public/cpp/bindings/interface_endpoint_client.h
- mojo/public/cpp/bindings/message_metadata_helpers.h

Affected files include:
- content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm (added receiver.h include)
- Multiple test files and other component files

🎯 Impact Analysis

This change has a **Minor** impact on WebView2Mac.

**Direct Impact:**
This commit modifies content/app_shim_remote_cocoa/render_widget_host_ns_view_bridge.mm, which is one of the core Remote Cocoa components for WebView2Mac. However, the change only adds a missing header include without altering any functional logic or interface definitions. This is purely a header dependency cleanup to make dependencies more explicit and avoid implicit dependencies.

**Technical Details:**
- The RenderWidgetHostNSViewBridge class uses mojo::Receiver to manage Mojo interface bindings
- Previously, this class indirectly obtained the receiver.h definition through associated_receiver.h
- Now it needs to explicitly include receiver.h to ensure successful compilation
- This type of change is a header hygiene improvement that does not affect runtime behavior

**Actual Impact on WebView2Mac:**
1. **No Functional Impact**: No code logic changes, WebView2Mac functionality remains unaffected
2. **Clearer Compilation Dependencies**: Explicit header dependencies make the code more maintainable
3. **No Downstream Code Changes Required**: WebView2Mac classes that inherit from Remote Cocoa components (such as HostingNSWindowBridge, HostingWebContentsNSViewBridge) require no modifications
4. **Good Compatibility**: This change is backward compatible and will not break existing APIs or ABIs

**Risk Assessment:**
- Risk Level: Very Low
- Required Response: Simply include this change naturally during the next upstream code sync
- No special handling or code adjustments needed

Impacted Classes:

remote_cocoa::RenderWidgetHostNSViewBridge mojo::AssociatedReceiver mojo::Receiver