chromium/services/network/public/mojom/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//build/config/dcheck_always_on.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//net/features.gni")
import("//services/network/public/cpp/features.gni")

# These interfaces are put in their own target to avoid a circular dependency,
# which comes from the fact that proxy_resolver service uses these interfaces,
# and the network service uses the proxy_resolver service.
mojom("mojom_ip_address") {
  generate_java = true
  sources = [
    "address_family.mojom",
    "address_list.mojom",
    "alternate_protocol_usage.mojom",
    "connection_endpoint_metadata.mojom",
    "host_resolver_endpoint_result.mojom",
    "ip_address.mojom",
    "ip_endpoint.mojom",
  ]

  # WebUI bindings are only needed on ChromeOS Ash.
  if (is_chromeos_ash) {
    webui_module_path = "chrome://resources/mojo/services/network/public/mojom"

    # Used by ash/webui/resources/common/network_health, which is still using
    # Closure Compiler, so generate WebUI bindings in JavaScript.
    generate_webui_js_bindings = true
  }

  public_deps = [ "//url/mojom:url_mojom_gurl" ]

  shared_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.IPEndPoint"
          cpp = "::net::IPEndPoint"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/ip_endpoint_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:ip_address_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.ConnectionInfo"
          cpp = "::net::HttpConnectionInfo"
        },
      ]
      traits_headers = [
        "//net/http/http_response_info.h",
        "//services/network/public/cpp/network_ipc_param_traits.h",
      ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:ip_address_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.AlternateProtocolUsage"
          cpp = "::net::AlternateProtocolUsage"
        },
      ]
      traits_headers = [
        "//net/http/alternate_protocol_usage.h",
        "//services/network/public/cpp/alternate_protocol_usage_mojom_traits.h",
      ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:ip_address_mojom_support",
      ]
    },
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.IPAddress"
          cpp = "::net::IPAddress"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/ip_address_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:ip_address_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.AddressFamily"
          cpp = "::net::AddressFamily"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/address_family_mojom_traits.h" ]
      traits_sources =
          [ "//services/network/public/cpp/address_family_mojom_traits.cc" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.AddressList"
          cpp = "::net::AddressList"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/address_list_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.WebTransportError"
          cpp = "::net::WebTransportError"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/web_transport_error_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:ip_address_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.ConnectionEndpointMetadata"
          cpp = "::net::ConnectionEndpointMetadata"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/connection_endpoint_metadata_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.HostResolverEndpointResult"
          cpp = "::net::HostResolverEndpointResult"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/host_resolver_endpoint_result_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
  ]
  cpp_typemaps += shared_cpp_typemaps

  blink_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.IPAddress"
          cpp = "::net::IPAddress"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/ip_address_mojom_traits.h",

        # The blink variants need HashTraits for net::IPAddress.
        "//third_party/blink/renderer/platform/network/ip_address.h",
      ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:ip_address_mojom_support",

        # Depending on //url is a hack to depend on blink/platform.
        "//url",
      ]
    },
  ]
  blink_cpp_typemaps += shared_cpp_typemaps
}

# As with mojom_ip_address, this is a separate target to avoid a circular
# dependency, which comes from the fact that proxy_resolver service uses
# this interfaces, and the network service uses the proxy_resolver service.
# Separate from |mojom_ip_address| because a bunch of other consumers are
# depending on that and don't need this.
mojom("mojom_network_isolation_key") {
  generate_java = true
  sources = [ "network_isolation_key.mojom" ]

  public_deps = [
    ":mojom_schemeful_site",
    "//mojo/public/mojom/base",
    "//url/mojom:url_mojom_origin",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.NetworkIsolationKey"
          cpp = "::net::NetworkIsolationKey"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/network_isolation_key_mojom_traits.h",
      ]
      traits_public_deps = [ "//net" ]
    },
  ]
}

mojom("mojom_shared_dictionary") {
  generate_java = true
  sources = [
    "shared_dictionary_error.mojom",
    "shared_dictionary_isolation_key.mojom",
    "shared_dictionary_usage_info.mojom",
  ]

  public_deps = [
    ":mojom_schemeful_site",
    "//mojo/public/mojom/base",
    "//url/mojom:url_mojom_origin",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.SharedDictionaryIsolationKey"
          cpp = "::net::SharedDictionaryIsolationKey"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/shared_dictionary_isolation_key_mojom_traits.h" ]
      traits_sources = [ "//services/network/public/cpp/shared_dictionary_isolation_key_mojom_traits.cc" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:schemeful_site_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.SharedDictionaryUsageInfo"
          cpp = "::net::SharedDictionaryUsageInfo"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/shared_dictionary_usage_info_mojom_traits.h" ]
      traits_sources = [ "//services/network/public/cpp/shared_dictionary_usage_info_mojom_traits.cc" ]
      traits_public_deps = [ "//net:shared_dictionary_info" ]
    },
  ]
}

