blob: e695c46b55095185784a1ab0bb9b9cbd4076ee12 [file] [log] [blame]
# Copyright 2014 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("//chrome/common/features.gni")
import("//components/safe_browsing/buildflags.gni")
import("//third_party/protobuf/proto_library.gni")
proto_library("proto") {
sources = [
"client_model.proto",
"crx_info.proto",
"download_file_types.proto",
]
}
source_set("file_type_policies") {
sources = [
"file_type_policies.cc",
"file_type_policies.h",
]
deps = [
":proto",
"//base",
"//chrome/browser:resources",
"//ui/base",
]
}
if (is_win) {
source_set("pe_image_reader") {
sources = [
"pe_image_reader_win.cc",
"pe_image_reader_win.h",
]
deps = [
"//base",
]
}
}
if (safe_browsing_mode == 1) {
source_set("archive_analyzer_results") {
sources = [
"archive_analyzer_results.cc",
"archive_analyzer_results.h",
]
deps = [
":binary_feature_extractor",
":download_type_util",
":file_type_policies",
"//base",
"//base:i18n",
"//crypto",
]
if (is_mac) {
deps += [ ":disk_image_type_sniffer_mac" ]
}
public_deps = [
"//components/safe_browsing:csd_proto",
]
}
source_set("download_type_util") {
sources = [
"download_type_util.cc",
"download_type_util.h",
]
deps = [
":file_type_policies",
"//base",
"//components/safe_browsing:features",
]
public_deps = [
"//components/safe_browsing:csd_proto",
]
}
source_set("rar_analyzer") {
sources = [
"rar_analyzer.cc",
"rar_analyzer.h",
]
deps = [
":archive_analyzer_results",
":download_type_util",
":file_type_policies",
"//base",
"//base:i18n",
"//components/safe_browsing:features",
"//third_party/unrar:unrar",
]
defines = [
"_FILE_OFFSET_BITS=64",
"LARGEFILE_SOURCE",
"RAR_SMP",
"SILENT",
# The following is set to disable certain macro definitions in the unrar
# source code.
"CHROMIUM_UNRAR",
# Disables exceptions in unrar, replaces them with process termination.
"UNRAR_NO_EXCEPTIONS",
]
public_deps = [
"//components/safe_browsing:csd_proto",
]
}
source_set("disk_image_type_sniffer_mac") {
sources = [
"disk_image_type_sniffer_mac.cc",
"disk_image_type_sniffer_mac.h",
]
deps = [
"//base",
]
}
source_set("binary_feature_extractor") {
sources = [
"binary_feature_extractor.cc",
"binary_feature_extractor.h",
"binary_feature_extractor_mac.cc",
"binary_feature_extractor_win.cc",
"mach_o_image_reader_mac.cc",
"mach_o_image_reader_mac.h",
]
if (is_posix) {
sources += [ "binary_feature_extractor_posix.cc" ]
}
public_deps = [
"//base",
"//components/safe_browsing:csd_proto",
"//crypto",
]
if (is_win) {
deps = [
":pe_image_reader",
]
}
}
source_set("mock_binary_feature_extractor") {
testonly = true
sources = [
"mock_binary_feature_extractor.cc",
"mock_binary_feature_extractor.h",
]
deps = [
":binary_feature_extractor",
"//testing/gmock",
]
}
}
source_set("safe_browsing") {
deps = [
":file_type_policies",
]
if (safe_browsing_mode == 1) {
sources = [
"ipc_protobuf_message_macros.h",
"ipc_protobuf_message_null_macros.h",
"protobuf_message_log_macros.h",
"protobuf_message_read_macros.h",
"protobuf_message_write_macros.h",
"zip_analyzer.cc",
"zip_analyzer.h",
]
deps += [
":archive_analyzer_results",
":binary_feature_extractor",
":download_type_util",
":rar_analyzer",
"//components/safe_browsing:features",
]
public_deps = [
":proto",
"//base:i18n",
"//chrome/common:mojo_bindings",
"//components/safe_browsing:csd_proto",
"//crypto",
"//ipc",
"//third_party/zlib/google:zip",
]
}
}