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

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

Issue 6598065: Add rollback support to DeleteRegKeyWorkItem.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/delete_reg_key_work_item.h
===================================================================
--- chrome/installer/util/delete_reg_key_work_item.h (revision 76372)
+++ chrome/installer/util/delete_reg_key_work_item.h (working copy)
@@ -11,9 +11,14 @@
#include <string>
#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
#include "chrome/installer/util/work_item.h"
-// A WorkItem subclass that deletes a registry key at the given path.
+// A WorkItem subclass that deletes a registry key at the given path. Be aware
+// that if failures are not ignored, an in-memory backup is made of the key and
+// its values. In the event of rollback, the key's values and subkeys are
+// restored, but the key and its subkeys take on their default security
+// descriptors.
robertshield 2011/03/01 16:04:43 Could simplify the above comment to read: "Be awa
grt (UTC plus 2) 2011/03/01 20:54:02 Done.
class DeleteRegKeyWorkItem : public WorkItem {
public:
virtual ~DeleteRegKeyWorkItem();
@@ -23,6 +28,7 @@
virtual void Rollback();
private:
+ class RegKeyBackup;
friend class WorkItem;
DeleteRegKeyWorkItem(HKEY predefined_root, const std::wstring& path);
@@ -34,10 +40,9 @@
// Path of the key to be deleted.
std::wstring path_;
- // Path in the registry that the key is backed up to.
- std::wstring backup_path_;
+ // Backup of the deleted key.
+ scoped_ptr<RegKeyBackup> backup_;
- private:
DISALLOW_COPY_AND_ASSIGN(DeleteRegKeyWorkItem);
};

Powered by Google App Engine
This is Rietveld 408576698