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

Side by Side Diff: chrome/installer/util/registry_key_backup.h

Issue 1878313003: Convert //chrome/installer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert decompress.cc in mini_installer. Created 4 years, 8 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 | « chrome/installer/util/product.h ('k') | chrome/installer/util/registry_key_backup.cc » ('j') | no next file with comments »
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 #ifndef CHROME_INSTALLER_UTIL_REGISTRY_KEY_BACKUP_H_ 5 #ifndef CHROME_INSTALLER_UTIL_REGISTRY_KEY_BACKUP_H_
6 #define CHROME_INSTALLER_UTIL_REGISTRY_KEY_BACKUP_H_ 6 #define CHROME_INSTALLER_UTIL_REGISTRY_KEY_BACKUP_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <memory>
11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 13
13 // A container for a registry key, its values, and its subkeys. We don't use 14 // A container for a registry key, its values, and its subkeys. We don't use
14 // more obvious methods for various reasons: 15 // more obvious methods for various reasons:
15 // - RegCopyTree isn't supported pre-Vista, so we'd have to do something 16 // - RegCopyTree isn't supported pre-Vista, so we'd have to do something
16 // different for XP anyway. 17 // different for XP anyway.
17 // - SHCopyKey can't copy subkeys into a volatile destination, so we'd have to 18 // - SHCopyKey can't copy subkeys into a volatile destination, so we'd have to
18 // worry about polluting the registry. 19 // worry about polluting the registry.
19 // We don't persist security attributes since we only delete keys that we own, 20 // We don't persist security attributes since we only delete keys that we own,
20 // and we don't set custom attributes on them anyway. 21 // and we don't set custom attributes on them anyway.
21 class RegistryKeyBackup { 22 class RegistryKeyBackup {
(...skipping 12 matching lines...) Expand all
34 bool WriteTo(HKEY root, const wchar_t* key_path, REGSAM wow64_acccess) const; 35 bool WriteTo(HKEY root, const wchar_t* key_path, REGSAM wow64_acccess) const;
35 36
36 void swap(RegistryKeyBackup& other) { 37 void swap(RegistryKeyBackup& other) {
37 key_data_.swap(other.key_data_); 38 key_data_.swap(other.key_data_);
38 } 39 }
39 40
40 private: 41 private:
41 class KeyData; 42 class KeyData;
42 43
43 // The values and subkeys of the backed-up key. 44 // The values and subkeys of the backed-up key.
44 scoped_ptr<KeyData> key_data_; 45 std::unique_ptr<KeyData> key_data_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(RegistryKeyBackup); 47 DISALLOW_COPY_AND_ASSIGN(RegistryKeyBackup);
47 }; 48 };
48 49
49 #endif // CHROME_INSTALLER_UTIL_REGISTRY_KEY_BACKUP_H_ 50 #endif // CHROME_INSTALLER_UTIL_REGISTRY_KEY_BACKUP_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/product.h ('k') | chrome/installer/util/registry_key_backup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698