# As with mojom_ip_address, this is a separate target to avoid a circular
# dependency, which comes from the fact that proxy_resolver service will use
# this interface, and the network service uses the proxy_resolver service.
# Separate from |mojom_ip_address| because a bunch of other consumers are
# depending on that and don't need this.
# This is not yet used by the proxy_resolver, but will be as a part of
# crbug/1343856.
mojom("mojom_network_anonymization_key") {
  generate_java = true
  sources = [ "network_anonymization_key.mojom" ]

  public_deps = [
    ":mojom_schemeful_site",
    "//mojo/public/mojom/base",
    "//url/mojom:url_mojom_origin",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.NetworkAnonymizationKey"
          cpp = "::net::NetworkAnonymizationKey"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/network_anonymization_key_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
  ]
}

# As with |mojom_ip_address|, this is a separate target to avoid a circular
# dependency, which comes from the fact that proxy_resolver_win uses this
# interface, and the network service uses the proxy_resolver_win service. This
# is separate from other targets because only this needs to be included in
# proxy_resolver_win builds.
mojom("mojom_proxy_config") {
  generate_java = true
  sources = [
    "mutable_network_traffic_annotation_tag.mojom",
    "mutable_partial_network_traffic_annotation_tag.mojom",
    "proxy_config.mojom",
    "proxy_config_with_annotation.mojom",
  ]

  public_deps = [
    ":mojom_network_param",
    "//mojo/public/mojom/base",
  ]

  shared_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.MutableNetworkTrafficAnnotationTag"
          cpp = "::net::MutableNetworkTrafficAnnotationTag"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/mutable_network_traffic_annotation_tag_mojom_traits.h" ]
      traits_public_deps = [
        "//net/traffic_annotation",
        "//services/network/public/cpp:proxy_config_mojom_support",
      ]
    },
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.MutablePartialNetworkTrafficAnnotationTag"
          cpp = "::net::MutablePartialNetworkTrafficAnnotationTag"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/mutable_partial_network_traffic_annotation_tag_mojom_traits.h" ]
      traits_public_deps = [
        "//net/traffic_annotation",
        "//services/network/public/cpp:proxy_config_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.ProxyBypassRules"
          cpp = "::net::ProxyBypassRules"
        },
        {
          mojom = "network.mojom.ProxyList"
          cpp = "::net::ProxyList"
        },
        {
          mojom = "network.mojom.ProxyRulesType"
          cpp = "::net::ProxyConfig::ProxyRules::Type"
        },
        {
          mojom = "network.mojom.ProxyRules"
          cpp = "::net::ProxyConfig::ProxyRules"
        },
        {
          mojom = "network.mojom.ProxyConfig"
          cpp = "::net::ProxyConfig"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/proxy_config_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:proxy_config_mojom_support",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.ProxyConfigWithAnnotation"
          cpp = "::net::ProxyConfigWithAnnotation"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/proxy_config_with_annotation_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:proxy_config_mojom_support",
      ]
    },
  ]

  cpp_typemaps += shared_cpp_typemaps

  blink_cpp_typemaps = shared_cpp_typemaps
}

mojom("mojom_attribution") {
  generate_java = true

  webui_module_path = "/"

  # This is a dependency of url_loader_base below, which is used from Blink.
  # Blink requires legacy JS bindings.
  generate_legacy_js_bindings = true

  sources = [ "attribution.mojom" ]
}

