blob: b6e9fa914882d5a1b78bf091a7055ab1a89c9afe [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
8#include "base/callback_forward.h"
9#include "base/strings/string_piece_forward.h"
10#include "chrome/browser/web_applications/web_app_constants.h"
11
12namespace base {
13class FilePath;
14class Value;
15} // namespace base
16
17namespace web_app {
18
19using ReadErrorLogCallback =
20 base::OnceCallback<void(Result, base::Value error_log)>;
21
22void ReadErrorLog(const base::FilePath& web_apps_directory,
23 base::StringPiece subsystem_name,
24 ReadErrorLogCallback callback);
25
26using FileIoCallback = base::OnceCallback<void(Result)>;
27
28void WriteErrorLog(const base::FilePath& web_apps_directory,
29 base::StringPiece subsystem_name,
30 base::Value error_log,
31 FileIoCallback callback);
32
33void ClearErrorLog(const base::FilePath& web_apps_directory,
34 base::StringPiece subsystem_name,
35 FileIoCallback callback);
36
37} // namespace web_app
38
39#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_INTERNALS_UTILS_H_