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

Unified Diff: rlz/test/rlz_test_helpers.cc

Issue 369923004: rlz: Do not take the address of a temporary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/test/rlz_test_helpers.cc
diff --git a/rlz/test/rlz_test_helpers.cc b/rlz/test/rlz_test_helpers.cc
index d8b999f1f739cf9484a0c8f9dfdf0d416d780719..8571bdafd7b4c3ce3386201ce373d16d00de3678 100644
--- a/rlz/test/rlz_test_helpers.cc
+++ b/rlz/test/rlz_test_helpers.cc
@@ -81,9 +81,8 @@ void WriteRegistryTree(const RegistryKeyData& data, base::win::RegKey* dest) {
for (std::map<base::string16, RegistryKeyData>::const_iterator iter =
data.keys.begin();
iter != data.keys.end(); ++iter) {
- WriteRegistryTree(iter->second,
- &base::win::RegKey(dest->Handle(), iter->first.c_str(),
- KEY_ALL_ACCESS));
+ base::win::RegKey key(dest->Handle(), iter->first.c_str(), KEY_ALL_ACCESS);
+ WriteRegistryTree(iter->second, &key);
}
}
@@ -116,9 +115,9 @@ void InitializeRegistryOverridesForTesting(
override_manager->OverrideRegistry(HKEY_CURRENT_USER, L"rlz_temp_hkcu");
if (do_copy) {
- WriteRegistryTree(data, &base::win::RegKey(HKEY_LOCAL_MACHINE,
- kHKLMAccessProviders,
- KEY_ALL_ACCESS));
+ base::win::RegKey key(
+ HKEY_LOCAL_MACHINE, kHKLMAccessProviders, KEY_ALL_ACCESS);
+ WriteRegistryTree(data, &key);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698