chromium/components/safe_browsing/core/browser/realtime/BUILD.gn

# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("policy_engine") {
  sources = [
    "policy_engine.cc",
    "policy_engine.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]
  deps = [
    "//base:base",
    "//components/enterprise/connectors/core",
    "//components/prefs",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//components/unified_consent",
    "//components/user_prefs",
    "//components/variations/service",
    "//services/network/public/cpp:cpp",
    "//services/network/public/mojom",
  ]
}

static_library("url_lookup_service") {
  sources = [
    "url_lookup_service.cc",
    "url_lookup_service.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    ":policy_engine",
    ":url_lookup_service_base",
    "//base:base",
    "//components/enterprise/common/proto:connectors_proto",
    "//components/prefs",
    "//components/safe_browsing:buildflags",
    "//components/safe_browsing/core/browser:referrer_chain_provider",
    "//components/safe_browsing/core/browser:token_fetcher",
    "//components/safe_browsing/core/browser:verdict_cache_manager",
    "//components/safe_browsing/core/browser/db:v4_protocol_manager_util",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/proto:csd_proto",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//components/unified_consent",
    "//components/variations/service:service",
    "//services/network/public/cpp:cpp",
    "//url:url",
  ]
}

static_library("url_lookup_service_base") {
  sources = [
    "url_lookup_service_base.cc",
    "url_lookup_service_base.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    "//base:base",
    "//build:chromeos_buildflags",
    "//components/enterprise/common/proto:connectors_proto",
    "//components/keyed_service/core",
    "//components/prefs",
    "//components/safe_browsing:buildflags",
    "//components/safe_browsing/core/browser:referrer_chain_provider",
    "//components/safe_browsing/core/browser:verdict_cache_manager",
    "//components/safe_browsing/core/browser/db:v4_protocol_manager_util",
    "//components/safe_browsing/core/browser/utils",
    "//components/safe_browsing/core/common:common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/proto:csd_proto",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//components/sessions:session_id",
    "//services/network/public/cpp:cpp",
    "//url:url",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "fake_url_lookup_service.cc",
    "fake_url_lookup_service.h",
  ]

  public_deps = [
    ":url_lookup_service_base",
    "//base",
    "//components/enterprise/common/proto:connectors_proto",
    "//components/safe_browsing/core/common/proto:csd_proto",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//net/traffic_annotation:test_support",
    "//services/network/public/cpp:cpp",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "policy_engine_unittest.cc",
    "url_lookup_service_unittest.cc",
  ]
  deps = [
    ":policy_engine",
    ":url_lookup_service",
    "//base/test:test_support",
    "//components/content_settings/core/browser",
    "//components/enterprise/connectors/core",
    "//components/safe_browsing:buildflags",
    "//components/safe_browsing/core/browser:referrer_chain_provider",
    "//components/safe_browsing/core/browser:token_fetcher",
    "//components/safe_browsing/core/browser:token_fetcher_testing_helper",
    "//components/safe_browsing/core/browser:verdict_cache_manager",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/sync_preferences:test_support",
    "//components/unified_consent",
    "//components/user_prefs",
    "//components/variations/service:service",
    "//services/network:test_support",
    "//services/network/public/cpp:cpp",
    "//services/network/public/mojom",
    "//testing/gtest",
    "//third_party/googletest:gmock",
  ]
  if (is_ios) {
    deps += [ "//components/test:safe_browsing_test_bundle_data" ]
  }
}