chromium/components/web_package/mojom/BUILD.gn

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

import("//mojo/public/tools/bindings/mojom.gni")

mojom("mojom") {
  sources = [ "web_bundle_parser.mojom" ]

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

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "web_package.mojom.Ed25519PublicKey"
          cpp = "::web_package::Ed25519PublicKey"
          default_constructible = false
        },
        {
          mojom = "web_package.mojom.Ed25519Signature"
          cpp = "::web_package::Ed25519Signature"
          default_constructible = false
        },
        {
          mojom = "web_package.mojom.EcdsaP256PublicKey"
          cpp = "::web_package::EcdsaP256PublicKey"
          default_constructible = false
        },
        {
          mojom = "web_package.mojom.EcdsaP256SHA256Signature"
          cpp = "::web_package::EcdsaP256SHA256Signature"
          default_constructible = false
        },
        {
          mojom = "web_package.mojom.BundleIntegrityBlockAttributes"
          cpp = "::web_package::IntegrityBlockAttributes"
          default_constructible = false
        },
      ]
      traits_headers =
          [ "//components/web_package/mojom/web_bundle_parser_mojom_traits.h" ]
      traits_sources =
          [ "//components/web_package/mojom/web_bundle_parser_mojom_traits.cc" ]
      traits_deps = [
        "//base",
        "//components/web_package:mojom_mapped_types",
        "//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"
  }
}