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

Unified Diff: chrome/installer/util/copy_reg_key_work_item.h

Issue 7890069: Added CopyRegKeyWorkItem in support of IE low rights policy fixes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Ready for review Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/copy_reg_key_work_item.h
diff --git a/chrome/installer/util/copy_reg_key_work_item.h b/chrome/installer/util/copy_reg_key_work_item.h
new file mode 100644
index 0000000000000000000000000000000000000000..4086598ee3fb89435f188e554c54d8fa55363075
--- /dev/null
+++ b/chrome/installer/util/copy_reg_key_work_item.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_
+#define CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/installer/util/work_item.h"
+
+class RegistryKeyBackup;
+
+// A WorkItem subclass that recursively copies a registry key. Be aware
+// 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.
+// the key and its subkeys take on their default security descriptors.
+class CopyRegKeyWorkItem : public WorkItem {
+ public:
+ ~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.
+ virtual bool Do() OVERRIDE;
+ virtual void Rollback() OVERRIDE;
+
+ private:
+ friend class WorkItem;
+
+ CopyRegKeyWorkItem(HKEY predefined_key,
+ const std::wstring& source_key_path,
+ const std::wstring& dest_key_path);
+
+ // Root key in which we operate. The root key must be one of the predefined
+ // keys on Windows.
+ HKEY predefined_root_;
+
+ // Path of the key to be copied.
+ std::wstring source_key_path_;
+
+ // Path of the destination key.
+ std::wstring dest_key_path_;
+
+ // Backup of the destination key.
+ scoped_ptr<RegistryKeyBackup> backup_;
+
+ DISALLOW_COPY_AND_ASSIGN(CopyRegKeyWorkItem);
+};
+
+#endif // CHROME_INSTALLER_UTIL_COPY_REG_KEY_WORK_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698