| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // API exposed by cros_healthd's root-level executor. This is used by the |
| // sandboxed cros_healthd daemon when it needs to perform a high-privilege |
| // operation. |
| |
| module chromeos.cros_healthd_executor.mojom; |
| |
| // Provides the result of running a process. |
| struct ProcessResult { |
| // Return code received from the process (0=success). If this is non-zero then |
| // stdout and/or stderr may be empty. |
| int32 return_code; |
| // Contents of stdout from running the process. |
| string out; |
| // Contents of stderr from running the process. If this is non-empty it may |
| // indicate there is a problem, even if |return_code| is 0. |
| string err; |
| }; |
| |
| // Root-level executor interface exposed to the cros_healthd daemon. In |
| // production, this is implemented by the Executor daemon. |
| interface Executor { |
| // Obtains fan speed by running ectool and returns the result. |
| // |
| // The response: |
| // * |result| - contains information received from running the tool. |
| GetFanSpeed() => (ProcessResult result); |
| |
| // Runs memtester and returns the result. |
| // |
| // The response: |
| // * |result| - contains information received from running memtester. |
| RunMemtester() => (ProcessResult result); |
| }; |