chromium/chrome/updater/update_service.h

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

#ifndef CHROME_UPDATER_UPDATE_SERVICE_H_
#define CHROME_UPDATER_UPDATE_SERVICE_H_

#include <ostream>
#include <string>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/version.h"
#include "chrome/updater/enum_traits.h"
#include "chrome/updater/util/util.h"
#include "components/update_client/update_client.h"

namespace updater {

struct RegistrationRequest;

enum class UpdaterScope;

// The UpdateService is the cross-platform core of the updater.
// All functions and callbacks must be called on the same sequence.
class UpdateService : public base::RefCountedThreadSafe<UpdateService> {};

// These specializations must be defined in the `updater` namespace.
template <>
struct EnumTraits<UpdateService::Result> {};

template <>
struct EnumTraits<UpdateService::UpdateState::State> {};

template <>
struct EnumTraits<UpdateService::ErrorCategory> {};

std::ostream& operator<<(std::ostream& os,
                         const UpdateService::UpdateState& update_state);

inline std::ostream& operator<<(
    std::ostream& os,
    const UpdateService::PolicySameVersionUpdate& policy_same_version_update) {}

bool operator==(const UpdateService::UpdateState& lhs,
                const UpdateService::UpdateState& rhs);
inline bool operator!=(const UpdateService::UpdateState& lhs,
                       const UpdateService::UpdateState& rhs) {}

}  // namespace updater

#endif  // CHROME_UPDATER_UPDATE_SERVICE_H_