#include "chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.h"
#include <utility>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/process/process_handle.h"
#include "base/strings/stringprintf.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"
#include "mojo/public/cpp/bindings/remote.h"
namespace {
void PrepareFileToAnalyze(
base::FilePath file_path,
base::OnceCallback<void(SandboxedRarAnalyzer::WrappedFilePtr)>
success_callback,
base::OnceCallback<void(safe_browsing::ArchiveAnalysisResult reason)>
failure_callback) { … }
}
std::unique_ptr<SandboxedRarAnalyzer, base::OnTaskRunnerDeleter>
SandboxedRarAnalyzer::CreateAnalyzer(
const base::FilePath& rar_file_path,
base::optional_ref<const std::string> password,
ResultCallback callback,
mojo::PendingRemote<chrome::mojom::FileUtilService> service) { … }
SandboxedRarAnalyzer::SandboxedRarAnalyzer(
const base::FilePath& rar_file_path,
base::optional_ref<const std::string> password,
ResultCallback callback,
mojo::PendingRemote<chrome::mojom::FileUtilService> service)
: … { … }
void SandboxedRarAnalyzer::Start() { … }
SandboxedRarAnalyzer::~SandboxedRarAnalyzer() = default;
void SandboxedRarAnalyzer::AnalyzeFile(
SandboxedRarAnalyzer::WrappedFilePtr file) { … }
void SandboxedRarAnalyzer::AnalyzeFileDone(
const safe_browsing::ArchiveAnalyzerResults& results) { … }
void SandboxedRarAnalyzer::ReportFileFailure(
safe_browsing::ArchiveAnalysisResult reason) { … }
std::string SandboxedRarAnalyzer::DebugString() const { … }
std::ostream& operator<<(std::ostream& os,
const SandboxedRarAnalyzer& rar_analyzer) { … }
base::WeakPtr<SandboxedRarAnalyzer> SandboxedRarAnalyzer::GetWeakPtr() { … }