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

Unified Diff: chrome/common/extensions/extension_l10n_util.cc

Issue 8468018: chrome: Remove 10 exit time destructors and 2 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: duh Created 9 years, 1 month 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/common/extensions/extension_file_util.cc ('k') | chrome/common/mac/objc_zombie.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_l10n_util.cc
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index b4e14b39954fdb39a64ec258297fdf216ad0a44d..634c1605e3ad2d7b1e28efe200620be3b7f14bf8 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -26,15 +26,15 @@
namespace errors = extension_manifest_errors;
namespace keys = extension_manifest_keys;
-static std::string* GetProcessLocale() {
- static std::string locale;
- return &locale;
+static std::string& GetProcessLocale() {
+ CR_DEFINE_STATIC_LOCAL(std::string, locale, ());
+ return locale;
}
namespace extension_l10n_util {
void SetProcessLocale(const std::string& locale) {
- *(GetProcessLocale()) = locale;
+ GetProcessLocale() = locale;
}
std::string GetDefaultLocaleFromManifest(const DictionaryValue& manifest,
@@ -183,7 +183,7 @@ bool AddLocale(const std::set<std::string>& chrome_locales,
}
std::string CurrentLocaleOrDefault() {
- std::string current_locale = l10n_util::NormalizeLocale(*GetProcessLocale());
+ std::string current_locale = l10n_util::NormalizeLocale(GetProcessLocale());
if (current_locale.empty())
current_locale = "en";
@@ -205,7 +205,7 @@ void GetAllLocales(std::set<std::string>* all_locales) {
bool GetValidLocales(const FilePath& locale_path,
std::set<std::string>* valid_locales,
std::string* error) {
- static std::set<std::string> chrome_locales;
+ std::set<std::string> chrome_locales;
GetAllLocales(&chrome_locales);
// Enumerate all supplied locales in the extension.
« no previous file with comments | « chrome/common/extensions/extension_file_util.cc ('k') | chrome/common/mac/objc_zombie.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698