Remove deprecated [Native] types from network_param.mojom and split into dedicated Mojo definition files
Minor
提交哈希:
d8255385dd669a6580e605b8d9b04a86ed91b5c9
提交时间: 2026-04-15 02:18:52
影响等级: Minor
生成工具: chromium-watcher
上游审核链接:
查看上游审核 🔗
📋 摘要
This is a large-scale Mojo interface refactoring commit (80 files changed) that converts deprecated [Native] types in network_param.mojom (X509Certificate, SSLInfo, HttpResponseHeaders, AuthChallengeInfo, etc.) into explicit Mojo struct definitions in dedicated .mojom files (x509_certificate.mojom, ssl_info.mojom, http_response_headers.mojom, auth.mojom, etc.). Typemap definitions are reorganized and trait source locations are normalized. Many typemaps become shared typemaps due to URLLoaderCompletionStatus's transitive dependency on SSLInfo, causing an unavoidable compile size increase. The commit also fixes nullability bugs exposed by Mojo deserialization now that HttpResponseHeaders and X509Certificate are no longer opaque types.
🎯 影响分析
The impact on WebView2Mac is minor but noteworthy. The core change touching the remote_cocoa layer is in components/remote_cocoa/common/native_widget_ns_window.mojom, where the import changes from "services/network/public/mojom/network_param.mojom" to "services/network/public/mojom/x509_certificate.mojom". This is because native_widget_ns_window.mojom uses the X509Certificate type (for certificate-related drag-drop or security info display), which has been moved out of network_param.mojom into its own file.
For WebView2Mac downstream code:
1. If downstream has custom GN build rules directly depending on X509Certificate, SSLInfo, AuthChallengeInfo, or other types previously in network_param.mojom, dependency paths need to be updated to the new dedicated .mojom files.
2. If downstream HostingNSWindowBridge or related code directly includes network_param_mojom_traits.h, check whether it needs to be updated to include the new x509_certificate_mojom_traits.h or ssl_info_mojom_traits.h instead.
3. The HttpResponseHeaders field in URLResponseHead is now marked as nullable. If downstream code assumes this field is always non-null, null checks may need to be added.
4. The import change in native_widget_ns_window.mojom is a pure path adjustment. The Mojo interface semantics of X509Certificate are unchanged (converted from an opaque [Native] type to an explicit struct), with no runtime behavior impact.
For WebView2Mac downstream code:
1. If downstream has custom GN build rules directly depending on X509Certificate, SSLInfo, AuthChallengeInfo, or other types previously in network_param.mojom, dependency paths need to be updated to the new dedicated .mojom files.
2. If downstream HostingNSWindowBridge or related code directly includes network_param_mojom_traits.h, check whether it needs to be updated to include the new x509_certificate_mojom_traits.h or ssl_info_mojom_traits.h instead.
3. The HttpResponseHeaders field in URLResponseHead is now marked as nullable. If downstream code assumes this field is always non-null, null checks may need to be added.
4. The import change in native_widget_ns_window.mojom is a pure path adjustment. The Mojo interface semantics of X509Certificate are unchanged (converted from an opaque [Native] type to an explicit struct), with no runtime behavior impact.
受影响的类:
remote_cocoa::mojom::NativeWidgetNSWindow
network::mojom::X509Certificate
network::mojom::SSLInfo
network::mojom::HttpResponseHeaders
network::mojom::URLResponseHead