OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/test_reg_util_win.h" | 5 #include "base/test/test_reg_util_win.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 RegistryOverrideManager::RegistryOverrideManager( | 92 RegistryOverrideManager::RegistryOverrideManager( |
93 const base::Time& timestamp, | 93 const base::Time& timestamp, |
94 const base::string16& test_key_root) | 94 const base::string16& test_key_root) |
95 : timestamp_(timestamp), test_key_root_(test_key_root) { | 95 : timestamp_(timestamp), test_key_root_(test_key_root) { |
96 DeleteStaleTestKeys(timestamp_, test_key_root_); | 96 DeleteStaleTestKeys(timestamp_, test_key_root_); |
97 } | 97 } |
98 | 98 |
99 RegistryOverrideManager::~RegistryOverrideManager() {} | 99 RegistryOverrideManager::~RegistryOverrideManager() {} |
100 | 100 |
101 void RegistryOverrideManager::OverrideRegistry(HKEY override) { | 101 void RegistryOverrideManager::OverrideRegistry(HKEY override) { |
| 102 OverrideRegistry(override, nullptr); |
| 103 } |
| 104 |
| 105 void RegistryOverrideManager::OverrideRegistry(HKEY override, |
| 106 base::string16* override_path) { |
102 base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); | 107 base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); |
103 overrides_.push_back( | 108 overrides_.push_back( |
104 base::WrapUnique(new ScopedRegistryKeyOverride(override, key_path))); | 109 base::WrapUnique(new ScopedRegistryKeyOverride(override, key_path))); |
| 110 if (override_path) |
| 111 override_path->assign(key_path); |
105 } | 112 } |
106 | 113 |
107 base::string16 GenerateTempKeyPath() { | 114 base::string16 GenerateTempKeyPath() { |
108 return GenerateTempKeyPath(base::string16(kTempTestKeyPath), | 115 return GenerateTempKeyPath(base::string16(kTempTestKeyPath), |
109 base::Time::Now()); | 116 base::Time::Now()); |
110 } | 117 } |
111 | 118 |
112 } // namespace registry_util | 119 } // namespace registry_util |
OLD | NEW |