# 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.

# This target facilitates `ReportingClient` ability to select underlying storage
# for encrypted reporting pipeline report client. It is built into Chrome and
# configured differently depending on the platform. In the case of ChromeOS, it
# can store events in `missived` daemon, otherwise it stores them locally and
# also provides the uploader for them. It can also be built into other daemons;
# in that case it always connects to `missived` daemon.
static_library("storage_selector") {
  defines = [ "IS_STORAGE_SELECTOR_IMPL" ]

  public_deps = [
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//components/reporting/storage:storage_module_interface",
    "//components/reporting/util:status",
  ]
  sources = [ "storage_selector.h" ]
  if (is_chromeos) {
    sources += [ "storage_selector_chromeos.cc" ]
    deps = [
      "//chromeos/dbus/missive",
      "//components/reporting/proto:interface_proto",
    ]
  } else {
    sources += [ "storage_selector.cc" ]
    deps = [
      "//components/reporting/compression:compression_module",
      "//components/reporting/encryption:encryption_module",
      "//components/reporting/storage:storage_module",
    ]
    public_deps +=
        [ "//components/reporting/storage:storage_uploader_interface" ]
  }
}
