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 #ifndef CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ |
6 #define CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | 6 #define CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ |
7 #pragma once | 7 #pragma once |
Yash
2011/10/03 02:17:37
Why do you use both the ifdef (required by the sty
grt (UTC plus 2)
2011/10/03 15:35:26
This is one of the quirks of the Chromium coding s
| |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "chrome/installer/util/registry_key_backup.h" | 13 #include "chrome/installer/util/registry_key_backup.h" |
14 #include "chrome/installer/util/work_item.h" | 14 #include "chrome/installer/util/work_item.h" |
15 | 15 |
16 // A WorkItem subclass that replaces the contents of one registry key with that | 16 // A WorkItem subclass that replaces the contents of one registry key with that |
17 // of another (i.e., the destination is erased prior to the copy). Be aware | 17 // of another (i.e., the destination is erased prior to the copy). Be aware |
18 // that in the event of rollback the destination key's values and subkeys are | 18 // that in the event of rollback the destination key's values and subkeys are |
19 // restored but the key and its subkeys take on their default security | 19 // restored but the key and its subkeys take on their default security |
20 // descriptors. | 20 // descriptors. |
21 class CopyRegKeyWorkItem : public WorkItem { | 21 class CopyRegKeyWorkItem : public WorkItem { |
22 public: | 22 public: |
23 virtual ~CopyRegKeyWorkItem(); | 23 virtual ~CopyRegKeyWorkItem(); |
24 virtual bool Do() OVERRIDE; | 24 virtual bool Do() OVERRIDE; |
Yash
2011/10/03 02:17:37
What's the OVERRIDE definition here for?
grt (UTC plus 2)
2011/10/03 15:35:26
It's a Chromium macro that expands to a compiler-s
| |
25 virtual void Rollback() OVERRIDE; | 25 virtual void Rollback() OVERRIDE; |
26 | 26 |
27 private: | 27 private: |
28 friend class WorkItem; | 28 friend class WorkItem; |
Yash
2011/10/03 02:17:37
Please comment on why WorkItem is a friend class.
grt (UTC plus 2)
2011/10/03 15:35:26
Done.
| |
29 | 29 |
30 // Neither |source_key_path| nor |dest_key_path| may be empty. | 30 // Neither |source_key_path| nor |dest_key_path| may be empty. |
31 CopyRegKeyWorkItem(HKEY predefined_key, | 31 CopyRegKeyWorkItem(HKEY predefined_key, |
32 const std::wstring& source_key_path, | 32 const std::wstring& source_key_path, |
33 const std::wstring& dest_key_path); | 33 const std::wstring& dest_key_path); |
34 | 34 |
35 // Root key in which we operate. The root key must be one of the predefined | 35 // Root key in which we operate. The root key must be one of the predefined |
36 // keys on Windows. | 36 // keys on Windows. |
37 HKEY predefined_root_; | 37 HKEY predefined_root_; |
38 | 38 |
39 // Path of the key to be copied. | 39 // Path of the key to be copied. |
40 std::wstring source_key_path_; | 40 std::wstring source_key_path_; |
41 | 41 |
42 // Path of the destination key. | 42 // Path of the destination key. |
43 std::wstring dest_key_path_; | 43 std::wstring dest_key_path_; |
44 | 44 |
45 // Backup of the destination key. | 45 // Backup of the destination key. |
46 RegistryKeyBackup backup_; | 46 RegistryKeyBackup backup_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(CopyRegKeyWorkItem); | 48 DISALLOW_COPY_AND_ASSIGN(CopyRegKeyWorkItem); |
49 }; | 49 }; |
50 | 50 |
51 #endif // CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | 51 #endif // CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ |
52 | |
OLD | NEW |