Index: chrome/installer/util/install_util.cc |
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc |
index db710d47d9f85fb116098574e5d5bca6a9f4be7f..6c4112b6fbc6d23a7717efe1ab4256c69e9306f4 100644 |
--- a/chrome/installer/util/install_util.cc |
+++ b/chrome/installer/util/install_util.cc |
@@ -38,6 +38,13 @@ using installer::ProductState; |
namespace { |
+const wchar_t* kExperimentAppGuids[] = { |
+ L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}", |
grt (UTC plus 2)
2012/11/20 16:05:46
this is the binaries' app guid. what does it have
SteveT
2012/11/20 23:23:50
To be honest, I do not know why this is here. I ca
grt (UTC plus 2)
2012/11/21 20:14:18
sgtm
|
+ L"{8A69D345-D564-463C-AFF1-A69D9E530F96}", |
grt (UTC plus 2)
2012/11/20 16:05:46
this is Chrome's app guid.
SteveT
2012/11/20 23:23:50
Yes, and when I am done refactoring this code and
|
+}; |
+ |
+const wchar_t kExperimentLabels[] = L"experiment_labels"; |
+ |
const wchar_t kStageBinaryPatching[] = L"binary_patching"; |
const wchar_t kStageBuilding[] = L"building"; |
const wchar_t kStageConfiguringAutoLaunch[] = L"configuring_auto_launch"; |
@@ -523,6 +530,27 @@ string16 InstallUtil::GetCurrentDate() { |
return string16(date_str, len); |
} |
+// static |
+bool InstallUtil::SetOmahaExperimentLabel(const string16& experiment_label, |
grt (UTC plus 2)
2012/11/20 16:05:46
this should only exist and/or do anything useful f
SteveT
2012/11/20 23:23:50
Google Chrome and gcapi builds, from what I unders
grt (UTC plus 2)
2012/11/21 20:14:18
I think the contents of this should likely be ifde
SteveT
2012/11/21 23:19:26
Well we want this to run in the GCAPI DLL... is th
|
+ HKEY registry_hive) { |
+ int successful_writes = 0; |
+ for (int i = 0; i < arraysize(kExperimentAppGuids); ++i) { |
grt (UTC plus 2)
2012/11/20 16:05:46
int -> size_t (arraysize returns a size_t) here an
SteveT
2012/11/20 23:23:50
Done.
|
+ string16 experiment_path(google_update::kRegPathClientState); |
grt (UTC plus 2)
2012/11/20 16:05:46
move this instance out of the loop and just assign
SteveT
2012/11/20 23:23:50
Done.
|
+ experiment_path += L"\\"; |
+ experiment_path += kExperimentAppGuids[i]; |
+ |
+ RegKey client_state(registry_hive, experiment_path.c_str(), |
grt (UTC plus 2)
2012/11/20 16:05:46
this will create the key if it doesn't exist. is
SteveT
2012/11/20 23:23:50
Yes, I believe that is the case. In fact, this who
grt (UTC plus 2)
2012/11/21 20:14:18
Fortunately, this is not the case. If it were, thi
SteveT
2012/11/21 23:19:26
This is meant to be a dumb "write to (and over) th
SteveT
2012/11/21 23:19:26
Sorry, when I said clobbers the Key, I meant it cl
|
+ KEY_SET_VALUE); |
+ if (client_state.Valid() && |
grt (UTC plus 2)
2012/11/20 16:05:46
this check isn't needed
SteveT
2012/11/20 23:23:50
Done.
|
+ client_state.WriteValue(kExperimentLabels, |
+ experiment_label.c_str()) == ERROR_SUCCESS) { |
+ successful_writes++; |
grt (UTC plus 2)
2012/11/20 16:05:46
prefer preincrement
SteveT
2012/11/20 23:23:50
Done.
|
+ } |
+ } |
+ |
+ return (successful_writes == arraysize(kExperimentAppGuids)); |
+} |
+ |
// Open |path| with minimal access to obtain information about it, returning |
// true and populating |handle| on success. |
// static |