chromium/components/component_updater/installer_policies/first_party_sets_component_installer_policy.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/component_updater/installer_policies/first_party_sets_component_installer_policy.h"

#include <optional>
#include <string_view>
#include <utility>

#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/task/thread_pool.h"
#include "base/version.h"
#include "components/component_updater/component_installer.h"
#include "components/component_updater/component_updater_paths.h"
#include "net/cookies/cookie_util.h"

ComponentUpdateService;

namespace {

SetsReadyOnceCallback;

// The SHA256 of the SubjectPublicKeyInfo used to sign the component.
// The extension id is: gonpemdgkjcecdgbnaabipppbmgfggbe
constexpr uint8_t kFirstPartySetsPublicKeySHA256[32] =;

constexpr char kFirstPartySetsManifestName[] =;

constexpr base::FilePath::CharType kFirstPartySetsRelativeInstallDir[] =);

base::File OpenFile(const base::FilePath& pb_path) {}

std::optional<std::pair<base::FilePath, base::Version>>&
GetConfigPathInstance() {}

// Invokes `on_sets_ready`, if:
// * First-Party Sets is enabled; and
// * `on_sets_ready` is not null.
//
// If the component has been installed and can be read, we pass the component
// file; otherwise, we pass an invalid file.
void SetFirstPartySetsConfig(SetsReadyOnceCallback on_sets_ready,
                             base::TaskPriority priority) {}

}  // namespace

namespace component_updater {

void FirstPartySetsComponentInstallerPolicy::OnRegistrationComplete() {}

FirstPartySetsComponentInstallerPolicy::FirstPartySetsComponentInstallerPolicy(
    SetsReadyOnceCallback on_sets_ready,
    base::TaskPriority priority)
    :{}

FirstPartySetsComponentInstallerPolicy::
    ~FirstPartySetsComponentInstallerPolicy() = default;

bool FirstPartySetsComponentInstallerPolicy::
    SupportsGroupPolicyEnabledComponentUpdates() const {}

bool FirstPartySetsComponentInstallerPolicy::RequiresNetworkEncryption() const {}

update_client::CrxInstaller::Result
FirstPartySetsComponentInstallerPolicy::OnCustomInstall(
    const base::Value::Dict& manifest,
    const base::FilePath& install_dir) {}

void FirstPartySetsComponentInstallerPolicy::OnCustomUninstall() {}

base::FilePath FirstPartySetsComponentInstallerPolicy::GetInstalledPath(
    const base::FilePath& base) {}

void FirstPartySetsComponentInstallerPolicy::ComponentReady(
    const base::Version& version,
    const base::FilePath& install_dir,
    base::Value::Dict manifest) {}

// Called during startup and installation before ComponentReady().
bool FirstPartySetsComponentInstallerPolicy::VerifyInstallation(
    const base::Value::Dict& manifest,
    const base::FilePath& install_dir) const {}

base::FilePath FirstPartySetsComponentInstallerPolicy::GetRelativeInstallDir()
    const {}

// static
void FirstPartySetsComponentInstallerPolicy::GetPublicKeyHash(
    std::vector<uint8_t>* hash) {}

void FirstPartySetsComponentInstallerPolicy::GetHash(
    std::vector<uint8_t>* hash) const {}

std::string FirstPartySetsComponentInstallerPolicy::GetName() const {}

update_client::InstallerAttributes
FirstPartySetsComponentInstallerPolicy::GetInstallerAttributes() const {}

// static
void FirstPartySetsComponentInstallerPolicy::ResetForTesting() {}

// static
void FirstPartySetsComponentInstallerPolicy::WriteComponentForTesting(
    base::Version version,
    const base::FilePath& install_dir,
    std::string_view contents) {}

}  // namespace component_updater