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

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

Issue 1976443005: Revert of Add best-effort/allow rollback flags on WorkItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_list_tests
Patch Set: Created 4 years, 7 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
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_DELETE_REG_VALUE_WORK_ITEM_H_ 5 #ifndef CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_
6 #define CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_ 6 #define CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "chrome/installer/util/work_item.h" 12 #include "chrome/installer/util/work_item.h"
13 13
14 // A WorkItem subclass that deletes a registry value with REG_SZ, REG_DWORD, or 14 // A WorkItem subclass that deletes a registry value with REG_SZ, REG_DWORD, or
15 // REG_QWORD type at the specified path. The value is only deleted if the target 15 // REG_QWORD type at the specified path. The value is only deleted if the target
16 // key exists. 16 // key exists.
17 class DeleteRegValueWorkItem : public WorkItem { 17 class DeleteRegValueWorkItem : public WorkItem {
18 public: 18 public:
19 ~DeleteRegValueWorkItem() override; 19 ~DeleteRegValueWorkItem() override;
20 20
21 bool Do() override;
22
23 void Rollback() override;
24
21 private: 25 private:
22 friend class WorkItem; 26 friend class WorkItem;
23 27
24 enum DeletionStatus { 28 enum DeletionStatus {
25 // The status before Do is called. 29 // The status before Do is called.
26 DELETE_VALUE, 30 DELETE_VALUE,
27 // One possible outcome after Do(). Value is deleted. 31 // One possible outcome after Do(). Value is deleted.
28 VALUE_DELETED, 32 VALUE_DELETED,
29 // One possible outcome after Do(). Value is not found. 33 // One possible outcome after Do(). Value is not found.
30 VALUE_NOT_FOUND, 34 VALUE_NOT_FOUND,
31 // The status after Do() and Rollback() is called. 35 // The status after Do() and Rollback() is called.
32 VALUE_ROLLED_BACK, 36 VALUE_ROLLED_BACK,
33 // Another possible outcome after Do() (when there is an error). 37 // Another possible outcome after Do() (when there is an error).
34 VALUE_UNCHANGED 38 VALUE_UNCHANGED
35 }; 39 };
36 40
37 DeleteRegValueWorkItem(HKEY predefined_root, 41 DeleteRegValueWorkItem(HKEY predefined_root,
38 const std::wstring& key_path, 42 const std::wstring& key_path,
39 REGSAM wow64_acccess, 43 REGSAM wow64_acccess,
40 const std::wstring& value_name); 44 const std::wstring& value_name);
41 45
42 // WorkItem:
43 bool DoImpl() override;
44 void RollbackImpl() override;
45
46 // Root key of the target key under which the value is set. The root key can 46 // Root key of the target key under which the value is set. The root key can
47 // only be one of the predefined keys on Windows. 47 // only be one of the predefined keys on Windows.
48 HKEY predefined_root_; 48 HKEY predefined_root_;
49 49
50 // Path of the target key under which the value is set. 50 // Path of the target key under which the value is set.
51 std::wstring key_path_; 51 std::wstring key_path_;
52 52
53 // Name of the value to be set. 53 // Name of the value to be set.
54 std::wstring value_name_; 54 std::wstring value_name_;
55 55
56 // Whether to force 32-bit or 64-bit view of the target key. 56 // Whether to force 32-bit or 64-bit view of the target key.
57 REGSAM wow64_access_; 57 REGSAM wow64_access_;
58 58
59 DeletionStatus status_; 59 DeletionStatus status_;
60 60
61 // Previous value. 61 // Previous value.
62 DWORD previous_type_; 62 DWORD previous_type_;
63 std::string previous_value_; 63 std::string previous_value_;
64 }; 64 };
65 65
66 #endif // CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_ 66 #endif // CHROME_INSTALLER_UTIL_DELETE_REG_VALUE_WORK_ITEM_H_
OLDNEW
« no previous file with comments | « chrome/installer/util/delete_reg_key_work_item.cc ('k') | chrome/installer/util/delete_reg_value_work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698