#include "chrome/browser/web_applications/web_app_internals_utils.h"
#include <string_view>
#include "base/files/file_path.h"
#include "base/json/json_file_value_serializer.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "chrome/browser/web_applications/file_utils_wrapper.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "content/public/browser/browser_thread.h"
namespace web_app {
namespace {
struct ErrorLogData { … };
constexpr base::TaskTraits kTaskTraits = …;
base::FilePath GetErrorLogDirectory(const base::FilePath& web_apps_directory) { … }
base::FilePath GetErrorLogFileName(const base::FilePath& web_apps_directory,
std::string_view subsystem_name) { … }
ErrorLogData ReadErrorLogBlocking(scoped_refptr<FileUtilsWrapper> utils,
const base::FilePath& web_apps_directory,
std::string_view subsystem_name) { … }
void OnReadErrorLogBlocking(ReadErrorLogCallback callback, ErrorLogData data) { … }
Result WriteErrorLogBlocking(scoped_refptr<FileUtilsWrapper> utils,
const base::FilePath& web_apps_directory,
std::string_view subsystem_name,
base::Value error_log) { … }
Result ClearErrorLogBlocking(scoped_refptr<FileUtilsWrapper> utils,
const base::FilePath& web_apps_directory,
std::string_view subsystem_name) { … }
}
void ReadErrorLog(const base::FilePath& web_apps_directory,
std::string_view subsystem_name,
ReadErrorLogCallback callback) { … }
void WriteErrorLog(const base::FilePath& web_apps_directory,
std::string_view subsystem_name,
base::Value error_log,
FileIoCallback callback) { … }
void ClearErrorLog(const base::FilePath& web_apps_directory,
std::string_view subsystem_name,
FileIoCallback callback) { … }
}