chromium/chrome/browser/upgrade_detector/installed_version_poller.cc

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

#include "chrome/browser/upgrade_detector/installed_version_poller.h"

#include <stdint.h>
#include <string>
#include <utility>
#include <vector>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/upgrade_detector/build_state.h"
#include "chrome/browser/upgrade_detector/get_installed_version.h"
#include "chrome/browser/upgrade_detector/installed_version_monitor.h"
#include "chrome/common/chrome_switches.h"
#include "components/version_info/version_info.h"

namespace {

bool g_disabled_for_testing =;

// Bits in a testing options bitfield.
constexpr uint32_t kSimulateUpgrade =;
constexpr uint32_t kSimulateCriticalUpdate =;

// Returns a bitfield of the testing options that are selected via command line
// switches, or 0 if no options are selected.
uint32_t GetTestingOptions() {}

// A GetInstalledVersionCallback implementation used when a regular or a
// critical update is simulated via --simulate-upgrade or
// --simulate-critical-update.
void SimulateGetInstalledVersion(uint32_t testing_options,
                                 InstalledVersionCallback callback) {}

// Returns the callback to get the installed version. Use of any testing option
// on the process command line results in use of the simulation function.
InstalledVersionPoller::GetInstalledVersionCallback
GetGetInstalledVersionCallback() {}

// Returns the polling interval specified by --check-for-update-interval, or
// the default interval.
base::TimeDelta GetPollingInterval() {}

}  // namespace

// InstalledVersionPoller::ScopedDisableForTesting ----------------------------

InstalledVersionPoller::ScopedDisableForTesting::ScopedDisableForTesting() {}

InstalledVersionPoller::ScopedDisableForTesting::~ScopedDisableForTesting() {}

// InstalledVersionPoller ------------------------------------------------------

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class InstalledVersionPoller::PollType {};

// static
const base::TimeDelta InstalledVersionPoller::kDefaultPollingInterval =;

InstalledVersionPoller::InstalledVersionPoller(BuildState* build_state)
    :{}

InstalledVersionPoller::InstalledVersionPoller(
    BuildState* build_state,
    GetInstalledVersionCallback get_installed_version,
    std::unique_ptr<InstalledVersionMonitor> monitor,
    const base::TickClock* tick_clock)
    :{}

InstalledVersionPoller::~InstalledVersionPoller() {}

void InstalledVersionPoller::StartMonitor(
    std::unique_ptr<InstalledVersionMonitor> monitor) {}

void InstalledVersionPoller::OnMonitorResult(bool error) {}

void InstalledVersionPoller::Poll(PollType poll_type) {}

void InstalledVersionPoller::OnInstalledVersion(
    PollType poll_type,
    InstalledAndCriticalVersion versions) {}