diff options
author | gab <gab@chromium.org> | 2015-07-01 19:59:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-02 03:00:23 +0000 |
commit | 69821f190e784c132d598e07433165c934ee3087 (patch) | |
tree | 3c37fe06e317a9911d501847ad0a934509710af9 /chrome/installer/util/set_reg_value_work_item.h | |
parent | c967bfa4a80df291fbefdd8931b7f5fe9414bea7 (diff) | |
download | chromium_src-69821f190e784c132d598e07433165c934ee3087.zip chromium_src-69821f190e784c132d598e07433165c934ee3087.tar.gz chromium_src-69821f190e784c132d598e07433165c934ee3087.tar.bz2 |
Introduce a SetRegValueWorkItem overload that accepts a callback instead
of a fixed value.
The callback is used to determine the desired value after inspecting the
existing value.
Also modified the existing test's paradigm to bring it up to modern days
(from initial.commit!) and added some more tests to cover this new use case.
Bypassing the wstring usage presubmit warnings because we will likely want
to merge this, will consider fixing the API on trunk after.
BUG=488247, 502363
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1220473002
Cr-Commit-Position: refs/heads/master@{#337164}
Diffstat (limited to 'chrome/installer/util/set_reg_value_work_item.h')
-rw-r--r-- | chrome/installer/util/set_reg_value_work_item.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/installer/util/set_reg_value_work_item.h b/chrome/installer/util/set_reg_value_work_item.h index 0c4d0c8..6ccb377 100644 --- a/chrome/installer/util/set_reg_value_work_item.h +++ b/chrome/installer/util/set_reg_value_work_item.h @@ -10,6 +10,7 @@ #include <string> #include <vector> +#include "base/callback.h" #include "chrome/installer/util/work_item.h" // A WorkItem subclass that sets a registry value with REG_SZ, REG_DWORD, or @@ -63,6 +64,13 @@ class SetRegValueWorkItem : public WorkItem { int64 value_data, bool overwrite); + // Implies |overwrite_| and TYPE_SZ for now. + SetRegValueWorkItem(HKEY predefined_root, + const std::wstring& key_path, + REGSAM wow64_access, + const std::wstring& value_name, + const GetValueFromExistingCallback& get_value_callback); + // Root key of the target key under which the value is set. The root key can // only be one of the predefined keys on Windows. HKEY predefined_root_; @@ -73,6 +81,10 @@ class SetRegValueWorkItem : public WorkItem { // Name of the value to be set. std::wstring value_name_; + // If this is set, it will be used to get the desired value to be set based on + // the existing value in the registry. + const GetValueFromExistingCallback get_value_callback_; + // Whether to overwrite the existing value under the target key. bool overwrite_; |