chromium/chrome/browser/component_updater/pnacl_component_installer.cc

// Copyright 2012 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/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 {

// Name of the Pnacl component specified in the manifest.
const char kPnaclManifestName[] =;

constexpr uint8_t kPnaclPublicKeySHA256[32] =;

// Sanitize characters from Pnacl Arch value so that they can be used
// in path names.  This should only be characters in the set: [a-z0-9_].
// Keep in sync with chrome/browser/nacl_host/nacl_file_host.
std::string SanitizeForPath(const std::string& input) {}

// If we don't have Pnacl installed, this is the version we claim.
const char kMinPnaclVersion[] =;

// Initially say that we do need OnDemand updates. If there is a version of
// PNaCl on disk, this will be updated by CheckVersionCompatiblity().
volatile base::subtle::Atomic32 needs_on_demand_update =;

void CheckVersionCompatiblity(const base::Version& current_version) {}

// PNaCl is packaged as a multi-CRX.  This returns the platform-specific
// subdirectory that is part of that multi-CRX.
base::FilePath GetPlatformDir(const base::FilePath& base_path) {}

// Tell the rest of the world where to find the platform-specific PNaCl files.
void OverrideDirPnaclComponent(const base::FilePath& base_path) {}

std::optional<base::Value::Dict> ReadJSONManifest(
    const base::FilePath& manifest_path) {}

// Read the PNaCl specific manifest.
std::optional<base::Value::Dict> ReadPnaclManifest(
    const base::FilePath& unpack_path) {}

// Check that the component's manifest is for PNaCl, and check the
// PNaCl manifest indicates this is the correct arch-specific package.
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 {}

}  // namespace

void RegisterPnaclComponent(ComponentUpdateService* cus) {}

void DeletePnaclComponent(const base::FilePath& user_data_dir) {}

}  // namespace component_updater

namespace pnacl {

bool NeedsOnDemandUpdate() {}

}  // namespace pnacl