Chromium Code Reviews| Index: chrome/browser/chrome_elf_init_win.cc |
| diff --git a/chrome/browser/chrome_elf_init_win.cc b/chrome/browser/chrome_elf_init_win.cc |
| index 042f3d1a4063383134df0cf06f5f238598af6837..7da704c963433f6e3b33ac691264ee004e6d4a70 100644 |
| --- a/chrome/browser/chrome_elf_init_win.cc |
| +++ b/chrome/browser/chrome_elf_init_win.cc |
| @@ -12,6 +12,7 @@ |
| #include "chrome_elf/blacklist/blacklist.h" |
| #include "chrome_elf/chrome_elf_constants.h" |
| #include "chrome_elf/dll_hash/dll_hash.h" |
| +#include "components/variations/variations_associated_data.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "version.h" // NOLINT |
| @@ -87,6 +88,7 @@ void InitializeChromeElf() { |
| base::win::RegKey blacklist_registry_key(HKEY_CURRENT_USER); |
| blacklist_registry_key.DeleteKey(blacklist::kRegistryBeaconPath); |
| } else { |
| + AddFinchBlacklistToRegistry(); |
| BrowserBlacklistBeaconSetup(); |
| } |
| @@ -103,6 +105,29 @@ void InitializeChromeElf() { |
| base::TimeDelta::FromSeconds(kBlacklistReportingDelaySec)); |
| } |
| +void AddFinchBlacklistToRegistry() { |
| + std::map<std::string, std::string> params; |
| + if (chrome_variations::GetVariationParams(kBrowserBlacklistTrialName, |
| + ¶ms)) { |
| + base::win::RegKey finch_blacklist_registry_key( |
| + HKEY_CURRENT_USER, blacklist::kRegistryFinchListPath, KEY_SET_VALUE); |
| + |
| + // No point in trying to continue if the registry key isn't valid. |
| + if (!finch_blacklist_registry_key.Valid()) |
| + return; |
| + |
| + std::map<std::string, std::string>::iterator it = params.begin(); |
| + while (it != params.end()) { |
|
robertshield
2014/06/03 03:03:00
prefer for (; it != params.end(); ++it) { ... } fo
krstnmnlsn
2014/06/03 19:30:16
Done.
|
| + std::wstring name = base::UTF8ToWide(it->first); |
| + std::wstring val = base::UTF8ToWide(it->second); |
| + |
| + finch_blacklist_registry_key.WriteValue(name.c_str(), val.c_str()); |
| + |
| + ++it; |
| + } |
| + } |
| +} |
| + |
| void BrowserBlacklistBeaconSetup() { |
| base::win::RegKey blacklist_registry_key(HKEY_CURRENT_USER, |
| blacklist::kRegistryBeaconPath, |