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

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

Issue 1220473002: Introduce a SetRegValueWorkItem overload that accepts a callback instead (...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adopt grt's suggestion Created 5 years, 6 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
« no previous file with comments | « chrome/installer/util/set_reg_value_work_item_unittest.cc ('k') | chrome/installer/util/work_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/work_item.h
diff --git a/chrome/installer/util/work_item.h b/chrome/installer/util/work_item.h
index b19f5c2254e36674d90408504161b376b9c3fd26..a8c53769b9726ab77d1fa4d9f3b9da019efe6fc0 100644
--- a/chrome/installer/util/work_item.h
+++ b/chrome/installer/util/work_item.h
@@ -37,6 +37,12 @@ class FilePath;
// sequence of actions during install/update/uninstall.
class WorkItem {
public:
+ // A callback that returns the desired value based on the |existing_value|.
+ // |existing_value| will be empty if the value didn't previously exist or
+ // existed under a non-string type.
+ using GetValueFromExistingCallback =
+ base::Callback<std::wstring(const std::wstring& existing_value)>;
+
// All registry operations can be instructed to operate on a specific view
// of the registry by specifying a REGSAM value to the wow64_access parameter.
// The wow64_access parameter can be one of:
@@ -158,6 +164,16 @@ class WorkItem {
int64 value_data,
bool overwrite);
+ // Create a SetRegValueWorkItem that sets a registry value based on the value
+ // provided by |get_value_callback| given the existing value under
+ // |key_path\value_name|.
+ static SetRegValueWorkItem* CreateSetRegValueWorkItem(
+ HKEY predefined_root,
+ const std::wstring& key_path,
+ REGSAM wow64_access,
+ const std::wstring& value_name,
+ const GetValueFromExistingCallback& get_value_callback);
+
// Add a SelfRegWorkItem that registers or unregisters a DLL at the
// specified path.
static SelfRegWorkItem* CreateSelfRegWorkItem(const std::wstring& dll_path,
« no previous file with comments | « chrome/installer/util/set_reg_value_work_item_unittest.cc ('k') | chrome/installer/util/work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698