| Index: remoting/host/host_session_options.cc
|
| diff --git a/remoting/host/host_session_options.cc b/remoting/host/host_session_options.cc
|
| index 8511f278ceddc6d297a55a4378d16ee19bf00edf..b97018ddc2bb4e1592548f488abcd233dca7ca43 100644
|
| --- a/remoting/host/host_session_options.cc
|
| +++ b/remoting/host/host_session_options.cc
|
| @@ -7,6 +7,7 @@
|
| #include <vector>
|
|
|
| #include "base/logging.h"
|
| +#include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
|
|
| @@ -54,6 +55,25 @@ base::Optional<std::string> HostSessionOptions::Get(
|
| return it->second;
|
| }
|
|
|
| +base::Optional<bool> HostSessionOptions::GetBool(const std::string& key) const {
|
| + base::Optional<std::string> value = Get(key);
|
| + if (!value) {
|
| + return base::nullopt;
|
| + }
|
| + return base::ToLowerASCII(*value) == "true" ||
|
| + (*value) == "1" ||
|
| + (*value).empty();
|
| +}
|
| +
|
| +base::Optional<int> HostSessionOptions::GetInt(const std::string& key) const {
|
| + base::Optional<std::string> value = Get(key);
|
| + int result;
|
| + if (!value || !base::StringToInt(*value, &result)) {
|
| + return base::nullopt;
|
| + }
|
| + return result;
|
| +}
|
| +
|
| std::string HostSessionOptions::Export() const {
|
| std::string result;
|
| for (const auto& pair : options_) {
|
|
|