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

Unified Diff: chrome/install_static/install_util.cc

Issue 2797433002: Include Google Update integration details in crash keys and about:version. (Closed)
Patch Set: Created 3 years, 9 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/install_static/install_util.cc
diff --git a/chrome/install_static/install_util.cc b/chrome/install_static/install_util.cc
index 8125a511efeb4223fe2e020d978bc09cac3d6209..7ed58dc750143062bc6aba1d684568f5899d56c1 100644
--- a/chrome/install_static/install_util.cc
+++ b/chrome/install_static/install_util.cc
@@ -58,6 +58,7 @@ constexpr wchar_t kChromeChannelStableExplicit[] = L"stable";
// These constants are defined in the chrome/installer directory as well. We
// need to unify them.
constexpr wchar_t kRegValueAp[] = L"ap";
+constexpr wchar_t kRegValueName[] = L"name";
constexpr wchar_t kRegValueUsageStats[] = L"usagestats";
constexpr wchar_t kMetricsReportingEnabled[] = L"MetricsReportingEnabled";
@@ -250,9 +251,13 @@ std::vector<StringType> TokenizeStringT(
return tokens;
}
+// Returns Chrome's update channel name based on the contents of the "ap" value
+// found in Chrome's ClientState key. |update_ap|, if not null, is set to the
+// raw value read from the registry.
std::wstring ChannelFromAdditionalParameters(const InstallConstants& mode,
bool system_level,
- bool from_binaries) {
+ bool from_binaries,
+ std::wstring* update_ap) {
assert(kUseGoogleUpdateIntegration);
// InitChannelInfo in google_update_settings.cc only reports a failure when
// Chrome's ClientState key exists but that the "ap" value therein cannot be
@@ -265,6 +270,8 @@ std::wstring ChannelFromAdditionalParameters(const InstallConstants& mode,
? GetBinariesClientStateKeyPath().c_str()
: GetClientStateKeyPath(mode.app_guid).c_str(),
kRegValueAp, &value);
+ if (update_ap)
+ *update_ap = value;
static constexpr wchar_t kChromeChannelBetaPattern[] = L"1?1-*";
static constexpr wchar_t kChromeChannelBetaX64Pattern[] = L"*x64-beta*";
@@ -795,16 +802,28 @@ bool RecursiveDirectoryCreate(const std::wstring& full_path) {
// InstallDetails instance since it is used to bootstrap InstallDetails.
std::wstring DetermineChannel(const InstallConstants& mode,
bool system_level,
- bool from_binaries) {
+ bool from_binaries,
+ std::wstring* update_ap,
+ std::wstring* update_cohort_name) {
if (!kUseGoogleUpdateIntegration)
return std::wstring();
+ if (update_cohort_name) {
+ // Cache the cohort name.
+ std::wstring path(from_binaries ? GetBinariesClientStateKeyPath()
+ : GetClientStateKeyPath(mode.app_guid));
+ path.append(L"\\cohort");
+ nt::QueryRegValueSZ(system_level ? nt::HKLM : nt::HKCU, nt::WOW6432,
+ path.c_str(), kRegValueName, update_cohort_name);
+ }
+
switch (mode.channel_strategy) {
case ChannelStrategy::UNSUPPORTED:
assert(false);
break;
case ChannelStrategy::ADDITIONAL_PARAMETERS:
- return ChannelFromAdditionalParameters(mode, system_level, from_binaries);
+ return ChannelFromAdditionalParameters(mode, system_level, from_binaries,
+ update_ap);
case ChannelStrategy::FIXED:
return mode.default_channel_name;
}

Powered by Google App Engine
This is Rietveld 408576698