# These .mojom files are put in their own target to avoid a circular dependency,
# which comes from the fact that the typemap for url_loader.mojom
# (ResourceRequest) depends on them.
mojom("url_loader_base") {
  generate_java = true
  sources = [
    "accept_ch_frame_observer.mojom",
    "blocked_by_response_reason.mojom",
    "chunked_data_pipe_getter.mojom",
    "client_security_state.mojom",
    "content_security_policy.mojom",
    "cors.mojom",
    "cross_origin_embedder_policy.mojom",
    "cross_origin_opener_policy.mojom",
    "data_pipe_getter.mojom",
    "devtools_observer.mojom",
    "document_isolation_policy.mojom",
    "early_hints.mojom",
    "encoded_body_length.mojom",
    "fetch_api.mojom",
    "http_raw_headers.mojom",
    "http_request_headers.mojom",
    "ip_address_space.mojom",
    "isolation_info.mojom",
    "link_header.mojom",
    "load_timing_info.mojom",
    "network_change_manager.mojom",
    "network_interface.mojom",
    "network_interface_change_listener.mojom",
    "network_types.mojom",
    "no_vary_search.mojom",
    "optional_bool.mojom",
    "parsed_headers.mojom",
    "parsed_request_cookie.mojom",
    "referrer_policy.mojom",
    "request_priority.mojom",
    "service_worker_router_info.mojom",
    "shared_dictionary_access_observer.mojom",
    "source_location.mojom",
    "supports_loading_mode.mojom",
    "timing_allow_origin.mojom",
    "trust_token_access_observer.mojom",
    "trust_tokens.mojom",
    "url_loader.mojom",
    "url_loader_completion_status.mojom",
    "url_loader_network_service_observer.mojom",
    "url_request.mojom",
    "url_response_head.mojom",
    "web_bundle_handle.mojom",
    "web_client_hints_types.mojom",
    "web_sandbox_flags.mojom",
    "web_transport.mojom",
    "x_frame_options.mojom",
  ]

  public_deps = [
    ":cookies_mojom",
    ":mojom_attribution",
    ":mojom_ip_address",
    ":mojom_network_param",
    ":mojom_proxy_config",
    ":mojom_schemeful_site",
    ":mojom_shared_dictionary",
    "//mojo/public/mojom/base",
    "//services/proxy_resolver/public/mojom",
    "//url/mojom:url_mojom_gurl",
    "//url/mojom:url_mojom_origin",
  ]

  if (is_win) {
    public_deps += [ "//services/proxy_resolver_win/public/mojom" ]
  }

  enabled_features = []
  if (is_android || is_chromeos || is_linux) {
    enabled_features += [ "network_change_notifier_in_browser" ]
  }

  if (is_linux) {
    # TODO(crbug.com/40263697): Remove this once is_linux in the mojom IDL does
    # not include lacros.
    enabled_features += [ "use_network_interface_change_listener" ]
  }

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  # Shared by cpp_typemaps and blink_cpp_typemaps.
  shared_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.RequestPriority"
          cpp = "::net::RequestPriority"
        },
        {
          mojom = "network.mojom.URLRequestReferrerPolicy"
          cpp = "::net::ReferrerPolicy"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/url_request_param_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.CrossOriginEmbedderPolicy"
          cpp = "::network::CrossOriginEmbedderPolicy"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/cross_origin_embedder_policy_mojom_traits.h" ]
      traits_deps =
          [ "//services/network/public/cpp:cross_origin_embedder_policy" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.URLLoaderCompletionStatus"
          cpp = "::network::URLLoaderCompletionStatus"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/url_loader_completion_status_mojom_traits.h" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.CrossOriginOpenerPolicy"
          cpp = "::network::CrossOriginOpenerPolicy"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/cross_origin_opener_policy_mojom_traits.h" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.DocumentIsolationPolicy"
          cpp = "::network::DocumentIsolationPolicy"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/document_isolation_policy_mojom_traits.h" ]
      traits_deps =
          [ "//services/network/public/cpp:document_isolation_policy" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.TrustedUrlRequestParams"
          cpp = "::network::ResourceRequest::TrustedParams"
        },
        {
          mojom = "network.mojom.WebBundleTokenParams"
          cpp = "::network::ResourceRequest::WebBundleTokenParams"
        },
        {
          mojom = "network.mojom.URLRequest"
          cpp = "::network::ResourceRequest"
          forward_declaration = "namespace network { struct ResourceRequest; }"
        },
        {
          mojom = "network.mojom.URLRequestBody"
          cpp = "::scoped_refptr<::network::ResourceRequestBody>"
          nullable_is_same_type = true
          copyable_pass_by_value = true
        },
        {
          mojom = "network.mojom.SourceType"
          cpp = "::net::SourceStream::SourceType"
        },
        {
          mojom = "network.mojom.DataElementBytes"
          cpp = "::network::DataElementBytes"
          move_only = true
        },
        {
          mojom = "network.mojom.DataElementDataPipe"
          cpp = "::network::DataElementDataPipe"
          move_only = true
        },
        {
          mojom = "network.mojom.DataElementChunkedDataPipe"
          cpp = "::network::DataElementChunkedDataPipe"
          move_only = true
        },
        {
          mojom = "network.mojom.DataElementFile"
          cpp = "::network::DataElementFile"
          move_only = true
        },
        {
          mojom = "network.mojom.DataElement"
          cpp = "::network::DataElement"
          move_only = true
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/network_ipc_param_traits.h",
        "//services/network/public/cpp/url_request_mojom_traits.h",
        "//services/network/public/cpp/network_isolation_key_mojom_traits.h",
        "//services/network/public/cpp/network_anonymization_key_mojom_traits.h",
      ]
      traits_private_headers = [
        "//services/network/public/mojom/devtools_observer.mojom.h",
        "//services/network/public/mojom/cookie_access_observer.mojom.h",
        "//services/network/public/mojom/trust_token_access_observer.mojom.h",
      ]
      traits_public_deps = [
        ":mojom_network_isolation_key",
        "//base",
        "//url/mojom:url_mojom_gurl",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.HttpRequestHeaders"
          cpp = "::net::HttpRequestHeaders"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/http_request_headers_mojom_traits.h",
      ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.IsolationInfo"
          cpp = "::net::IsolationInfo"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/isolation_info_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.NetworkInterface"
          cpp = "::net::NetworkInterface"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/network_interface_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.ParsedRequestCookie"
          cpp = "::net::cookie_util::ParsedRequestCookie"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/parsed_request_cookie_mojom_traits.h",
      ]
      traits_public_deps = [ "//net" ]
    },
  ]

  if (is_p2p_enabled) {
    shared_typemaps += [
      {
        types = [
          {
            mojom = "network.mojom.P2PPacketInfo"
            cpp = "::network::P2PPacketInfo"
          },
          {
            mojom = "network.mojom.P2PSendPacketMetrics"
            cpp = "::network::P2PSendPacketMetrics"
          },
          {
            mojom = "network.mojom.P2PPortRange"
            cpp = "::network::P2PPortRange"
          },
          {
            mojom = "network.mojom.P2PHostAndIPEndPoint"
            cpp = "::network::P2PHostAndIPEndPoint"
          },
          {
            mojom = "network.mojom.P2PSocketOption"
            cpp = "::network::P2PSocketOption"
          },
          {
            mojom = "network.mojom.P2PSocketType"
            cpp = "::network::P2PSocketType"
          },
          {
            mojom = "network.mojom.EcnMarking"
            cpp = "::rtc::EcnMarking"
          },
        ]
        traits_headers = [ "//services/network/public/cpp/p2p_param_traits.h" ]
        traits_public_deps =
            [ "//third_party/webrtc_overrides:webrtc_component" ]
      },
    ]
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.CorsErrorStatus"
          cpp = "::network::CorsErrorStatus"
          default_constructible = false
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/cors/cors_mojom_traits.h" ]
      traits_public_deps = [ "//base" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.CTPolicyCompliance"
          cpp = "::net::ct::CTPolicyCompliance"
        },
        {
          mojom = "network.mojom.EffectiveConnectionType"
          cpp = "::net::EffectiveConnectionType"
        },
        {
          mojom = "network.mojom.OriginPolicy"
          cpp = "::network::OriginPolicy"
        },
        {
          mojom = "network.mojom.URLRequestRedirectInfo"
          cpp = "::net::RedirectInfo"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/network_ipc_param_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.LoadTimingInfo"
          cpp = "::net::LoadTimingInfo"
        },
        {
          mojom = "network.mojom.LoadTimingInfoConnectTiming"
          cpp = "::net::LoadTimingInfo::ConnectTiming"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/load_timing_info_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
  ]

  if (is_linux) {
    cpp_typemaps += [
      {
        types = [
          {
            mojom = "network.mojom.IfAddrMsg"
            cpp = "struct ifaddrmsg"
          },
          {
            mojom = "network.mojom.AddressMap"
            cpp = "::net::AddressMapOwnerLinux::AddressMap"
          },
          {
            mojom = "network.mojom.OnlineLinks"
            cpp = "::std::unordered_set<int>"
          },
        ]
        traits_headers = [ "//services/network/public/cpp/network_interface_change_listener_mojom_traits.h" ]
      },
    ]
  }

  cpp_typemaps += shared_typemaps

  blink_cpp_typemaps = shared_typemaps
}

