diff options
author | gab <gab@chromium.org> | 2014-09-17 19:37:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-18 02:38:22 +0000 |
commit | 6f7c83b276431b5473bd064e4eb315d60e17744f (patch) | |
tree | e8fa7d18ae547e29b8291645e436865a6855cdca | |
parent | f193baa17491771732a4b639db4917c2706ae7bb (diff) | |
download | chromium_src-6f7c83b276431b5473bd064e4eb315d60e17744f.zip chromium_src-6f7c83b276431b5473bd064e4eb315d60e17744f.tar.gz chromium_src-6f7c83b276431b5473bd064e4eb315d60e17744f.tar.bz2 |
Clean up unused param in RegistryOverrideManager
This param has been unused since http://crrev.com/234367 and makes the method confusing.
BUG=314800
Review URL: https://codereview.chromium.org/575253002
Cr-Commit-Position: refs/heads/master@{#295400}
19 files changed, 40 insertions, 49 deletions
diff --git a/base/test/test_reg_util_win.cc b/base/test/test_reg_util_win.cc index f354b17..2cbafef 100644 --- a/base/test/test_reg_util_win.cc +++ b/base/test/test_reg_util_win.cc @@ -92,9 +92,7 @@ RegistryOverrideManager::RegistryOverrideManager( RegistryOverrideManager::~RegistryOverrideManager() {} -void RegistryOverrideManager::OverrideRegistry( - HKEY override, - const base::string16& /*override_name*/) { +void RegistryOverrideManager::OverrideRegistry(HKEY override) { base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); overrides_.push_back(new ScopedRegistryKeyOverride(override, key_path)); } diff --git a/base/test/test_reg_util_win.h b/base/test/test_reg_util_win.h index 6ef6096..db71838 100644 --- a/base/test/test_reg_util_win.h +++ b/base/test/test_reg_util_win.h @@ -34,11 +34,10 @@ class RegistryOverrideManager { RegistryOverrideManager(); ~RegistryOverrideManager(); - // Override the given registry hive using a temporary key named by temp_name - // under the temporary test key path. There is no need to randomize - // |override_name|, as a random parent key is generated. Multiple overrides to - // the same hive are not supported and lead to undefined behavior. - void OverrideRegistry(HKEY override, const base::string16& override_name); + // Override the given registry hive using a randomly generated temporary key. + // Multiple overrides to the same hive are not supported and lead to undefined + // behavior. + void OverrideRegistry(HKEY override); private: friend class RegistryOverrideManagerTest; diff --git a/base/test/test_reg_util_win_unittest.cc b/base/test/test_reg_util_win_unittest.cc index 6f2e3fe..11abe5d 100644 --- a/base/test/test_reg_util_win_unittest.cc +++ b/base/test/test_reg_util_win_unittest.cc @@ -64,7 +64,7 @@ class RegistryOverrideManagerTest : public testing::Test { void CreateManager(const base::Time& timestamp) { manager_.reset(new RegistryOverrideManager(timestamp, fake_test_key_root_)); - manager_->OverrideRegistry(HKEY_CURRENT_USER, L"override_manager_unittest"); + manager_->OverrideRegistry(HKEY_CURRENT_USER); } base::string16 fake_test_key_root_; diff --git a/chrome/browser/chrome_elf_init_unittest_win.cc b/chrome/browser/chrome_elf_init_unittest_win.cc index 47e9e42..6f567e3 100644 --- a/chrome/browser/chrome_elf_init_unittest_win.cc +++ b/chrome/browser/chrome_elf_init_unittest_win.cc @@ -29,8 +29,7 @@ class ChromeBlacklistTrialTest : public testing::Test { virtual void SetUp() OVERRIDE { testing::Test::SetUp(); - override_manager_.OverrideRegistry(HKEY_CURRENT_USER, - L"browser_blacklist_test"); + override_manager_.OverrideRegistry(HKEY_CURRENT_USER); blacklist_registry_key_.reset( new base::win::RegKey(HKEY_CURRENT_USER, diff --git a/chrome/browser/extensions/api/messaging/native_messaging_test_util.cc b/chrome/browser/extensions/api/messaging/native_messaging_test_util.cc index 5e0ea49..f3658e1 100644 --- a/chrome/browser/extensions/api/messaging/native_messaging_test_util.cc +++ b/chrome/browser/extensions/api/messaging/native_messaging_test_util.cc @@ -75,7 +75,7 @@ void ScopedTestNativeMessagingHost::RegisterTestHost(bool user_level) { #if defined(OS_WIN) HKEY root_key = user_level ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; - registry_override_.OverrideRegistry(root_key, L"native_messaging"); + registry_override_.OverrideRegistry(root_key); #else path_override_.reset(new base::ScopedPathOverride( user_level ? chrome::DIR_USER_NATIVE_MESSAGING diff --git a/chrome/browser/media_galleries/media_galleries_test_util.cc b/chrome/browser/media_galleries/media_galleries_test_util.cc index 766c41a..1c4dc4a 100644 --- a/chrome/browser/media_galleries/media_galleries_test_util.cc +++ b/chrome/browser/media_galleries/media_galleries_test_util.cc @@ -198,7 +198,7 @@ void EnsureMediaDirectoriesExists::Init() { local_app_data_override_.reset(new base::ScopedPathOverride( base::DIR_LOCAL_APP_DATA, GetFakeLocalAppDataPath())); // Picasa also looks in the registry for an alternate path. - registry_override_.OverrideRegistry(HKEY_CURRENT_USER, L"hkcu_picasa"); + registry_override_.OverrideRegistry(HKEY_CURRENT_USER); #endif // OS_WIN #if defined(OS_MACOSX) diff --git a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc index f0560d3..ffe3cee 100644 --- a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc @@ -127,7 +127,7 @@ TEST(SafeBrowsingEnvironmentDataCollectionWinTest, CollectDllBlacklistData) { // Ensure that CollectDllBlacklistData correctly adds the set of sanitized dll // names currently stored in the registry to the report. registry_util::RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(HKEY_CURRENT_USER, L"safe_browsing_test"); + override_manager.OverrideRegistry(HKEY_CURRENT_USER); base::win::RegKey blacklist_registry_key(HKEY_CURRENT_USER, blacklist::kRegistryFinchListPath, diff --git a/chrome/installer/gcapi/gcapi_last_run_test.cc b/chrome/installer/gcapi/gcapi_last_run_test.cc index 9dbd706..85e7eed 100644 --- a/chrome/installer/gcapi/gcapi_last_run_test.cc +++ b/chrome/installer/gcapi/gcapi_last_run_test.cc @@ -26,9 +26,7 @@ class GCAPILastRunTest : public ::testing::Test { protected: void SetUp() { // Override keys - this is undone during destruction. - std::wstring hkcu_override = base::StringPrintf( - L"hkcu_override\\%ls", base::ASCIIToWide(base::GenerateGUID()).c_str()); - override_manager_.OverrideRegistry(HKEY_CURRENT_USER, hkcu_override); + override_manager_.OverrideRegistry(HKEY_CURRENT_USER); // Create the client state key in the right places. std::wstring reg_path(google_update::kRegPathClientState); diff --git a/chrome/installer/gcapi/gcapi_test_registry_overrider.cc b/chrome/installer/gcapi/gcapi_test_registry_overrider.cc index be678a2..8f2b05d 100644 --- a/chrome/installer/gcapi/gcapi_test_registry_overrider.cc +++ b/chrome/installer/gcapi/gcapi_test_registry_overrider.cc @@ -11,8 +11,8 @@ GCAPITestRegistryOverrider::GCAPITestRegistryOverrider() { // Override keys - this is undone during destruction. - override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"hkcu_override"); - override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE, L"hklm_override"); + override_manager_.OverrideRegistry(HKEY_CURRENT_USER); + override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE); } GCAPITestRegistryOverrider::~GCAPITestRegistryOverrider() { diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc index 345441b8..c999c61 100644 --- a/chrome/installer/setup/setup_util_unittest.cc +++ b/chrome/installer/setup/setup_util_unittest.cc @@ -408,8 +408,7 @@ namespace { class MigrateMultiToSingleTest : public testing::Test { protected: virtual void SetUp() OVERRIDE { - registry_override_manager_.OverrideRegistry(kRootKey, - L"MigrateMultiToSingleTest"); + registry_override_manager_.OverrideRegistry(kRootKey); } static const bool kSystemLevel = false; diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc index 51e896b..2069bf2 100644 --- a/chrome/installer/util/google_update_settings_unittest.cc +++ b/chrome/installer/util/google_update_settings_unittest.cc @@ -35,8 +35,8 @@ const wchar_t kTestExperimentLabel[] = L"test_label_value"; class GoogleUpdateSettingsTest : public testing::Test { protected: virtual void SetUp() OVERRIDE { - registry_overrides_.OverrideRegistry(HKEY_LOCAL_MACHINE, L"HKLM_pit"); - registry_overrides_.OverrideRegistry(HKEY_CURRENT_USER, L"HKCU_pit"); + registry_overrides_.OverrideRegistry(HKEY_LOCAL_MACHINE); + registry_overrides_.OverrideRegistry(HKEY_CURRENT_USER); } enum SystemUserInstall { @@ -1084,7 +1084,7 @@ void CollectStatsConsent::SetUp() { base::string16 reg_temp_name( stats_state.system_level() ? L"HKLM_" : L"HKCU_"); reg_temp_name += L"CollectStatsConsent"; - override_manager_.OverrideRegistry(root_key, reg_temp_name); + override_manager_.OverrideRegistry(root_key); if (stats_state.multi_install()) { MakeChromeMultiInstall(root_key); diff --git a/chrome/installer/util/install_util_unittest.cc b/chrome/installer/util/install_util_unittest.cc index e220090..241db4b 100644 --- a/chrome/installer/util/install_util_unittest.cc +++ b/chrome/installer/util/install_util_unittest.cc @@ -82,7 +82,7 @@ TEST_F(InstallUtilTest, UpdateInstallerStageAP) { // Update the stage when there's no "ap" value. { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); RegKey(root, state_key_path.c_str(), KEY_SET_VALUE); InstallUtil::UpdateInstallerStage(system_level, state_key_path, installer::BUILDING); @@ -96,7 +96,7 @@ TEST_F(InstallUtilTest, UpdateInstallerStageAP) { // Update the stage when there is an "ap" value. { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); RegKey(root, state_key_path.c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegApField, L"2.0-dev"); InstallUtil::UpdateInstallerStage(system_level, state_key_path, @@ -111,7 +111,7 @@ TEST_F(InstallUtilTest, UpdateInstallerStageAP) { // Clear the stage. { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); RegKey(root, state_key_path.c_str(), KEY_SET_VALUE) .WriteValue(google_update::kRegApField, L"2.0-dev-stage:building"); InstallUtil::UpdateInstallerStage(system_level, state_key_path, @@ -132,7 +132,7 @@ TEST_F(InstallUtilTest, UpdateInstallerStage) { // Update the stage when there's no "InstallerExtraCode1" value. { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); RegKey(root, state_key_path.c_str(), KEY_SET_VALUE) .DeleteValue(installer::kInstallerExtraCode1); InstallUtil::UpdateInstallerStage(system_level, state_key_path, @@ -147,7 +147,7 @@ TEST_F(InstallUtilTest, UpdateInstallerStage) { // Update the stage when there is an "InstallerExtraCode1" value. { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); RegKey(root, state_key_path.c_str(), KEY_SET_VALUE) .WriteValue(installer::kInstallerExtraCode1, static_cast<DWORD>(installer::UNPACKING)); @@ -163,7 +163,7 @@ TEST_F(InstallUtilTest, UpdateInstallerStage) { // Clear the stage. { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); RegKey(root, state_key_path.c_str(), KEY_SET_VALUE) .WriteValue(installer::kInstallerExtraCode1, static_cast<DWORD>(5)); InstallUtil::UpdateInstallerStage(system_level, state_key_path, @@ -185,7 +185,7 @@ TEST_F(InstallUtilTest, DeleteRegistryKeyIf) { { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_key"); + override_manager.OverrideRegistry(root); // Nothing to delete if the keys aren't even there. { MockRegistryValuePredicate pred; @@ -293,7 +293,7 @@ TEST_F(InstallUtilTest, DeleteRegistryValueIf) { { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_key"); + override_manager.OverrideRegistry(root); // Nothing to delete if the key isn't even there. { MockRegistryValuePredicate pred; @@ -357,7 +357,7 @@ TEST_F(InstallUtilTest, DeleteRegistryValueIf) { { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_key"); + override_manager.OverrideRegistry(root); // Default value matches: delete using empty string. { MockRegistryValuePredicate pred; @@ -378,7 +378,7 @@ TEST_F(InstallUtilTest, DeleteRegistryValueIf) { { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_key"); + override_manager.OverrideRegistry(root); // Default value matches: delete using NULL. { MockRegistryValuePredicate pred; diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index 1c8fd65..e0cf3bd 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -353,7 +353,7 @@ TEST_F(InstallerStateTest, WithProduct) { { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_pit"); + override_manager.OverrideRegistry(root); BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_BROWSER); RegKey chrome_key(root, dist->GetVersionKey().c_str(), KEY_ALL_ACCESS); @@ -385,7 +385,7 @@ TEST_F(InstallerStateTest, InstallerResult) { // check results for a fresh install of single Chrome { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); CommandLine cmd_line = CommandLine::FromString(L"setup.exe --system-level"); const MasterPreferences prefs(cmd_line); InstallationState machine_state; @@ -416,7 +416,7 @@ TEST_F(InstallerStateTest, InstallerResult) { // check results for a fresh install of multi Chrome { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_inst_res"); + override_manager.OverrideRegistry(root); CommandLine cmd_line = CommandLine::FromString( L"setup.exe --system-level --multi-install --chrome"); const MasterPreferences prefs(cmd_line); @@ -617,8 +617,8 @@ TEST_F(InstallerStateTest, InitializeTwice) { base::ScopedPathOverride local_app_data_override(base::DIR_LOCAL_APP_DATA, temp); registry_util::RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(HKEY_CURRENT_USER, base::string16()); - override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE, base::string16()); + override_manager.OverrideRegistry(HKEY_CURRENT_USER); + override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE); InstallationState machine_state; machine_state.Initialize(); diff --git a/chrome/installer/util/product_state_unittest.cc b/chrome/installer/util/product_state_unittest.cc index 42c4a99..64848e51 100644 --- a/chrome/installer/util/product_state_unittest.cc +++ b/chrome/installer/util/product_state_unittest.cc @@ -67,7 +67,7 @@ void ProductStateTest::SetUp() { // directly because it doesn't suit itself to our use here. RegKey temp_key; - registry_override_manager_.OverrideRegistry(overridden_, L"ProductStateTest"); + registry_override_manager_.OverrideRegistry(overridden_); EXPECT_EQ(ERROR_SUCCESS, clients_.Create(overridden_, dist_->GetVersionKey().c_str(), diff --git a/chrome/installer/util/product_unittest.cc b/chrome/installer/util/product_unittest.cc index ea69d6e..6c311d1 100644 --- a/chrome/installer/util/product_unittest.cc +++ b/chrome/installer/util/product_unittest.cc @@ -79,7 +79,7 @@ TEST_F(ProductTest, ProductInstallBasic) { HKEY root = installer_state.root_key(); { RegistryOverrideManager override_manager; - override_manager.OverrideRegistry(root, L"root_pit"); + override_manager.OverrideRegistry(root); // There should be no installed version in the registry. machine_state.Initialize(); diff --git a/chrome/installer/util/work_item_list_unittest.cc b/chrome/installer/util/work_item_list_unittest.cc index 5926ad7..9219789 100644 --- a/chrome/installer/util/work_item_list_unittest.cc +++ b/chrome/installer/util/work_item_list_unittest.cc @@ -29,7 +29,7 @@ class WorkItemListTest : public testing::Test { protected: virtual void SetUp() { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"root_pit"); + registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER); } virtual void TearDown() { diff --git a/chrome_elf/blacklist/test/blacklist_test.cc b/chrome_elf/blacklist/test/blacklist_test.cc index 22edf6e..ef715d3 100644 --- a/chrome_elf/blacklist/test/blacklist_test.cc +++ b/chrome_elf/blacklist/test/blacklist_test.cc @@ -47,7 +47,7 @@ namespace { class BlacklistTest : public testing::Test { protected: BlacklistTest() : override_manager_() { - override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"beacon_test"); + override_manager_.OverrideRegistry(HKEY_CURRENT_USER); } scoped_ptr<base::win::RegKey> blacklist_registry_key_; diff --git a/chrome_elf/chrome_elf_util_unittest.cc b/chrome_elf/chrome_elf_util_unittest.cc index 1cb6488..be8b683 100644 --- a/chrome_elf/chrome_elf_util_unittest.cc +++ b/chrome_elf/chrome_elf_util_unittest.cc @@ -58,10 +58,8 @@ class ChromeElfUtilTest : const char*> > { protected: virtual void SetUp() OVERRIDE { - override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE, - L"chrome_elf_test_local"); - override_manager_.OverrideRegistry(HKEY_CURRENT_USER, - L"chrome_elf_test_current"); + override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE); + override_manager_.OverrideRegistry(HKEY_CURRENT_USER); const char* app; const char* level; const char* mode; diff --git a/rlz/test/rlz_test_helpers.cc b/rlz/test/rlz_test_helpers.cc index 8571bda..53c9732 100644 --- a/rlz/test/rlz_test_helpers.cc +++ b/rlz/test/rlz_test_helpers.cc @@ -111,8 +111,8 @@ void InitializeRegistryOverridesForTesting( KEY_READ), &data); } - override_manager->OverrideRegistry(HKEY_LOCAL_MACHINE, L"rlz_temp_hklm"); - override_manager->OverrideRegistry(HKEY_CURRENT_USER, L"rlz_temp_hkcu"); + override_manager->OverrideRegistry(HKEY_LOCAL_MACHINE); + override_manager->OverrideRegistry(HKEY_CURRENT_USER); if (do_copy) { base::win::RegKey key( |