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

Side by Side Diff: base/test/test_reg_util_win.cc

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/win/registry.h » ('j') | base/win/registry.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/guid.h" 7 #include "base/guid.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 10 matching lines...) Expand all
21 void DeleteStaleTestKeys(const base::Time& now, 21 void DeleteStaleTestKeys(const base::Time& now,
22 const base::string16& test_key_root) { 22 const base::string16& test_key_root) {
23 base::win::RegKey test_root_key; 23 base::win::RegKey test_root_key;
24 if (test_root_key.Open(HKEY_CURRENT_USER, 24 if (test_root_key.Open(HKEY_CURRENT_USER,
25 test_key_root.c_str(), 25 test_key_root.c_str(),
26 KEY_ALL_ACCESS) != ERROR_SUCCESS) { 26 KEY_ALL_ACCESS) != ERROR_SUCCESS) {
27 // This will occur on first-run, but is harmless. 27 // This will occur on first-run, but is harmless.
28 return; 28 return;
29 } 29 }
30 30
31 base::win::RegistryKeyIterator iterator_test_root_key(HKEY_CURRENT_USER, 31 base::win::RegistryKeyIterator iterator_test_root_key(
32 test_key_root.c_str()); 32 HKEY_CURRENT_USER, test_key_root.c_str(), 0);
33 for (; iterator_test_root_key.Valid(); ++iterator_test_root_key) { 33 for (; iterator_test_root_key.Valid(); ++iterator_test_root_key) {
34 base::string16 key_name = iterator_test_root_key.Name(); 34 base::string16 key_name = iterator_test_root_key.Name();
35 std::vector<base::string16> tokens; 35 std::vector<base::string16> tokens;
36 if (!Tokenize(key_name, base::string16(kTimestampDelimiter), &tokens)) 36 if (!Tokenize(key_name, base::string16(kTimestampDelimiter), &tokens))
37 continue; 37 continue;
38 int64 key_name_as_number = 0; 38 int64 key_name_as_number = 0;
39 39
40 if (!base::StringToInt64(tokens[0], &key_name_as_number)) { 40 if (!base::StringToInt64(tokens[0], &key_name_as_number)) {
41 test_root_key.DeleteKey(key_name.c_str()); 41 test_root_key.DeleteKey(key_name.c_str());
42 continue; 42 continue;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_); 96 base::string16 key_path = GenerateTempKeyPath(test_key_root_, timestamp_);
97 overrides_.push_back(new ScopedRegistryKeyOverride(override, key_path)); 97 overrides_.push_back(new ScopedRegistryKeyOverride(override, key_path));
98 } 98 }
99 99
100 base::string16 GenerateTempKeyPath() { 100 base::string16 GenerateTempKeyPath() {
101 return GenerateTempKeyPath(base::string16(kTempTestKeyPath), 101 return GenerateTempKeyPath(base::string16(kTempTestKeyPath),
102 base::Time::Now()); 102 base::Time::Now());
103 } 103 }
104 104
105 } // namespace registry_util 105 } // namespace registry_util
OLDNEW
« no previous file with comments | « no previous file | base/win/registry.h » ('j') | base/win/registry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698