-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprobe_result_getter.h
40 lines (32 loc) · 1.32 KB
/
probe_result_getter.h
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
40
/* Copyright 2019 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef HARDWARE_VERIFIER_PROBE_RESULT_GETTER_H_
#define HARDWARE_VERIFIER_PROBE_RESULT_GETTER_H_
#include <base/files/file_path.h>
#include <base/optional.h>
#include <runtime_probe/proto_bindings/runtime_probe.pb.h>
namespace hardware_verifier {
// Interface that provides ways to retrieve |ProbeResult| messages.
class ProbeResultGetter {
public:
virtual ~ProbeResultGetter() = default;
// Gets the |ProbeResult| message by invoking |runtime_probe|.
//
// @return A |runtime_probe::ProbeResult| message if it succeeds.
virtual base::Optional<runtime_probe::ProbeResult> GetFromRuntimeProbe()
const = 0;
// Gets the |ProbeResult| message from the given file.
//
// The extension of the file name must be ".prototxt" and the format of the
// file content is expected to be protobuf text format.
//
// @param file_path: Path to the file thath contains the data.
//
// @return A |runtime_probe::ProbeResult| message if it succeeds.
virtual base::Optional<runtime_probe::ProbeResult> GetFromFile(
const base::FilePath& file_path) const = 0;
};
} // namespace hardware_verifier
#endif // HARDWARE_VERIFIER_PROBE_RESULT_GETTER_H_