Remove includes of callback_forward.h from .cc files

Commit: 16723c11 | 2025-11-26 01:32:26+00:00

← Back to List

Remove includes of callback_forward.h from .cc files

Minor
Commit Hash: 16723c112a9691d3819d7117e2faf2aeecf1891a
Commit Time: 2025-11-26 01:32:26+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This commit is a large-scale code cleanup that removes the inclusion of base/functional/callback_forward.h from 264 files. Most of these files are .cc and .mm implementation files. According to the commit message, .cc files should not forward declare base::OnceCallback and related classes. If they need to use Callbacks, they should include callback.h directly. Therefore, these callback_forward.h includes are treated as superfluous. Among remote_cocoa related files, only one file is affected: components/remote_cocoa/app_shim/immersive_mode_tabbed_controller_cocoa.mm, which has one line removed: #include "base/functional/callback_forward.h".

🎯 Impact Analysis

The impact of this change on WebView2Mac is minimal. This is a pure header file cleanup that does not involve any functional code modifications. The affected remote_cocoa file, immersive_mode_tabbed_controller_cocoa.mm, only removes an unused forward declaration header. From the complete file content, it's clear that the file doesn't actually use the types declared in callback_forward.h directly (there are no uses of base::OnceCallback or base::RepeatingCallback in the file), so removing this include will not cause compilation errors or runtime issues.

For WebView2Mac, this file is primarily used to handle tab bar management in the browser's immersive fullscreen mode, which is browser-specific functionality. WebView2Mac, as an embedded web control, does not depend on this specific immersive fullscreen implementation. Even in extreme cases, this change will not affect the core remote_cocoa interfaces that WebView2Mac depends on (such as NativeWidgetNSWindowBridge, WebContentsNSViewBridge, etc.), as this is just a header cleanup in an implementation file.

Impacted Classes:

remote_cocoa::ImmersiveModeTabbedControllerCocoa