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

Unified Diff: chrome/tools/disable_outdated_build_detector/google_update_integration.cc

Issue 2236843002: Do not rely on identical string constants having distinct pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/tools/disable_outdated_build_detector/google_update_integration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/disable_outdated_build_detector/google_update_integration.cc
diff --git a/chrome/tools/disable_outdated_build_detector/google_update_integration.cc b/chrome/tools/disable_outdated_build_detector/google_update_integration.cc
index 604f682dcfa9983b7fd21f18a09ac9bb797da9ce..19e08a3b5b1412ca9a04c2905aacf08680e15d02 100644
--- a/chrome/tools/disable_outdated_build_detector/google_update_integration.cc
+++ b/chrome/tools/disable_outdated_build_detector/google_update_integration.cc
@@ -9,13 +9,18 @@
#include "base/win/registry.h"
uint32_t OpenClientStateKey(bool system_level,
- const wchar_t* app_guid,
+ App app,
base::win::RegKey* key) {
#if defined(GOOGLE_CHROME_BUILD)
+ constexpr wchar_t kChromeAppGuid[] =
+ L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
+ constexpr wchar_t kBinariesAppGuid[] =
+ L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}";
base::string16 path(base::StringPrintf(
- L"Software\\Google\\Update\\ClientState\\%ls", app_guid));
+ L"Software\\Google\\Update\\ClientState\\%ls",
+ (app == App::CHROME_BINARIES ? kBinariesAppGuid : kChromeAppGuid)));
#else
- base::string16 path(app_guid == kBinariesAppGuid
+ base::string16 path(app == App::CHROME_BINARIES
? L"Software\\Chromium Binaries"
: L"Software\\Chromium");
#endif
@@ -26,7 +31,7 @@ uint32_t OpenClientStateKey(bool system_level,
void WriteResultInfo(bool system_level, const ResultInfo& result_info) {
base::win::RegKey key;
- uint32_t result = OpenClientStateKey(system_level, kChromeAppGuid, &key);
+ uint32_t result = OpenClientStateKey(system_level, App::CHROME_BROWSER, &key);
if (result != ERROR_SUCCESS)
return;
key.WriteValue(kInstallerResult,
« no previous file with comments | « chrome/tools/disable_outdated_build_detector/google_update_integration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698