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

Unified Diff: chrome/browser/google/google_update_settings_posix.cc

Issue 372473004: Retrieve client_id from GoogleUpdateSettings when its missing from Local State. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits:grt Created 6 years, 5 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/browser/google/google_update_settings_posix.cc
diff --git a/chrome/browser/google/google_update_settings_posix.cc b/chrome/browser/google/google_update_settings_posix.cc
index 99dc0cc8e2f54c78bf4b3268447d91367f9282ea..e6dad5efe6a502859af30257cdb3095b5b3946ce 100644
--- a/chrome/browser/google/google_update_settings_posix.cc
+++ b/chrome/browser/google/google_update_settings_posix.cc
@@ -67,24 +67,32 @@ bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
}
// static
-bool GoogleUpdateSettings::LoadMetricsClientId(std::string* metrics_id) {
+// TODO(gab): Implement storing/loading for all ClientInfo fields on POSIX.
+scoped_ptr<metrics::ClientInfo> GoogleUpdateSettings::LoadMetricsClientInfo() {
+ scoped_ptr<metrics::ClientInfo> client_info(new metrics::ClientInfo);
+
base::AutoLock lock(g_posix_client_id_lock.Get());
- *metrics_id = g_posix_client_id.Get();
- return true;
+ if (g_posix_client_id.Get().empty())
+ return scoped_ptr<metrics::ClientInfo>();
+ client_info->client_id = g_posix_client_id.Get();
+
+ return client_info.Pass();
}
// static
-bool GoogleUpdateSettings::StoreMetricsClientId(const std::string& client_id) {
+// TODO(gab): Implement storing/loading for all ClientInfo fields on POSIX.
+void GoogleUpdateSettings::StoreMetricsClientInfo(
+ const metrics::ClientInfo& client_info) {
// Make sure that user has consented to send crashes.
if (!GoogleUpdateSettings::GetCollectStatsConsent())
- return false;
+ return;
{
// Since user has consented, write the metrics id to the file.
base::AutoLock lock(g_posix_client_id_lock.Get());
- g_posix_client_id.Get() = client_id;
+ g_posix_client_id.Get() = client_info.client_id;
}
- return GoogleUpdateSettings::SetCollectStatsConsent(true);
+ GoogleUpdateSettings::SetCollectStatsConsent(true);
}
// GetLastRunTime and SetLastRunTime are not implemented for posix. Their
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/metrics/chrome_metrics_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698