#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/extensions/api/image_writer_private/tar_extractor.h"
#include <utility>
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "chrome/browser/extensions/api/image_writer_private/error_constants.h"
#include "chrome/browser/file_util_service.h"
namespace extensions {
namespace image_writer {
namespace {
constexpr base::FilePath::CharType kExtractedBinFileName[] = …);
constexpr char kExpectedMagic[5] = …;
constexpr int kMagicOffset = …;
}
bool TarExtractor::IsTarFile(const base::FilePath& image_path) { … }
void TarExtractor::Extract(ExtractionProperties properties) { … }
TarExtractor::TarExtractor(ExtractionProperties properties)
: … { … }
TarExtractor::~TarExtractor() = default;
void TarExtractor::OnProgress(uint64_t total_bytes, uint64_t progress_bytes) { … }
void TarExtractor::ExtractImpl() { … }
void TarExtractor::OnRemoteFinished(
chrome::file_util::mojom::ExtractionResult result) { … }
void TarExtractor::RunFailureCallbackAndDeleteThis(
const std::string& error_id) { … }
}
}