#include "chrome/browser/component_updater/pnacl_component_installer.h"
#include <stdint.h>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/atomicops.h"
#include "base/base_paths.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/json/json_file_value_serializer.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "base/version.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_paths.h"
#include "components/component_updater/component_installer.h"
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/component_updater_utils.h"
#include "components/nacl/common/nacl_switches.h"
#include "components/update_client/update_query_params.h"
#include "components/update_client/utils.h"
#include "content/public/browser/browser_thread.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/windows_version.h"
#endif
BrowserThread;
CrxComponent;
UpdateQueryParams;
namespace component_updater {
namespace {
const char kPnaclManifestName[] = …;
constexpr uint8_t kPnaclPublicKeySHA256[32] = …;
std::string SanitizeForPath(const std::string& input) { … }
const char kMinPnaclVersion[] = …;
volatile base::subtle::Atomic32 needs_on_demand_update = …;
void CheckVersionCompatiblity(const base::Version& current_version) { … }
base::FilePath GetPlatformDir(const base::FilePath& base_path) { … }
void OverrideDirPnaclComponent(const base::FilePath& base_path) { … }
std::optional<base::Value::Dict> ReadJSONManifest(
const base::FilePath& manifest_path) { … }
std::optional<base::Value::Dict> ReadPnaclManifest(
const base::FilePath& unpack_path) { … }
bool CheckPnaclComponentManifest(const base::Value::Dict& manifest,
const base::Value::Dict& pnacl_manifest) { … }
class PnaclComponentInstallerPolicy : public ComponentInstallerPolicy { … };
PnaclComponentInstallerPolicy::PnaclComponentInstallerPolicy() = default;
PnaclComponentInstallerPolicy::~PnaclComponentInstallerPolicy() = default;
bool PnaclComponentInstallerPolicy::SupportsGroupPolicyEnabledComponentUpdates()
const { … }
bool PnaclComponentInstallerPolicy::RequiresNetworkEncryption() const { … }
update_client::CrxInstaller::Result
PnaclComponentInstallerPolicy::OnCustomInstall(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) { … }
void PnaclComponentInstallerPolicy::OnCustomUninstall() { … }
bool PnaclComponentInstallerPolicy::VerifyInstallation(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const { … }
void PnaclComponentInstallerPolicy::ComponentReady(
const base::Version& version,
const base::FilePath& install_dir,
base::Value::Dict manifest) { … }
base::FilePath PnaclComponentInstallerPolicy::GetRelativeInstallDir() const { … }
void PnaclComponentInstallerPolicy::GetHash(std::vector<uint8_t>* hash) const { … }
std::string PnaclComponentInstallerPolicy::GetName() const { … }
update_client::InstallerAttributes
PnaclComponentInstallerPolicy::GetInstallerAttributes() const { … }
}
void RegisterPnaclComponent(ComponentUpdateService* cus) { … }
void DeletePnaclComponent(const base::FilePath& user_data_dir) { … }
}
namespace pnacl {
bool NeedsOnDemandUpdate() { … }
}