# Make this a separate target to avoid a circular dependency.
mojom("mojom_schemeful_site") {
  generate_java = true
  sources = [ "schemeful_site.mojom" ]

  public_deps = [ "//url/mojom:url_mojom_origin" ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.SchemefulSite"
          cpp = "::net::SchemefulSite"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/schemeful_site_mojom_traits.h" ]
      traits_public_deps = [ "//net" ]
    },
  ]
  blink_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.SchemefulSite"
          cpp = "::blink::BlinkSchemefulSite"
        },
      ]
      traits_headers = [ "//third_party/blink/renderer/platform/network/blink_schemeful_site_mojom_traits.h" ]
      traits_sources = [ "//third_party/blink/renderer/platform/network/blink_schemeful_site_mojom_traits.cc" ]

      # The dependency on //url is a bit of a hack to ultimately depend upon
      # blink/platform. We're doing this because directly depending on platform
      # results in a difficult to solve circular dependency. Also, we do
      # actually depend upon url so it's not that unreasonable.
      traits_public_deps = [
        "//net",
        "//url",
      ]
    },
  ]

  webui_module_path = "/"

  # Blink requires the 3 legacy JS bindings types.
  generate_legacy_js_bindings = true
}

mojom("mojom_network_param") {
  generate_java = true
  sources = [ "network_param.mojom" ]

  public_deps = [
    "//mojo/public/mojom/base",
    "//url/mojom:url_mojom_scheme_host_port",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  # Typemaps which apply to both Blink and non-Blink bindings.
  shared_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.AuthChallengeInfo"
          cpp = "::net::AuthChallengeInfo"
        },
        {
          mojom = "network.mojom.HostPortPair"
          cpp = "::net::HostPortPair"
        },
        {
          mojom = "network.mojom.NetLogSource"
          cpp = "::net::NetLogSource"
        },
        {
          mojom = "network.mojom.ProxyChain"
          cpp = "::net::ProxyChain"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/network_param_mojom_traits.h" ]
      traits_public_deps =
          [ "//services/network/public/cpp:network_param_mojom_support" ]
    },
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.AuthCredentials"
          cpp = "::net::AuthCredentials"
        },
        {
          mojom = "network.mojom.CertVerifyResult"
          cpp = "::net::CertVerifyResult"
        },
        {
          mojom = "network.mojom.HttpResponseHeaders"
          cpp = "::scoped_refptr<::net::HttpResponseHeaders>"
          nullable_is_same_type = true
        },
        {
          mojom = "network.mojom.HttpVersion"
          cpp = "::net::HttpVersion"
        },
        {
          mojom = "network.mojom.ProxyServer"
          cpp = "::net::ProxyServer"
        },
        {
          mojom = "network.mojom.ProxyScheme"
          cpp = "::net::ProxyServer::Scheme"
        },
        {
          mojom = "network.mojom.ResolveErrorInfo"
          cpp = "::net::ResolveErrorInfo"
        },
        {
          mojom = "network.mojom.SSLCertRequestInfo"
          cpp = "::scoped_refptr<::net::SSLCertRequestInfo>"
          nullable_is_same_type = true
        },
        {
          mojom = "network.mojom.SSLInfo"
          cpp = "::net::SSLInfo"
        },
        {
          mojom = "network.mojom.X509Certificate"
          cpp = "::scoped_refptr<::net::X509Certificate>"
          nullable_is_same_type = true
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/net_ipc_param_traits.h",
        "//services/network/public/cpp/network_param_mojom_traits.h",
      ]
      traits_private_headers = [ "//net/cert/cert_verify_result.h" ]
      traits_public_deps =
          [ "//services/network/public/cpp:network_param_mojom_support" ]
    },
  ]
  cpp_typemaps += shared_cpp_typemaps
  blink_cpp_typemaps = []
  blink_cpp_typemaps += shared_cpp_typemaps
}

