Chromium Code Reviews| 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..ff599353af5c3d5b799f8cf2353face453ccff2b 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 |installation_date| storing/loading on POSIX. |
|
Ilya Sherman
2014/07/11 04:45:40
nit: Please update this comment.
gab
2014/07/11 20:33:40
Done.
|
| +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 |installation_date| storing/loading on POSIX. |
|
Ilya Sherman
2014/07/11 04:45:40
nit: Please update this comment.
gab
2014/07/11 20:33:40
Done.
|
| +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 |