Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | |
| 6 #define CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "chrome/installer/util/work_item.h" | |
| 15 | |
| 16 class RegistryKeyBackup; | |
| 17 | |
| 18 // A WorkItem subclass that recursively copies a registry key. Be aware | |
| 19 // that in the event of rollback the key's values and subkeys are restored but | |
|
erikwright (departed)
2011/09/15 18:38:57
In the case of a rollback, why would the new key a
grt (UTC plus 2)
2011/09/16 17:45:45
Done.
| |
| 20 // the key and its subkeys take on their default security descriptors. | |
| 21 class CopyRegKeyWorkItem : public WorkItem { | |
| 22 public: | |
| 23 ~CopyRegKeyWorkItem(); | |
|
erikwright (departed)
2011/09/15 18:38:57
I think this destructor should explicitly be marke
grt (UTC plus 2)
2011/09/16 17:45:45
Done.
| |
| 24 virtual bool Do() OVERRIDE; | |
| 25 virtual void Rollback() OVERRIDE; | |
| 26 | |
| 27 private: | |
| 28 friend class WorkItem; | |
| 29 | |
| 30 CopyRegKeyWorkItem(HKEY predefined_key, | |
| 31 const std::wstring& source_key_path, | |
| 32 const std::wstring& dest_key_path); | |
| 33 | |
| 34 // Root key in which we operate. The root key must be one of the predefined | |
| 35 // keys on Windows. | |
| 36 HKEY predefined_root_; | |
| 37 | |
| 38 // Path of the key to be copied. | |
| 39 std::wstring source_key_path_; | |
| 40 | |
| 41 // Path of the destination key. | |
| 42 std::wstring dest_key_path_; | |
| 43 | |
| 44 // Backup of the destination key. | |
| 45 scoped_ptr<RegistryKeyBackup> backup_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(CopyRegKeyWorkItem); | |
| 48 }; | |
| 49 | |
| 50 #endif // CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_ | |
| OLD | NEW |