# This target is split from "mojom" target as the lazy serialization may
# cause problems. See https://crbug.com/822732.
mojom("websocket_mojom") {
  generate_java = true
  sources = [ "websocket.mojom" ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  public_deps = [
    ":mojom_ip_address",
    ":mojom_network_param",
    "//mojo/public/mojom/base",
    "//url/mojom:url_mojom_gurl",
    "//url/mojom:url_mojom_origin",
  ]
}

mojom("mojom_first_party_sets") {
  generate_java = true
  sources = [ "first_party_sets.mojom" ]

  public_deps = [
    ":mojom_schemeful_site",
    "//mojo/public/mojom/base",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  shared_typemaps = []
  cpp_typemaps =
      shared_typemaps + [
        {
          types = [
            {
              mojom = "network.mojom.SiteIndex"
              cpp = "::net::FirstPartySetEntry::SiteIndex"
            },
            {
              mojom = "network.mojom.SiteType"
              cpp = "::net::SiteType"
            },
            {
              mojom = "network.mojom.FirstPartySetEntry"
              cpp = "::net::FirstPartySetEntry"
            },
            {
              mojom = "network.mojom.FirstPartySetMetadata"
              cpp = "::net::FirstPartySetMetadata"
              move_only = true
            },
            {
              mojom = "network.mojom.GlobalFirstPartySets"
              cpp = "::net::GlobalFirstPartySets"
              move_only = true
            },
            {
              mojom = "network.mojom.FirstPartySetsContextConfig"
              cpp = "::net::FirstPartySetsContextConfig"
              move_only = true
            },
            {
              mojom = "network.mojom.FirstPartySetsCacheFilter"
              cpp = "::net::FirstPartySetsCacheFilter"
              move_only = true
            },
            {
              mojom = "network.mojom.FirstPartySetEntryOverride"
              cpp = "::net::FirstPartySetEntryOverride"
            },
          ]
          traits_headers = [
            "//services/network/public/cpp/first_party_sets_mojom_traits.h",
          ]
          traits_public_deps =
              [ "//services/network/public/cpp:first_party_sets_mojom_support" ]
        },
      ]
  blink_cpp_typemaps = shared_typemaps
}

mojom("mojom_storage_access_api") {
  generate_java = true
  sources = [ "storage_access_api.mojom" ]

  public_deps = [ "//mojo/public/mojom/base" ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  shared_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.StorageAccessApiStatus"
          cpp = "::net::StorageAccessApiStatus"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/storage_access_api_mojom_traits.h" ]
      traits_public_deps =
          [ "//services/network/public/cpp:storage_access_api_mojom_support" ]
    },
  ]
  cpp_typemaps = shared_typemaps
  blink_cpp_typemaps = shared_typemaps
}

mojom("mojom_structured_headers") {
  generate_java = true
  sources = [ "structured_headers.mojom" ]

  public_deps = [ "//mojo/public/mojom/base" ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.StructuredHeadersItem"
          cpp = "::net::structured_headers::Item"
          move_only = true
        },
        {
          mojom = "network.mojom.StructuredHeadersParameter"
          cpp = "std::pair<std::string, ::net::structured_headers::Item>"
          move_only = true
        },
        {
          mojom = "network.mojom.StructuredHeadersParameterizedItem"
          cpp = "::net::structured_headers::ParameterizedItem"
          move_only = true
        },
        {
          mojom = "network.mojom.StructuredHeadersParameterizedMember"
          cpp = "::net::structured_headers::ParameterizedMember"
          move_only = true
        },
        {
          mojom = "network.mojom.StructuredHeadersDictionaryMember"
          cpp = "::net::structured_headers::DictionaryMember"
          move_only = true
        },
        {
          mojom = "network.mojom.StructuredHeadersDictionary"
          cpp = "::net::structured_headers::Dictionary"
          move_only = true
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/structured_headers_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:structured_headers_mojom_support",
      ]
    },
  ]
}

