chromium/chrome/browser/extensions/api/image_writer_private/tar_extractor.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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"

// TarExtractor extracts a .tar file. The actual .tar file extraction is
// performed in a utility process.

namespace extensions {
namespace image_writer {

namespace {
constexpr base::FilePath::CharType kExtractedBinFileName[] =);

// https://www.gnu.org/software/tar/manual/html_node/Standard.html
constexpr char kExpectedMagic[5] =;
constexpr int kMagicOffset =;

}  // namespace

bool TarExtractor::IsTarFile(const base::FilePath& image_path) {}

// static
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) {}

}  // namespace image_writer
}  // namespace extensions