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

Unified Diff: chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc

Issue 8609002: CrOs: Remove 16 exit time destructors and 11 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
Index: chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc b/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc
index bc7a963050225d43ded12c299def50fc77a05cd8..39980cceaac29858e061aa0e70063428265e0bf3 100644
--- a/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc
+++ b/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/i18n/rtl.h"
+#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/string_util.h"
@@ -120,7 +121,9 @@ static const char* kTimeZones[] = {
"Pacific/Tongatapu",
};
-static base::Lock timezone_bundle_lock;
+static base::LazyInstance<base::Lock,
+ base::LeakyLazyInstanceTraits<base::Lock> >
+ g_timezone_bundle_lock = LAZY_INSTANCE_INITIALIZER;
struct UResClose {
inline void operator() (UResourceBundle* b) const {
@@ -138,7 +141,7 @@ string16 GetExemplarCity(const icu::TimeZone& zone) {
UErrorCode status = U_ZERO_ERROR;
{
- base::AutoLock lock(timezone_bundle_lock);
+ base::AutoLock lock(g_timezone_bundle_lock.Get());
if (zone_bundle == NULL)
zone_bundle = ures_open(zone_bundle_name, uloc_getDefault(), &status);

Powered by Google App Engine
This is Rietveld 408576698