mojom("cookies_mojom") {
  generate_java = true
  sources = [
    "cookie_access_observer.mojom",
    "cookie_manager.mojom",
    "cookie_partition_key.mojom",
    "cookie_setting_overrides.mojom",
    "restricted_cookie_manager.mojom",
    "site_for_cookies.mojom",
  ]

  public_deps = [
    ":mojom_first_party_sets",
    ":mojom_schemeful_site",
    ":mojom_storage_access_api",
    "//components/content_settings/core/common:content_settings_enums",
    "//components/content_settings/core/common:content_settings_types",
    "//components/content_settings/core/common:mojo_bindings",
    "//mojo/public/mojom/base",
    "//sandbox/policy/mojom",
    "//url/mojom:url_mojom_gurl",
    "//url/mojom:url_mojom_origin",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  # Typemaps which apply to both Blink and non-Blink bindings.
  shared_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.SiteForCookies"
          cpp = "::net::SiteForCookies"
        },
        {
          mojom = "network.mojom.CookieInclusionStatus"
          cpp = "::net::CookieInclusionStatus"
          move_only = true
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/cookie_manager_shared_mojom_traits.h",
      ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:cookies_mojom_support",
      ]
    },
  ]

  # Typemaps applied only to non-Blink bindings
  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.CookiePriority"
          cpp = "::net::CookiePriority"
        },
        {
          mojom = "network.mojom.CookieSameSite"
          cpp = "::net::CookieSameSite"
        },
        {
          mojom = "network.mojom.CookieEffectiveSameSite"
          cpp = "::net::CookieEffectiveSameSite"
        },
        {
          mojom = "network.mojom.CookieSameSiteContextMetadataDowngradeType"
          cpp = "::net::CookieOptions::SameSiteCookieContext::ContextMetadata::ContextDowngradeType"
        },
        {
          mojom = "network.mojom.ContextRedirectTypeBug1221316"
          cpp = "::net::CookieOptions::SameSiteCookieContext::ContextMetadata::ContextRedirectTypeBug1221316"
        },
        {
          mojom = "network.mojom.CookieSameSiteContextMetadata"
          cpp = "::net::CookieOptions::SameSiteCookieContext::ContextMetadata"
        },
        {
          mojom = "network.mojom.CookieSameSiteContext"
          cpp = "::net::CookieOptions::SameSiteCookieContext"
        },
        {
          mojom = "network.mojom.CookieAccessSemantics"
          cpp = "::net::CookieAccessSemantics"
        },
        {
          mojom = "network.mojom.CookieOptions"
          cpp = "::net::CookieOptions"
        },
        {
          mojom = "network.mojom.CookiePartitionKey"
          cpp = "::net::CookiePartitionKey"
          default_constructible = false
        },
        {
          mojom = "network.mojom.CookiePartitionKeyCollection"
          cpp = "::net::CookiePartitionKeyCollection"
        },
        {
          mojom = "network.mojom.CookiePartitionKeyCollection"
          cpp = "::net::CookiePartitionKeyCollection"
        },
        {
          mojom = "network.mojom.CanonicalCookie"
          cpp = "::net::CanonicalCookie"
        },
        {
          mojom = "network.mojom.CookieAccessResult"
          cpp = "::net::CookieAccessResult"
          move_only = true
        },
        {
          mojom = "network.mojom.CookieWithAccessResult"
          cpp = "::net::CookieWithAccessResult"
        },
        {
          mojom = "network.mojom.CookieAndLineWithAccessResult"
          cpp = "::net::CookieAndLineWithAccessResult"
        },
        {
          mojom = "network.mojom.CookieChangeCause"
          cpp = "::net::CookieChangeCause"
        },
        {
          mojom = "network.mojom.CookieChangeInfo"
          cpp = "::net::CookieChangeInfo"
        },
        {
          mojom = "network.mojom.CookieSourceScheme"
          cpp = "::net::CookieSourceScheme"
        },
        {
          mojom = "network.mojom.HttpMethod"
          cpp = "::net::CookieOptions::SameSiteCookieContext::ContextMetadata::HttpMethod"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/cookie_manager_mojom_traits.h" ]
      traits_sources =
          [ "//services/network/public/cpp/cookie_manager_mojom_traits.cc" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.CookieSettingOverrides"
          cpp = "::net::CookieSettingOverrides"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/cookie_setting_overrides_mojom_traits.h",
      ]
      traits_public_deps = [ "//net" ]
    },
  ]
  cpp_typemaps += shared_cpp_typemaps

  blink_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.CanonicalCookie"
          cpp = "::net::CanonicalCookie"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/cookie_manager_mojom_traits.h" ]
    },
  ]
  blink_cpp_typemaps += shared_cpp_typemaps
}

