#include "components/offline_pages/core/archive_validator.h"
#include <vector>
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "build/build_config.h"
#include "crypto/secure_hash.h"
#include "crypto/sha2.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/content_uri_utils.h"
#endif
namespace offline_pages {
ArchiveValidator::ArchiveValidator() { … }
ArchiveValidator::~ArchiveValidator() = default;
void ArchiveValidator::Update(const char* input, size_t len) { … }
std::string ArchiveValidator::Finish() { … }
std::string ArchiveValidator::ComputeDigest(const base::FilePath& file_path) { … }
std::pair<int64_t, std::string> ArchiveValidator::GetSizeAndComputeDigest(
const base::FilePath& file_path) { … }
bool ArchiveValidator::ValidateFile(const base::FilePath& file_path,
int64_t expected_file_size,
const std::string& expected_digest) { … }
}