| Index: chrome/common/origin_trials/origin_trial_key_manager.cc
|
| diff --git a/chrome/common/origin_trials/origin_trial_key_manager.cc b/chrome/common/origin_trials/origin_trial_key_manager.cc
|
| index 12467d29e0300b0297cfa816715ff086e5894c25..f21a3a16360bac90863717488189ee0ff0c3ac59 100644
|
| --- a/chrome/common/origin_trials/origin_trial_key_manager.cc
|
| +++ b/chrome/common/origin_trials/origin_trial_key_manager.cc
|
| @@ -6,7 +6,10 @@
|
|
|
| #include <stdint.h>
|
|
|
| +#include <vector>
|
| +
|
| #include "base/base64.h"
|
| +#include "base/strings/string_split.h"
|
|
|
| // This is the default public key used for validating signatures.
|
| // TODO(iclelland): Provide a mechanism to allow for multiple signing keys.
|
| @@ -38,3 +41,19 @@ bool OriginTrialKeyManager::SetPublicKeyFromASCIIString(
|
| base::StringPiece OriginTrialKeyManager::GetPublicKey() const {
|
| return base::StringPiece(public_key_);
|
| }
|
| +
|
| +bool OriginTrialKeyManager::SetDisabledFeatures(
|
| + const std::string& disabled_feature_list) {
|
| + std::set<std::string> new_disabled_features;
|
| + const std::vector<std::string> features =
|
| + base::SplitString(disabled_feature_list, "|", base::TRIM_WHITESPACE,
|
| + base::SPLIT_WANT_NONEMPTY);
|
| + for (const std::string& feature : features)
|
| + new_disabled_features.insert(feature);
|
| + disabled_features_.swap(new_disabled_features);
|
| + return true;
|
| +}
|
| +
|
| +bool OriginTrialKeyManager::IsFeatureDisabled(base::StringPiece feature) const {
|
| + return disabled_features_.count(feature.as_string()) > 0;
|
| +}
|
|
|