chromium/chrome/updater/installer.cc

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

#include "chrome/updater/installer.h"

#include <string>
#include <utility>
#include <vector>

#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/updater/action_handler.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/update_service.h"
#include "chrome/updater/update_usage_stats_task.h"
#include "chrome/updater/updater_scope.h"
#include "chrome/updater/util/util.h"
#include "components/crx_file/crx_verifier.h"
#include "components/update_client/update_client_errors.h"
#include "components/update_client/utils.h"

namespace updater {

namespace {

// Runs in thread pool, can block.
AppInfo MakeAppInfo(UpdaterScope scope,
                    const std::string& app_id,
                    const base::Version& pv,
                    const base::FilePath& pv_path,
                    const std::string& pv_key,
                    const std::string& ap,
                    const base::FilePath& ap_path,
                    const std::string& ap_key,
                    const std::string& brand,
                    const base::FilePath& brand_path,
                    const std::string& brand_key,
                    const base::FilePath& ec_path) {}

}  // namespace

AppInfo::AppInfo(const UpdaterScope scope,
                 const std::string& app_id,
                 const std::string& ap,
                 const std::string& brand,
                 const base::Version& app_version,
                 const base::FilePath& ecp)
    :{}
AppInfo::AppInfo(const AppInfo&) = default;
AppInfo& AppInfo::operator=(const AppInfo&) = default;
AppInfo::~AppInfo() = default;

Installer::Installer(
    const std::string& app_id,
    const std::string& client_install_data,
    const std::string& install_data_index,
    const std::string& install_source,
    const std::string& target_channel,
    const std::string& target_version_prefix,
    bool rollback_allowed,
    bool update_disabled,
    UpdateService::PolicySameVersionUpdate policy_same_version_update,
    scoped_refptr<PersistedData> persisted_data,
    crx_file::VerifierFormat crx_verifier_format)
    :{}

Installer::~Installer() = default;

void Installer::MakeCrxComponent(
    base::OnceCallback<void(update_client::CrxComponent)> callback) {}

void Installer::MakeCrxComponentFromAppInfo(
    base::OnceCallback<void(update_client::CrxComponent)> callback,
    const AppInfo& app_info) {}

Installer::Result Installer::InstallHelper(
    const base::FilePath& unpack_path,
    std::unique_ptr<InstallParams> install_params,
    ProgressCallback progress_callback) {}

void Installer::InstallWithSyncPrimitives(
    const base::FilePath& unpack_path,
    std::unique_ptr<InstallParams> install_params,
    ProgressCallback progress_callback,
    Callback callback) {}

void Installer::OnUpdateError(int error) {}

void Installer::Install(const base::FilePath& unpack_path,
                        const std::string& /*public_key*/,
                        std::unique_ptr<InstallParams> install_params,
                        ProgressCallback progress_callback,
                        Callback callback) {}

bool Installer::GetInstalledFile(const std::string& file,
                                 base::FilePath* installed_file) {}

bool Installer::Uninstall() {}

}  // namespace updater