Zijie He | 9bb4149 | 2017-07-30 21:14:49 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef REMOTING_HOST_EVALUATE_CAPABILITY_H_ |
| 6 | #define REMOTING_HOST_EVALUATE_CAPABILITY_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace remoting { |
| 11 | |
| 12 | // Evaluates the host capability in current process. This function should only |
| 13 | // be called in HostMain(), which consumes a --type=evaluate command line |
| 14 | // parameter. Note, this function may execute some experimental features and |
| 15 | // crash the process. |
| 16 | int EvaluateCapabilityLocally(const std::string& type); |
| 17 | |
| 18 | // Evaluates the host capability in a different process and returns its exit |
| 19 | // code. If |output| is provided, it will be set to the stdout of the process. |
| 20 | // If the process failed to be started, though usually this should not happen, |
| 21 | // it returns TERMINATION_STATUS_LAUNCH_FAILED. |
| 22 | // Note, this is a blocking call. Depending on the platform and system load, it |
| 23 | // may take a noticeable amount of time to complete. |
| 24 | int EvaluateCapability(const std::string& type, std::string* output = nullptr); |
| 25 | |
| 26 | } // namespace remoting |
| 27 | |
| 28 | #endif // REMOTING_HOST_EVALUATE_CAPABILITY_H_ |