mojom("mojom_host_resolver") {
  generate_java = true
  sources = [ "host_resolver.mojom" ]

  public_deps = [
    ":mojom_ip_address",
    ":mojom_network_anonymization_key",
    ":mojom_network_param",
    ":url_loader_base",
    "//mojo/public/mojom/base",
    "//url/mojom:url_mojom_scheme_host_port",
  ]

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
  }

  shared_cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.DnsQueryType"
          cpp = "::net::DnsQueryType"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/host_resolver_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:host_resolver_mojom_support",
      ]
    },
  ]
  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.DnsConfigOverrides"
          cpp = "::net::DnsConfigOverrides"
        },
        {
          mojom = "network.mojom.DnsOverHttpsServerConfig"
          cpp = "::net::DnsOverHttpsServerConfig"
        },
        {
          mojom = "network.mojom.DnsOverHttpsConfig"
          cpp = "::net::DnsOverHttpsConfig"
        },
        {
          mojom = "network.mojom.ResolveHostParameters.Source"
          cpp = "::net::HostResolverSource"
        },
        {
          mojom = "network.mojom.MdnsListenClient.UpdateType"
          cpp = "::net::MdnsListenerUpdateType"
        },
        {
          mojom = "network.mojom.SecureDnsMode"
          cpp = "::net::SecureDnsMode"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/host_resolver_mojom_traits.h" ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:host_resolver_mojom_support",
      ]
    },
  ]

  cpp_typemaps += shared_cpp_typemaps
  blink_cpp_typemaps = shared_cpp_typemaps
}

