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 "chrome/installer/util/registry_key_backup.h" | 5 #include "chrome/installer/util/registry_key_backup.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/win/registry.h" | 12 #include "base/win/registry.h" |
13 | 13 |
14 using base::win::RegKey; | 14 using base::win::RegKey; |
15 | 15 |
16 namespace { | 16 namespace { |
17 const REGSAM kKeyReadNoNotify = (KEY_READ) & ~(KEY_NOTIFY); | 17 const REGSAM kKeyReadNoNotify = (KEY_READ) & ~(KEY_NOTIFY); |
18 } // namespace | 18 } // namespace |
19 | 19 |
20 // A container for a registry key, its values, and its subkeys. | 20 // A container for a registry key, its values, and its subkeys. |
21 class RegistryKeyBackup::KeyData { | 21 class RegistryKeyBackup::KeyData { |
22 public: | 22 public: |
23 KeyData(); | 23 KeyData(); |
24 ~KeyData(); | 24 ~KeyData(); |
25 bool Initialize(const RegKey& key); | 25 bool Initialize(const RegKey& key); |
Yash
2011/10/03 02:17:37
Please add comments for these functions and other
grt (UTC plus 2)
2011/10/03 15:35:26
Done.
| |
26 bool WriteTo(RegKey* key) const; | 26 bool WriteTo(RegKey* key) const; |
27 | 27 |
28 private: | 28 private: |
29 class ValueData; | 29 class ValueData; |
30 | 30 |
31 scoped_array<ValueData> values_; | 31 scoped_array<ValueData> values_; |
32 scoped_array<std::wstring> subkey_names_; | 32 scoped_array<std::wstring> subkey_names_; |
33 scoped_array<KeyData> subkeys_; | 33 scoped_array<KeyData> subkeys_; |
34 DWORD num_values_; | 34 DWORD num_values_; |
35 DWORD num_subkeys_; | 35 DWORD num_subkeys_; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 } else { | 312 } else { |
313 success = key_data_->WriteTo(&dest_key); | 313 success = key_data_->WriteTo(&dest_key); |
314 LOG_IF(ERROR, !success) << "Failed to write key data."; | 314 LOG_IF(ERROR, !success) << "Failed to write key data."; |
315 } | 315 } |
316 } else { | 316 } else { |
317 success = true; | 317 success = true; |
318 } | 318 } |
319 | 319 |
320 return success; | 320 return success; |
321 } | 321 } |
322 | |
OLD | NEW |