blob: 4c4442144406bdfce19f4853cb73b93d73a1e1a3 [file] [log] [blame]
Scott Violet63553fe2020-06-09 16:59:251# Copyright 2020 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//mojo/public/tools/bindings/mojom.gni")
6
7mojom("common_mojom") {
8 sources = [
Scott Violet63553fe2020-06-09 16:59:259 "interfaces.mojom",
Scott Violet9343e642020-06-12 18:47:2110 "origin_matcher.mojom",
Scott Violet63553fe2020-06-09 16:59:2511 ]
12
13 public_deps = [
14 "//mojo/public/mojom/base",
15 "//third_party/blink/public/mojom:mojom_core",
16 ]
17
18 cpp_typemaps = [
19 {
20 types = [
21 {
Scott Violet9343e642020-06-12 18:47:2122 mojom = "js_injection.mojom.OriginMatcher"
23 cpp = "::js_injection::OriginMatcher"
Scott Violet63553fe2020-06-09 16:59:2524 },
Scott Violetd61b7cf2020-06-11 22:15:0525 {
26 mojom = "js_injection.mojom.OriginMatcherRule"
27 cpp = "::std::unique_ptr<::js_injection::OriginMatcherRule>"
28 move_only = true
29 },
Scott Violet63553fe2020-06-09 16:59:2530 ]
Scott Violet9343e642020-06-12 18:47:2131 traits_headers = [
32 "origin_matcher_mojom_traits.h",
33 "origin_matcher.h",
34 ]
35 traits_sources = [ "origin_matcher_mojom_traits.cc" ]
Scott Violetd61b7cf2020-06-11 22:15:0536 traits_public_deps = [ ":common" ]
Scott Violet63553fe2020-06-09 16:59:2537 },
38 ]
Scott Violetd61b7cf2020-06-11 22:15:0539 overridden_deps = [ "//third_party/blink/public/mojom:mojom_core" ]
40 component_deps = [ "//third_party/blink/public/common" ]
Scott Violet63553fe2020-06-09 16:59:2541}
42
43source_set("common") {
Scott Violet9343e642020-06-12 18:47:2144 public = [ "origin_matcher.h" ]
Scott Violet63553fe2020-06-09 16:59:2545 sources = [
Scott Violet9343e642020-06-12 18:47:2146 "origin_matcher.cc",
Scott Violetd61b7cf2020-06-11 22:15:0547 "origin_matcher_internal.cc",
48 "origin_matcher_internal.h",
Scott Violet63553fe2020-06-09 16:59:2549 ]
50 deps = [
51 "//base",
52 "//net",
53 "//url",
54 ]
Scott Violetd61b7cf2020-06-11 22:15:0555
56 # origin_matcher_internal is needed by mojom traits and tests.
57 friend = [ ":*" ]
Scott Violet63553fe2020-06-09 16:59:2558}
59
60source_set("unit_tests") {
61 testonly = true
Scott Violet9343e642020-06-12 18:47:2162 sources = [ "origin_matcher_unittest.cc" ]
Scott Violet63553fe2020-06-09 16:59:2563 deps = [
64 ":common",
Scott Violetd61b7cf2020-06-11 22:15:0565 ":common_mojom",
Scott Violet63553fe2020-06-09 16:59:2566 "//base",
67 "//base/test:test_support",
Scott Violetd61b7cf2020-06-11 22:15:0568 "//mojo/public/cpp/test_support:test_utils",
Scott Violet63553fe2020-06-09 16:59:2569 "//url",
70 ]
71}