mojom("mojom") {
  generate_java = true
  sources = [
    "cert_verifier_service.mojom",
    "cert_verifier_service_updater.mojom",
    "clear_data_filter.mojom",
    "cookie_encryption_provider.mojom",
    "cors_origin_pattern.mojom",
    "default_credentials.mojom",
    "dhcp_wpad_url_client.mojom",
    "digitally_signed.mojom",
    "first_party_sets_access_delegate.mojom",
    "hash_value.mojom",
    "http_cache_backend_file_operations.mojom",
    "key_pinning.mojom",
    "mdns_responder.mojom",
    "net_log.mojom",
    "network_annotation_monitor.mojom",
    "network_context.mojom",
    "network_context_client.mojom",
    "network_quality_estimator_manager.mojom",
    "network_service.mojom",
    "network_service_test.mojom",
    "oblivious_http_request.mojom",
    "proxy_lookup_client.mojom",
    "proxy_resolving_socket.mojom",
    "reporting_service.mojom",
    "restricted_udp_socket.mojom",
    "socket_broker.mojom",
    "socket_connection_tracker.mojom",
    "ssl_config.mojom",
    "system_dns_resolution.mojom",
    "tcp_socket.mojom",
    "tls_socket.mojom",
    "transferable_directory.mojom",
    "transferable_socket.mojom",
    "udp_socket.mojom",
    "url_loader_factory.mojom",
  ]

  public_deps = [
    ":cookies_mojom",
    ":mojom_first_party_sets",
    ":mojom_host_resolver",
    ":mojom_ip_address",
    ":mojom_network_anonymization_key",
    ":mojom_network_isolation_key",
    ":mojom_network_param",
    ":mojom_proxy_config",
    ":mojom_schemeful_site",
    ":mojom_shared_dictionary",
    ":mojom_storage_access_api",
    ":mojom_structured_headers",
    ":url_loader_base",
    ":websocket_mojom",
    "//components/content_settings/core/common:mojo_bindings",
    "//components/os_crypt/async/common:common_mojom",
    "//mojo/public/mojom/base",
    "//mojo/public/mojom/base:protobuf_support",
    "//sandbox/policy/mojom",
    "//services/proxy_resolver/public/mojom",
    "//url/mojom:url_mojom_gurl",
    "//url/mojom:url_mojom_origin",
    "//url/mojom:url_mojom_scheme_host_port",
  ]

  if (is_win) {
    public_deps += [ "//services/proxy_resolver_win/public/mojom" ]
  }

  enabled_features = []

  # TODO(crbug.com/40083944): When moving the service implementation to
  # //services/network, add the correct values for export_class_attribute /
  # export_define / export_header here. Context in https://crrev.com/2225673002.

  if (is_ct_supported) {
    enabled_features += [ "is_ct_supported" ]
    sources += [ "ct_log_info.mojom" ]
  }

  if (is_p2p_enabled) {
    enabled_features += [ "is_p2p_enabled" ]
    sources += [
      "p2p.mojom",
      "p2p_trusted.mojom",
    ]
  }

  has_dchecks = is_debug || dcheck_always_on
  if (has_dchecks && is_win) {
    enabled_features += [ "win_permissions_validation" ]
  }

  if (!is_ios) {
    export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
    export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
    export_header_blink = "third_party/blink/public/platform/web_common.h"
    if (enable_reporting) {
      enabled_features += [ "enable_reporting" ]
    }
  }

  if (is_linux) {
    # TODO(crbug.com/40263697): Remove this once is_linux in the mojom IDL does
    # not include lacros.
    enabled_features += [ "use_network_interface_change_listener" ]
  }

  # Typemaps which apply to both Blink and non-Blink bindings.
  shared_cpp_typemaps = []

  # Typemaps applied only to non-Blink bindings
  cpp_typemaps = [
    {
      types = [
        {
          mojom = "network.mojom.HashAlgorithm"
          cpp = "::net::ct::DigitallySigned::HashAlgorithm"
        },
        {
          mojom = "network.mojom.SignatureAlgorithm"
          cpp = "::net::ct::DigitallySigned::SignatureAlgorithm"
        },
        {
          mojom = "network.mojom.DigitallySigned"
          cpp = "::net::ct::DigitallySigned"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/digitally_signed_mojom_traits.h" ]
      traits_sources =
          [ "//services/network/public/cpp/digitally_signed_mojom_traits.cc" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "cert_verifier.mojom.RequestParams"
          cpp = "::net::CertVerifier::RequestParams"
        },
        {
          mojom = "cert_verifier.mojom.CertVerifierConfig"
          cpp = "::net::CertVerifier::Config"
        },
      ]
      traits_headers = [ "//services/network/public/cpp/cert_verifier/cert_verifier_mojom_traits.h" ]
      traits_sources = [ "//services/network/public/cpp/cert_verifier/cert_verifier_mojom_traits.cc" ]
      traits_public_deps = [
        "//mojo/public/cpp/base",
        "//net",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.DefaultCredentials"
          cpp = "::net::HttpAuthPreferences::DefaultCredentials"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/default_credentials_mojom_traits.h" ]
      traits_sources = [
        "//services/network/public/cpp/default_credentials_mojom_traits.cc",
      ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.NetLogCaptureMode"
          cpp = "::net::NetLogCaptureMode"
        },
        {
          mojom = "network.mojom.NetLogEventPhase"
          cpp = "::net::NetLogEventPhase"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/net_log_mojom_traits.h" ]
      traits_sources =
          [ "//services/network/public/cpp/net_log_mojom_traits.cc" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.TransferableDirectory"
          cpp = "::network::TransferableDirectory"
          move_only = true
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/transferable_directory_mojom_traits.h",
      ]
      traits_sources = [
        "//services/network/public/cpp/transferable_directory_mojom_traits.cc",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.FileEnumerationEntry"
          cpp = "::disk_cache::BackendFileOperations::FileEnumerationEntry"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/file_enumeration_entry_mojom_traits.h",
      ]
      traits_sources = [
        "//services/network/public/cpp/file_enumeration_entry_mojom_traits.cc",
      ]
      traits_public_deps = [
        "//net",
        "//services/network/public/cpp:cpp_base",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.TransferableSocket"
          cpp = "::network::TransferableSocket"
          move_only = true
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/transferable_socket_mojom_traits.h" ]
      traits_sources = [
        "//services/network/public/cpp/transferable_socket_mojom_traits.cc",
      ]
    },
    {
      types = [
        {
          mojom = "network.mojom.SHA256HashValue"
          cpp = "::net::SHA256HashValue"
        },
      ]
      traits_headers =
          [ "//services/network/public/cpp/hash_value_mojom_traits.h" ]
      traits_sources =
          [ "//services/network/public/cpp/hash_value_mojom_traits.cc" ]
      traits_public_deps = [ "//net" ]
    },
    {
      types = [
        {
          mojom = "network.mojom.GeoHint"
          cpp = "::ip_protection::GeoHint"
        },
        {
          mojom = "network.mojom.BlindSignedAuthToken"
          cpp = "::ip_protection::BlindSignedAuthToken"
        },
      ]
      traits_headers = [
        "//services/network/public/cpp/ip_protection_data_types_mojom_traits.h",
      ]
      traits_sources = [ "//services/network/public/cpp/ip_protection_data_types_mojom_traits.cc" ]
    },
  ]

  if (enable_reporting) {
    cpp_typemaps += [
      {
        types = [
          {
            mojom = "network::mojom::ReportingApiReportStatus"
            cpp = "::net::ReportingReport::Status"
          },
          {
            mojom = "network.mojom.ReportingApiReport"
            cpp = "::net::ReportingReport"
          },
        ]
        traits_headers = [
          "//services/network/public/cpp/reporting_api_report_mojom_traits.h",
        ]
        traits_sources = [
          "//services/network/public/cpp/reporting_api_report_mojom_traits.cc",
        ]
        traits_public_deps = [ "//net" ]
      },
      {
        types = [
          {
            mojom = "network.mojom.ReportingApiEndpoint"
            cpp = "::net::ReportingEndpoint"
          },
        ]
        traits_headers = [
          "//services/network/public/cpp/reporting_api_endpoint_mojom_traits.h",
        ]
        traits_sources = [ "//services/network/public/cpp/reporting_api_endpoint_mojom_traits.cc" ]
        traits_public_deps = [ "//net" ]
      },
    ]
  }

  cpp_typemaps += shared_cpp_typemaps
  blink_cpp_typemaps = shared_cpp_typemaps
}