blob: 85cf5d74dbc0d1af6f8bfe5dd4bfdce3481931e7 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2021 The Chromium Authors
Alexey Baskakov9087edc2021-11-19 03:48:062// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_INTERNALS_UTILS_H_
6#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_INTERNALS_UTILS_H_
7
Helmut Januschka59aa25e2024-03-18 15:57:378#include <string_view>
9
Avi Drissman9269d4ed2023-01-07 01:38:0610#include "base/functional/callback_forward.h"
Alexey Baskakov9087edc2021-11-19 03:48:0611#include "chrome/browser/web_applications/web_app_constants.h"
12
13namespace base {
14class FilePath;
15class Value;
16} // namespace base
17
18namespace web_app {
19
20using ReadErrorLogCallback =
21 base::OnceCallback<void(Result, base::Value error_log)>;
22
23void ReadErrorLog(const base::FilePath& web_apps_directory,
Helmut Januschka59aa25e2024-03-18 15:57:3724 std::string_view subsystem_name,
Alexey Baskakov9087edc2021-11-19 03:48:0625 ReadErrorLogCallback callback);
26
27using FileIoCallback = base::OnceCallback<void(Result)>;
28
29void WriteErrorLog(const base::FilePath& web_apps_directory,
Helmut Januschka59aa25e2024-03-18 15:57:3730 std::string_view subsystem_name,
Alexey Baskakov9087edc2021-11-19 03:48:0631 base::Value error_log,
32 FileIoCallback callback);
33
34void ClearErrorLog(const base::FilePath& web_apps_directory,
Helmut Januschka59aa25e2024-03-18 15:57:3735 std::string_view subsystem_name,
Alexey Baskakov9087edc2021-11-19 03:48:0636 FileIoCallback callback);
37
38} // namespace web_app
39
40#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_INTERNALS_UTILS_H_