summaryrefslogtreecommitdiff
path: root/chromium/components/js_injection/common/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/js_injection/common/BUILD.gn')
-rw-r--r--chromium/components/js_injection/common/BUILD.gn71
1 files changed, 71 insertions, 0 deletions
diff --git a/chromium/components/js_injection/common/BUILD.gn b/chromium/components/js_injection/common/BUILD.gn
new file mode 100644
index 00000000000..4c444214440
--- /dev/null
+++ b/chromium/components/js_injection/common/BUILD.gn
@@ -0,0 +1,71 @@
+# Copyright 2020 The Chromium Authors. All rights reserved.
+# 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("common_mojom") {
+ sources = [
+ "interfaces.mojom",
+ "origin_matcher.mojom",
+ ]
+
+ public_deps = [
+ "//mojo/public/mojom/base",
+ "//third_party/blink/public/mojom:mojom_core",
+ ]
+
+ cpp_typemaps = [
+ {
+ types = [
+ {
+ mojom = "js_injection.mojom.OriginMatcher"
+ cpp = "::js_injection::OriginMatcher"
+ },
+ {
+ mojom = "js_injection.mojom.OriginMatcherRule"
+ cpp = "::std::unique_ptr<::js_injection::OriginMatcherRule>"
+ move_only = true
+ },
+ ]
+ traits_headers = [
+ "origin_matcher_mojom_traits.h",
+ "origin_matcher.h",
+ ]
+ traits_sources = [ "origin_matcher_mojom_traits.cc" ]
+ traits_public_deps = [ ":common" ]
+ },
+ ]
+ overridden_deps = [ "//third_party/blink/public/mojom:mojom_core" ]
+ component_deps = [ "//third_party/blink/public/common" ]
+}
+
+source_set("common") {
+ public = [ "origin_matcher.h" ]
+ sources = [
+ "origin_matcher.cc",
+ "origin_matcher_internal.cc",
+ "origin_matcher_internal.h",
+ ]
+ deps = [
+ "//base",
+ "//net",
+ "//url",
+ ]
+
+ # origin_matcher_internal is needed by mojom traits and tests.
+ friend = [ ":*" ]
+}
+
+source_set("unit_tests") {
+ testonly = true
+ sources = [ "origin_matcher_unittest.cc" ]
+ deps = [
+ ":common",
+ ":common_mojom",
+ "//base",
+ "//base/test:test_support",
+ "//mojo/public/cpp/test_support:test_utils",
+ "//url",
+ ]
+}