#include "components/update_client/op_puffin.h"
#include <optional>
#include <string>
#include <utility>
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/types/expected.h"
#include "base/values.h"
#include "components/update_client/configurator.h"
#include "components/update_client/crx_cache.h"
#include "components/update_client/patcher.h"
#include "components/update_client/task_traits.h"
#include "components/update_client/update_client_errors.h"
#include "third_party/puffin/src/include/puffin/puffpatch.h"
namespace update_client {
namespace {
void PatchDone(
base::OnceCallback<
void(const base::expected<base::FilePath, CategorizedError>&)> callback,
base::RepeatingCallback<void(base::Value::Dict)> event_adder,
const base::expected<base::FilePath, CategorizedError>& result) { … }
void CleanUp(
base::OnceCallback<
void(const base::expected<base::FilePath, CategorizedError>&)> callback,
const base::FilePath& patch_file,
const base::FilePath& new_file,
int result) { … }
void Patch(
scoped_refptr<Patcher> patcher,
const base::FilePath& old_file,
const base::FilePath& patch_file,
const base::FilePath& temp_dir,
base::OnceCallback<void(
const base::expected<base::FilePath, CategorizedError>&)> callback) { … }
void CacheLookupDone(
base::RepeatingCallback<void(base::Value::Dict)> event_adder,
scoped_refptr<Patcher> patcher,
const base::FilePath& patch_file,
const base::FilePath& temp_dir,
base::OnceCallback<
void(const base::expected<base::FilePath, CategorizedError>&)> callback,
const CrxCache::Result& cache_result) { … }
}
void PuffOperation(
std::optional<scoped_refptr<CrxCache>> crx_cache,
scoped_refptr<Patcher> patcher,
base::RepeatingCallback<void(base::Value::Dict)> event_adder,
const std::string& id,
const std::string& prev_fp,
const base::FilePath& patch_file,
const base::FilePath& temp_dir,
base::OnceCallback<void(
const base::expected<base::FilePath, CategorizedError>&)> callback) { … }
}