#ifdef UNSAFE_BUFFERS_BUILD
#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;
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() { … }
void SetFirstPartySetsConfig(SetsReadyOnceCallback on_sets_ready,
base::TaskPriority priority) { … }
}
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) { … }
bool FirstPartySetsComponentInstallerPolicy::VerifyInstallation(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const { … }
base::FilePath FirstPartySetsComponentInstallerPolicy::GetRelativeInstallDir()
const { … }
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 { … }
void FirstPartySetsComponentInstallerPolicy::ResetForTesting() { … }
void FirstPartySetsComponentInstallerPolicy::WriteComponentForTesting(
base::Version version,
const base::FilePath& install_dir,
std::string_view contents) { … }
}