0

rlz: Do not take the address of a temporary.

Fixes this warning:
taking the address of a temporary object of type 'base::win::RegKey' [-Waddress-of-temporary]

(I think the code is fine in this case, but it's a useful warning and we
want to be able to build with -Werror.)

BUG=82385

Review URL: https://codereview.chromium.org/369923004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281349 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
thakis@chromium.org
2014-07-04 01:20:48 +00:00
parent b5e17c9de9
commit 683e6d9485

@ -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);
}
}