| # Copyright 2022 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") |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| |
| mojom("mojom") { |
| sources = [ |
| "eligibility_error.mojom", |
| "os_support.mojom", |
| "registration_type.mojom", |
| "source_registration_error.mojom", |
| "trigger_registration_error.mojom", |
| ] |
| webui_module_path = "/" |
| use_typescript_sources = true |
| |
| # Used by Blink, so requires legacy JS bindings. |
| generate_legacy_js_bindings = true |
| generate_java = true |
| } |
| |
| component("attribution_reporting") { |
| sources = [ |
| "aggregatable_dedup_key.cc", |
| "aggregatable_dedup_key.h", |
| "aggregatable_trigger_data.cc", |
| "aggregatable_trigger_data.h", |
| "aggregatable_values.cc", |
| "aggregatable_values.h", |
| "aggregation_keys.cc", |
| "aggregation_keys.h", |
| "constants.h", |
| "destination_set.cc", |
| "destination_set.h", |
| "eligibility.cc", |
| "eligibility.h", |
| "event_trigger_data.cc", |
| "event_trigger_data.h", |
| "filters.cc", |
| "filters.h", |
| "os_registration.cc", |
| "os_registration.h", |
| "parsing_utils.cc", |
| "parsing_utils.h", |
| "source_registration.cc", |
| "source_registration.h", |
| "source_type.cc", |
| "source_type.h", |
| "suitable_origin.cc", |
| "suitable_origin.h", |
| "trigger_registration.cc", |
| "trigger_registration.h", |
| ] |
| |
| public_deps = [ |
| ":mojom", |
| ":source_type_mojom", |
| "//base", |
| "//components/aggregation_service", |
| "//components/aggregation_service:mojom", |
| "//net", |
| "//url", |
| ] |
| |
| deps = [ "//services/network/public/cpp" ] |
| |
| defines = [ "IS_ATTRIBUTION_REPORTING_IMPL" ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| |
| sources = [ |
| "aggregatable_dedup_key_unittest.cc", |
| "aggregatable_trigger_data_unittest.cc", |
| "aggregatable_values_unittest.cc", |
| "aggregation_keys_unittest.cc", |
| "destination_set_unittest.cc", |
| "eligibility_unittest.cc", |
| "event_trigger_data_unittest.cc", |
| "filters_unittest.cc", |
| "os_registration_unittest.cc", |
| "parsing_utils_unittest.cc", |
| "source_registration_unittest.cc", |
| "suitable_origin_unittest.cc", |
| "trigger_registration_unittest.cc", |
| ] |
| |
| deps = [ |
| ":attribution_reporting", |
| ":test_support", |
| "//base", |
| "//base/test:test_support", |
| "//testing/gtest", |
| ] |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| |
| sources = [ |
| "test_utils.cc", |
| "test_utils.h", |
| ] |
| |
| public_deps = [ |
| ":attribution_reporting", |
| "//services/network/public/cpp", |
| ] |
| |
| deps = [ "//base" ] |
| } |
| |
| fuzzer_test("parse_os_header_fuzzer") { |
| sources = [ "parse_os_header_fuzzer.cc" ] |
| deps = [ |
| ":attribution_reporting", |
| "//base", |
| "//base:i18n", |
| ] |
| |
| seed_corpus = |
| "//components/attribution_reporting/parse_os_header_fuzzer_corpus/" |
| } |
| |
| fuzzer_test("source_registration_fuzzer") { |
| sources = [ "source_registration_fuzzer.cc" ] |
| deps = [ |
| ":attribution_reporting", |
| "//base", |
| "//base:i18n", |
| "//testing/libfuzzer/proto:json_proto", |
| "//testing/libfuzzer/proto:json_proto_converter", |
| "//third_party/libprotobuf-mutator", |
| ] |
| seed_corpus = |
| "//components/attribution_reporting/source_registration_fuzzer_corpus" |
| } |
| |
| fuzzer_test("trigger_registration_fuzzer") { |
| sources = [ "trigger_registration_fuzzer.cc" ] |
| deps = [ |
| ":attribution_reporting", |
| "//base", |
| "//base:i18n", |
| "//testing/libfuzzer/proto:json_proto", |
| "//testing/libfuzzer/proto:json_proto_converter", |
| "//third_party/libprotobuf-mutator", |
| ] |
| seed_corpus = |
| "//components/attribution_reporting/trigger_registration_fuzzer_corpus" |
| } |
| |
| fuzzer_test("parse_eligible_header_fuzzer") { |
| sources = [ "parse_eligible_header_fuzzer.cc" ] |
| deps = [ |
| ":attribution_reporting", |
| "//base", |
| "//base:i18n", |
| ] |
| |
| seed_corpus = |
| "//components/attribution_reporting/parse_eligible_header_fuzzer_corpus/" |
| } |
| |
| mojom("registration_mojom") { |
| sources = [ "registration.mojom" ] |
| |
| generate_java = true |
| webui_module_path = "/" |
| use_typescript_sources = true |
| |
| # Used by Blink, so requires legacy JS bindings. |
| generate_legacy_js_bindings = true |
| |
| deps = [ |
| "//components/aggregation_service:mojom", |
| "//mojo/public/mojom/base", |
| "//services/network/public/mojom:mojom_schemeful_site", |
| "//url/mojom:url_mojom_origin", |
| ] |
| |
| export_class_attribute_blink = "PLATFORM_EXPORT" |
| export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" |
| export_header_blink = "third_party/blink/renderer/platform/platform_export.h" |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "attribution_reporting.mojom.DebugKey" |
| cpp = "uint64_t" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.TriggerDedupKey" |
| cpp = "uint64_t" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.SuitableOrigin" |
| cpp = "::attribution_reporting::SuitableOrigin" |
| forward_declaration = |
| "namespace attribution_reporting { class SuitableOrigin; }" |
| |
| # Avoid expensive copies by forcing Mojo methods to take the type by |
| # value, not const ref |
| move_only = true |
| }, |
| { |
| mojom = "attribution_reporting.mojom.FilterData" |
| cpp = "::attribution_reporting::FilterData" |
| forward_declaration = |
| "namespace attribution_reporting { class FilterData; }" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.AggregationKeys" |
| cpp = "::attribution_reporting::AggregationKeys" |
| forward_declaration = |
| "namespace attribution_reporting { class AggregationKeys; }" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.SourceRegistration" |
| cpp = "::attribution_reporting::SourceRegistration" |
| forward_declaration = |
| "namespace attribution_reporting { struct SourceRegistration; }" |
| |
| # Avoid expensive copies by forcing Mojo methods to take the type by |
| # value, not const ref |
| move_only = true |
| }, |
| { |
| mojom = "attribution_reporting.mojom.FilterPair" |
| cpp = "::attribution_reporting::FilterPair" |
| forward_declaration = |
| "namespace attribution_reporting { struct FilterPair; }" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.EventTriggerData" |
| cpp = "::attribution_reporting::EventTriggerData" |
| forward_declaration = |
| "namespace attribution_reporting { struct EventTriggerData; }" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.AggregatableTriggerData" |
| cpp = "::attribution_reporting::AggregatableTriggerData" |
| forward_declaration = "namespace attribution_reporting { struct AggregatableTriggerData; }" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.AggregatableDedupKey" |
| cpp = "::attribution_reporting::AggregatableDedupKey" |
| forward_declaration = |
| "namespace attribution_reporting { struct AggregatableDedupKey; }" |
| }, |
| { |
| mojom = "attribution_reporting.mojom.TriggerRegistration" |
| cpp = "::attribution_reporting::TriggerRegistration" |
| forward_declaration = |
| "namespace attribution_reporting { struct TriggerRegistration; }" |
| |
| # Avoid expensive copies by forcing Mojo methods to take the type by |
| # value, not const ref |
| move_only = true |
| }, |
| { |
| mojom = "attribution_reporting.mojom.DestinationSet" |
| cpp = "::attribution_reporting::DestinationSet" |
| forward_declaration = |
| "namespace attribution_reporting { class DestinationSet; }" |
| }, |
| ] |
| traits_headers = [ "registration_mojom_traits.h" ] |
| traits_public_deps = [ ":registration_mojom_traits" ] |
| }, |
| ] |
| |
| blink_cpp_typemaps = cpp_typemaps |
| } |
| |
| component("registration_mojom_traits") { |
| sources = [ |
| "registration_mojom_traits.cc", |
| "registration_mojom_traits.h", |
| ] |
| |
| defines = [ "IS_ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS_IMPL" ] |
| |
| public_deps = [ |
| ":attribution_reporting", |
| ":registration_mojom_shared", |
| "//base", |
| "//components/aggregation_service:mojom_shared", |
| "//mojo/public/cpp/base:shared_typemap_traits", |
| "//net", |
| "//services/network/public/mojom", |
| "//url", |
| "//url/mojom:mojom_traits", |
| ] |
| } |
| |
| mojom("source_type_mojom") { |
| sources = [ "source_type.mojom" ] |
| webui_module_path = "/" |
| use_typescript_sources = true |
| } |