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

Side by Side Diff: ui/base/l10n/l10n_util_win.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/l10n/l10n_util_win.h" 5 #include "ui/base/l10n/l10n_util_win.h"
6 6
7 #include <windowsx.h> 7 #include <windowsx.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <iterator> 9 #include <iterator>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 OverrideLocaleHolder() {} 60 OverrideLocaleHolder() {}
61 const std::vector<std::string>& value() const { return value_; } 61 const std::vector<std::string>& value() const { return value_; }
62 void swap_value(std::vector<std::string>* override_value) { 62 void swap_value(std::vector<std::string>* override_value) {
63 value_.swap(*override_value); 63 value_.swap(*override_value);
64 } 64 }
65 private: 65 private:
66 std::vector<std::string> value_; 66 std::vector<std::string> value_;
67 DISALLOW_COPY_AND_ASSIGN(OverrideLocaleHolder); 67 DISALLOW_COPY_AND_ASSIGN(OverrideLocaleHolder);
68 }; 68 };
69 69
70 base::LazyInstance<OverrideLocaleHolder> 70 base::LazyInstance<OverrideLocaleHolder> override_locale_holder =
71 override_locale_holder(base::LINKER_INITIALIZED); 71 LAZY_INSTANCE_INITIALIZER;
72 72
73 } // namespace 73 } // namespace
74 74
75 namespace l10n_util { 75 namespace l10n_util {
76 76
77 int GetExtendedStyles() { 77 int GetExtendedStyles() {
78 return !base::i18n::IsRTL() ? 0 : WS_EX_LAYOUTRTL | WS_EX_RTLREADING; 78 return !base::i18n::IsRTL() ? 0 : WS_EX_LAYOUTRTL | WS_EX_RTLREADING;
79 } 79 }
80 80
81 int GetExtendedTooltipStyles() { 81 int GetExtendedTooltipStyles() {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } else { 176 } else {
177 NOTREACHED() << "Failed to determine the UI language for locale override."; 177 NOTREACHED() << "Failed to determine the UI language for locale override.";
178 } 178 }
179 } 179 }
180 180
181 const std::vector<std::string>& GetLocaleOverrides() { 181 const std::vector<std::string>& GetLocaleOverrides() {
182 return override_locale_holder.Get().value(); 182 return override_locale_holder.Get().value();
183 } 183 }
184 184
185 } // namespace l10n_util 185 } // namespace l10n_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698