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

Unified Diff: rlz/win/lib/rlz_lib_win.cc

Issue 63153009: Use RegistryOverrideManager properly in RLZ tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 7 years, 1 month 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 | « rlz/win/lib/rlz_lib.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rlz/win/lib/rlz_lib_win.cc
diff --git a/rlz/win/lib/rlz_lib_win.cc b/rlz/win/lib/rlz_lib_win.cc
index d8b1c1e9fee18c11cb3610fe68c701dde74b03e4..c7655609035de2f3a83fe0553fb345f1089159f9 100644
--- a/rlz/win/lib/rlz_lib_win.cc
+++ b/rlz/win/lib/rlz_lib_win.cc
@@ -5,7 +5,7 @@
// A library to manage RLZ information for access-points shared
// across different client applications.
-#include "rlz/win/lib/rlz_lib.h"
+#include "rlz/lib/rlz_lib.h"
#include <windows.h>
#include <aclapi.h>
@@ -13,42 +13,11 @@
#include "base/basictypes.h"
#include "base/win/registry.h"
-#include "base/win/windows_version.h"
#include "rlz/lib/assert.h"
#include "rlz/lib/rlz_value_store.h"
#include "rlz/win/lib/machine_deal.h"
#include "rlz/win/lib/rlz_value_store_registry.h"
-namespace {
-
-// Path to recursively copy into the replacemment hives. These are needed
-// to make sure certain win32 APIs continue to run correctly once the real
-// hives are replaced.
-const wchar_t* kHKLMAccessProviders =
- L"System\\CurrentControlSet\\Control\\Lsa\\AccessProviders";
-
-// Helper functions
-
-void CopyRegistryTree(const base::win::RegKey& src, base::win::RegKey* dest) {
- // First copy values.
- for (base::win::RegistryValueIterator i(src.Handle(), L"");
- i.Valid(); ++i) {
- dest->WriteValue(i.Name(), reinterpret_cast<const void*>(i.Value()),
- i.ValueSize(), i.Type());
- }
-
- // Next copy subkeys recursively.
- for (base::win::RegistryKeyIterator i(src.Handle(), L"");
- i.Valid(); ++i) {
- base::win::RegKey subkey(dest->Handle(), i.Name(), KEY_ALL_ACCESS);
- CopyRegistryTree(base::win::RegKey(src.Handle(), i.Name(), KEY_READ),
- &subkey);
- }
-}
-
-} // namespace anonymous
-
-
namespace rlz_lib {
// OEM Deal confirmation storage functions.
@@ -237,24 +206,4 @@ bool SetMachineDealCodeFromPingResponse(const char* response) {
return MachineDealCode::SetFromPingResponse(response);
}
-void InitializeTempHivesForTesting(const base::win::RegKey& temp_hklm_key,
- const base::win::RegKey& temp_hkcu_key) {
- // For the moment, the HKCU hive requires no initialization.
-
- if (base::win::GetVersion() >= base::win::VERSION_WIN7) {
- // Copy the following HKLM subtrees to the temporary location so that the
- // win32 APIs used by the tests continue to work:
- //
- // HKLM\System\CurrentControlSet\Control\Lsa\AccessProviders
- //
- // This seems to be required since Win7.
- base::win::RegKey dest(temp_hklm_key.Handle(), kHKLMAccessProviders,
- KEY_ALL_ACCESS);
- CopyRegistryTree(base::win::RegKey(HKEY_LOCAL_MACHINE,
- kHKLMAccessProviders,
- KEY_READ),
- &dest);
- }
-}
-
} // namespace rlz_lib
« no previous file with comments | « rlz/win/lib/rlz_lib.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698