#include "chrome/services/file_util/public/cpp/sandboxed_seven_zip_analyzer.h"
#include <utility>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/task/thread_pool.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
namespace {
void PrepareFileToAnalyze(
base::FilePath file_path,
base::OnceCallback<void(SandboxedSevenZipAnalyzer::WrappedFilePtr)>
success_callback,
base::OnceCallback<void(safe_browsing::ArchiveAnalysisResult reason)>
failure_callback) { … }
}
std::unique_ptr<SandboxedSevenZipAnalyzer, base::OnTaskRunnerDeleter>
SandboxedSevenZipAnalyzer::CreateAnalyzer(
const base::FilePath& zip_file,
ResultCallback callback,
mojo::PendingRemote<chrome::mojom::FileUtilService> service) { … }
SandboxedSevenZipAnalyzer::SandboxedSevenZipAnalyzer(
const base::FilePath& zip_file,
ResultCallback callback,
mojo::PendingRemote<chrome::mojom::FileUtilService> service)
: … { … }
void SandboxedSevenZipAnalyzer::Start() { … }
SandboxedSevenZipAnalyzer::~SandboxedSevenZipAnalyzer() = default;
void SandboxedSevenZipAnalyzer::ReportFileFailure(
safe_browsing::ArchiveAnalysisResult reason) { … }
void SandboxedSevenZipAnalyzer::AnalyzeFile(
SandboxedSevenZipAnalyzer::WrappedFilePtr file) { … }
void SandboxedSevenZipAnalyzer::AnalyzeFileDone(
const safe_browsing::ArchiveAnalyzerResults& results) { … }
base::WeakPtr<SandboxedSevenZipAnalyzer>
SandboxedSevenZipAnalyzer::GetWeakPtr() { … }