Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Unified Diff: chrome/browser/component_updater/origin_trials_component_installer.cc

Issue 1741783002: Add disabled origin trial feature list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ef-finch
Patch Set: Rebase; fix after crrev.com/cb60e703 landed Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/common/chrome_content_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/origin_trials_component_installer.cc
diff --git a/chrome/browser/component_updater/origin_trials_component_installer.cc b/chrome/browser/component_updater/origin_trials_component_installer.cc
index a32d62a3c4c6fd9e2429c1c01717a6ca488a476f..a76028fef948b1f370a32b23387b693a98b1e6ef 100644
--- a/chrome/browser/component_updater/origin_trials_component_installer.cc
+++ b/chrome/browser/component_updater/origin_trials_component_installer.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
+#include "base/strings/string_util.h"
#include "chrome/common/chrome_switches.h"
#include "components/component_updater/component_updater_paths.h"
@@ -23,7 +24,7 @@
// "revoked-tokens": "<base64-encoded data>"
// }
//
-// TODO(iclelland): Implement support for revoked tokens and disabled features.
+// TODO(iclelland): Implement support for revoked tokens.
//
// If the component is not present in the user data directory, the default
// configuration will be used.
@@ -72,6 +73,24 @@ void OriginTrialsComponentInstallerTraits::ComponentReady(
command_line->AppendSwitchASCII(switches::kOriginTrialPublicKey,
override_public_key);
}
+ base::ListValue* override_disabled_feature_list;
+ if (manifest->GetList("origin-trials.disabled-features",
+ &override_disabled_feature_list)) {
+ std::string disabled_feature;
+ std::vector<std::string> disabled_features;
+ for (const auto& item : *override_disabled_feature_list) {
+ if (item->GetAsString(&disabled_feature)) {
+ disabled_features.push_back(disabled_feature);
+ }
+ }
+ if (!disabled_features.empty()) {
+ std::string override_disabled_features =
+ base::JoinString(disabled_features, "|");
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures,
+ override_disabled_features);
waffles 2016/05/27 17:10:06 Hm, are you sure this will run in time? ComponentR
iclelland 2016/05/30 18:54:06 That's a good question -- It appears to be run in
iclelland 2016/05/31 14:50:13 So the StartupTaskRunner in BrowserMainLoop is blo
+ }
+ }
}
base::FilePath OriginTrialsComponentInstallerTraits::GetRelativeInstallDir()
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/common/chrome_content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698