#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/resources_integrity.h"
#include <array>
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
#endif
#include "base/files/file.h"
#include "base/functional/bind.h"
#include "base/memory/page_size.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "base/task/thread_pool.h"
#include "chrome/common/chrome_paths.h"
#include "crypto/secure_hash.h"
#include "ui/base/buildflags.h"
#if BUILDFLAG(IS_WIN)
#include "chrome/app/chrome_exe_main_win.h"
#else
#include "chrome/app/packed_resources_integrity.h"
#endif
namespace {
bool CheckResourceIntegrityInternal(
const base::FilePath& path,
const base::span<const uint8_t, crypto::kSHA256Length> expected_signature) { … }
void ReportPakIntegrity(const std::string& histogram_name, bool hash_matches) { … }
}
void CheckResourceIntegrity(
const base::FilePath& path,
const base::span<const uint8_t, crypto::kSHA256Length> expected_signature,
scoped_refptr<base::SequencedTaskRunner> task_runner,
base::OnceCallback<void(bool)> callback) { … }
void CheckPakFileIntegrity() { … }