chromium/components/component_updater/component_installer.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/component_updater/component_installer.h"

#include <cstdint>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "base/version.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/component_updater/component_updater_service.h"
#include "components/crx_file/crx_verifier.h"
#include "components/update_client/update_client.h"
#include "components/update_client/update_client_errors.h"
#include "components/update_client/update_query_params.h"
#include "components/update_client/utils.h"

#if BUILDFLAG(IS_APPLE)
#include "base/apple/backup_util.h"
#endif

namespace component_updater {

const char kNullVersion[] =;

namespace {
Result;
InstallError;
}  // namespace

ComponentInstallerPolicy::~ComponentInstallerPolicy() = default;

bool ComponentInstallerPolicy::AllowCachedCopies() const {}

bool ComponentInstallerPolicy::AllowUpdatesOnMeteredConnections() const {}

bool ComponentInstallerPolicy::AllowUpdates() const {}

ComponentInstaller::RegistrationInfo::RegistrationInfo()
    :{}

ComponentInstaller::RegistrationInfo::~RegistrationInfo() = default;

ComponentInstaller::ComponentInstaller(
    std::unique_ptr<ComponentInstallerPolicy> installer_policy,
    scoped_refptr<update_client::ActionHandler> action_handler,
    base::TaskPriority task_priority)
    :{}

ComponentInstaller::~ComponentInstaller() = default;

void ComponentInstaller::Register(ComponentUpdateService* cus,
                                  base::OnceClosure callback) {}

void ComponentInstaller::Register(
    RegisterCallback register_callback,
    base::OnceClosure callback,
    const base::Version& registered_version,
    const base::Version& max_previous_product_version) {}

void ComponentInstaller::OnUpdateError(int error) {}

Result ComponentInstaller::InstallHelper(const base::FilePath& unpack_path,
                                         base::Value::Dict* manifest,
                                         base::Version* version,
                                         base::FilePath* install_path) {}

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

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

bool ComponentInstaller::Uninstall() {}

bool ComponentInstaller::FindPreinstallation(
    const base::FilePath& root,
    scoped_refptr<RegistrationInfo> registration_info) {}

// Checks to see if the installation found in |path| is valid, and returns
// its manifest if it is.
std::optional<base::Value::Dict>
ComponentInstaller::GetValidInstallationManifest(const base::FilePath& path) {}

// Processes the user component directory to select an appropriate component
// version, and saves its data to |registration_info|.
std::optional<base::Version> ComponentInstaller::SelectComponentVersion(
    const base::Version& registered_version,
    const base::Version& max_previous_product_version,
    const base::FilePath& base_dir,
    scoped_refptr<RegistrationInfo> registration_info) {}

void ComponentInstaller::DeleteUnselectedComponentVersions(
    const base::FilePath& base_dir,
    const std::optional<base::Version>& selected_version) {}

std::optional<base::FilePath> ComponentInstaller::GetComponentDirectory() {}

void ComponentInstaller::StartRegistration(
    const base::Version& registered_version,
    const base::Version& max_previous_product_version,
    scoped_refptr<RegistrationInfo> registration_info) {}

void ComponentInstaller::UninstallOnTaskRunner() {}

void ComponentInstaller::FinishRegistration(
    scoped_refptr<RegistrationInfo> registration_info,
    RegisterCallback register_callback,
    base::OnceClosure callback) {}

void ComponentInstaller::ComponentReady(base::Value::Dict manifest) {}

}  // namespace component_updater