1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
# 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("//build/config/features.gni")
import("//components/optimization_guide/features.gni")
import("//components/safe_browsing/buildflags.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/libprotobuf-mutator/fuzzable_proto_library.gni")
if (safe_browsing_mode != 0) {
source_set("phishing_classifier") {
sources = [
"features.cc",
"features.h",
"murmurhash3_util.cc",
"murmurhash3_util.h",
"phishing_classifier.cc",
"phishing_classifier.h",
"phishing_classifier_delegate.cc",
"phishing_classifier_delegate.h",
"phishing_dom_feature_extractor.cc",
"phishing_dom_feature_extractor.h",
"phishing_image_embedder.cc",
"phishing_image_embedder.h",
"phishing_image_embedder_delegate.cc",
"phishing_image_embedder_delegate.h",
"phishing_model_setter_impl.cc",
"phishing_model_setter_impl.h",
"phishing_term_feature_extractor.cc",
"phishing_term_feature_extractor.h",
"phishing_url_feature_extractor.cc",
"phishing_url_feature_extractor.h",
"phishing_visual_feature_extractor.cc",
"phishing_visual_feature_extractor.h",
"scorer.cc",
"scorer.h",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
public_deps = [ "//base" ]
deps = [
"//cc/paint",
"//components/optimization_guide:machine_learning_tflite_buildflags",
"//components/paint_preview/common",
"//components/safe_browsing:buildflags",
"//components/safe_browsing/content/common:interfaces",
"//components/safe_browsing/content/common:visual_utils",
"//components/safe_browsing/content/renderer",
"//components/safe_browsing/core/common",
"//components/safe_browsing/core/common/fbs:client_model",
"//components/safe_browsing/core/common/proto:client_model_proto",
"//components/safe_browsing/core/common/proto:csd_proto",
"//content/public/renderer",
"//crypto",
"//mojo/public/mojom/base:protobuf_support",
"//skia",
"//third_party/blink/public:blink_headers",
"//third_party/smhasher:murmurhash3",
"//third_party/tflite",
"//third_party/tflite:tflite_public_headers",
"//third_party/tflite_support",
"//third_party/tflite_support:tflite_support_proto",
"//ui/base",
"//ui/gfx/geometry:geometry",
"//url",
"//v8",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"features_unittest.cc",
"murmurhash3_util_unittest.cc",
"phishing_term_feature_extractor_unittest.cc",
"phishing_url_feature_extractor_unittest.cc",
"scorer_unittest.cc",
]
deps = [
":phishing_classifier",
"//base:base",
"//base/test:test_support",
"//components/safe_browsing/content/renderer/phishing_classifier:unit_tests_support",
"//components/safe_browsing/core/common/fbs:client_model",
"//components/safe_browsing/core/common/proto:client_model_proto",
"//components/safe_browsing/core/common/proto:csd_proto",
"//crypto",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//url",
]
}
source_set("unit_tests_support") {
testonly = true
sources = [
"test_utils.cc",
"test_utils.h",
]
deps = [
":phishing_classifier",
"//testing/gmock",
]
}
if (use_fuzzing_engine_with_lpm) {
fuzzer_test("client_side_phishing_fuzzer") {
sources = [ "client_side_phishing_fuzzer.cc" ]
deps = [
":client_side_phishing_fuzzer_proto",
":phishing_classifier",
"//base:base",
"//components/safe_browsing/core/common/fbs:client_model",
"//components/safe_browsing/core/common/proto:client_model_proto",
"//skia",
"//third_party/libprotobuf-mutator",
]
deps += [ "//components/safe_browsing/content/browser:client_side_detection_service" ]
}
fuzzable_proto_library("client_side_phishing_fuzzer_proto") {
proto_in_dir = "//"
sources = [ "client_side_phishing_fuzzer.proto" ]
deps =
[ "//components/safe_browsing/core/common/proto:client_model_proto" ]
}
}
}
|