From 9d1b0158bcf46195412d15b9d1be9d479caab740 Mon Sep 17 00:00:00 2001 From: "gab@chromium.org" Date: Wed, 9 Jul 2014 18:53:22 +0000 Subject: Refactor SetClientID such that metrics rather than crash backs up the client id in Google Update settings. Consequentially, the backed up client_id now keeps its dashes and crash_keys strips them at runtime rather than when backing it up (https://codereview.chromium.org/372473004/ will add support for stripped client_id backups for some time). Also rename a lot of methods involved in setting the client id; having all of them named "SetClientID" makes this series of calls very hard to follow! BUG=391338 TBR=thestig Review URL: https://codereview.chromium.org/365133005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282093 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/installer/util/google_update_settings.cc | 4 ++-- chrome/installer/util/google_update_settings.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'chrome/installer') diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 81e33ed..4d53eca 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -296,14 +296,14 @@ bool GoogleUpdateSettings::SetCollectStatsConsentAtLevel(bool system_install, return (result == ERROR_SUCCESS); } -bool GoogleUpdateSettings::GetMetricsId(std::string* metrics_id) { +bool GoogleUpdateSettings::LoadMetricsClientId(std::string* metrics_id) { base::string16 metrics_id16; bool rv = ReadGoogleUpdateStrKey(google_update::kRegMetricsId, &metrics_id16); *metrics_id = base::UTF16ToUTF8(metrics_id16); return rv; } -bool GoogleUpdateSettings::SetMetricsId(const std::string& metrics_id) { +bool GoogleUpdateSettings::StoreMetricsClientId(const std::string& metrics_id) { base::string16 metrics_id16 = base::UTF8ToUTF16(metrics_id); return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id16); } diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h index b7bf612..a8e43c4 100644 --- a/chrome/installer/util/google_update_settings.h +++ b/chrome/installer/util/google_update_settings.h @@ -86,12 +86,12 @@ class GoogleUpdateSettings { bool consented); #endif - // Returns the metrics id set in the registry (that can be used in crash - // reports). If none found, returns empty string. - static bool GetMetricsId(std::string* metrics_id); + // Returns the metrics client id backed up in the registry. If none found, + // returns empty string. + static bool LoadMetricsClientId(std::string* metrics_id); - // Sets the metrics id to be used in crash reports. - static bool SetMetricsId(const std::string& metrics_id); + // Stores a backup of the metrics client id in the registry. + static bool StoreMetricsClientId(const std::string& metrics_id); // Sets the machine-wide EULA consented flag required on OEM installs. // Returns false if the setting could not be recorded. -- cgit v1.1