diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 18:37:40 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 18:37:40 +0000 |
commit | 02c3f683b160a23afe889ab195ed2dc196a098fe (patch) | |
tree | bbd8b0e40aa762682d756fbaa73b21045b07390a /chrome/browser/google | |
parent | 85d7bcf6ff662687704edd521f53b003c68ef9a2 (diff) | |
download | chromium_src-02c3f683b160a23afe889ab195ed2dc196a098fe.zip chromium_src-02c3f683b160a23afe889ab195ed2dc196a098fe.tar.gz chromium_src-02c3f683b160a23afe889ab195ed2dc196a098fe.tar.bz2 |
chrome: Remove 14 exit time destructors and 2 static initializers.
BUG=101600, 94925
TEST=none
TBR=mnissler
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110235
Review URL: http://codereview.chromium.org/8573021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google')
-rw-r--r-- | chrome/browser/google/google_update_settings_posix.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/google/google_update_settings_posix.cc b/chrome/browser/google/google_update_settings_posix.cc index 242407c..c47e0c7 100644 --- a/chrome/browser/google/google_update_settings_posix.cc +++ b/chrome/browser/google/google_update_settings_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,9 +10,14 @@ #include "chrome/common/chrome_paths.h" namespace google_update { -std::string posix_guid; + +static std::string& posix_guid() { + CR_DEFINE_STATIC_LOCAL(std::string, guid, ()); + return guid; } +} // namespace google_update + // File name used in the user data dir to indicate consent. static const char kConsentToSendStats[] = "Consent To Send Stats"; @@ -24,7 +29,7 @@ bool GoogleUpdateSettings::GetCollectStatsConsent() { std::string tmp_guid; bool consented = file_util::ReadFileToString(consent_file, &tmp_guid); if (consented) - google_update::posix_guid.assign(tmp_guid); + google_update::posix_guid().assign(tmp_guid); return consented; } @@ -39,13 +44,13 @@ bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) { if (consented) { if ((!file_util::PathExists(consent_file)) || (file_util::PathExists(consent_file) && - !google_update::posix_guid.empty())) { - const char* c_str = google_update::posix_guid.c_str(); - int size = google_update::posix_guid.size(); + !google_update::posix_guid().empty())) { + const char* c_str = google_update::posix_guid().c_str(); + int size = google_update::posix_guid().size(); return file_util::WriteFile(consent_file, c_str, size) == size; } } else { - google_update::posix_guid.clear(); + google_update::posix_guid().clear(); return file_util::Delete(consent_file, false); } return true; @@ -60,7 +65,7 @@ bool GoogleUpdateSettings::SetMetricsId(const std::wstring& client_id) { return false; // Since user has consented, write the metrics id to the file. - google_update::posix_guid = WideToASCII(client_id); + google_update::posix_guid() = WideToASCII(client_id); return GoogleUpdateSettings::SetCollectStatsConsent(true); } |