BUILD.gn 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # 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. import("//mojo/public/tools/bindings/mojom.gni")
  5. mojom("common_mojom") {
  6. sources = [
  7. "interfaces.mojom",
  8. "origin_matcher.mojom",
  9. ]
  10. public_deps = [
  11. "//mojo/public/mojom/base",
  12. "//third_party/blink/public/mojom:mojom_core",
  13. ]
  14. cpp_typemaps = [
  15. {
  16. types = [
  17. {
  18. mojom = "js_injection.mojom.OriginMatcher"
  19. cpp = "::js_injection::OriginMatcher"
  20. },
  21. {
  22. mojom = "js_injection.mojom.OriginMatcherRule"
  23. cpp = "::std::unique_ptr<::js_injection::OriginMatcherRule>"
  24. move_only = true
  25. },
  26. ]
  27. traits_headers = [
  28. "origin_matcher_mojom_traits.h",
  29. "origin_matcher.h",
  30. ]
  31. traits_sources = [ "origin_matcher_mojom_traits.cc" ]
  32. traits_public_deps = [ ":common" ]
  33. },
  34. ]
  35. overridden_deps = [ "//third_party/blink/public/mojom:mojom_core" ]
  36. component_deps = [ "//third_party/blink/public/common" ]
  37. }
  38. source_set("common") {
  39. public = [ "origin_matcher.h" ]
  40. sources = [
  41. "origin_matcher.cc",
  42. "origin_matcher_internal.cc",
  43. "origin_matcher_internal.h",
  44. ]
  45. deps = [
  46. "//base",
  47. "//net",
  48. "//url",
  49. ]
  50. # origin_matcher_internal is needed by mojom traits and tests.
  51. friend = [ ":*" ]
  52. }
  53. source_set("unit_tests") {
  54. testonly = true
  55. sources = [ "origin_matcher_unittest.cc" ]
  56. deps = [
  57. ":common",
  58. ":common_mojom",
  59. "//base",
  60. "//base/test:test_support",
  61. "//mojo/public/cpp/test_support:test_utils",
  62. "//url",
  63. ]
  64. }