summaryrefslogtreecommitdiff
path: root/chromium/base/fuchsia/system_info.h
blob: 0a44fac3157aedb497486b36c3376e2140827ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FUCHSIA_SYSTEM_INFO_H_
#define BASE_FUCHSIA_SYSTEM_INFO_H_

#include "base/base_export.h"

namespace fuchsia::buildinfo {
class BuildInfo;
}
namespace fuchsia::hwinfo {
class ProductInfo;
}

namespace base {

// Makes a blocking call to fetch the info from the system and caches it
// before returning. Must be called in each process during the initialization
// phase.
// Returns whether the system info was successfully cached.
[[nodiscard]] BASE_EXPORT bool FetchAndCacheSystemInfo();

// Returns the cached build info.
BASE_EXPORT const fuchsia::buildinfo::BuildInfo& GetCachedBuildInfo();

// Synchronously fetches the system ProductInfo.
// Returns empty ProductInfo if the required service is unavailable or returns
// an error.
BASE_EXPORT fuchsia::hwinfo::ProductInfo GetProductInfo();

// Resets the cached system info to empty so that
// FetchAndCacheSystemInfo() can be called again in this process.
BASE_EXPORT void ClearCachedSystemInfoForTesting();

}  // namespace base

#endif  // BASE_FUCHSIA_SYSTEM_INFO_H_