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

# Copyright 2023 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("hash_realtime_service") {
  sources = [
    "hash_realtime_service.cc",
    "hash_realtime_service.h",
    "ohttp_key_service.cc",
    "ohttp_key_service.h",
  ]

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

  deps = [
    "//base:base",
    "//components/keyed_service/core",
    "//components/prefs",
    "//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",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils",
    "//components/safe_browsing/core/common/proto:safebrowsingv5_proto",
    "//google_apis:google_apis",
    "//services/network/public/cpp",
    "//url:url",
  ]
}

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

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

  deps = [
    "//base:base",
    "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils",
    "//components/safe_browsing/core/common/proto:safebrowsingv5_proto",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "hash_realtime_cache_unittest.cc",
    "hash_realtime_service_unittest.cc",
  ]
  deps = [
    ":hash_realtime_cache",
    ":hash_realtime_service",
    "//base/test:test_support",
    "//components/prefs",
    "//components/prefs:test_support",
    "//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/hashprefix_realtime:hash_realtime_utils",
    "//components/safe_browsing/core/common/proto:safebrowsingv5_proto",
    "//components/sync_preferences:test_support",
    "//components/variations",
    "//google_apis:google_apis",
    "//services/network:test_support",
    "//testing/gtest",
  ]
  if (!is_android) {
    sources += [ "ohttp_key_service_unittest.cc" ]
  }
}