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

Unified Diff: ui/gfx/native_theme_win.cc

Issue 7778036: ui/gfx: Get rid of a few static variables from NativeTheme* type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::LazyInstance Created 9 years, 4 months 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 | « ui/gfx/native_theme_win.h ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/native_theme_win.cc
diff --git a/ui/gfx/native_theme_win.cc b/ui/gfx/native_theme_win.cc
index 23a5e5012491c4a1b3882eaccdef34c3c72b641b..8b4ea1d71442c38aaafe0566d4bbf71eafbe13ff 100644
--- a/ui/gfx/native_theme_win.cc
+++ b/ui/gfx/native_theme_win.cc
@@ -9,6 +9,7 @@
#include <vsstyle.h>
#include <vssym32.h>
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_handle.h"
#include "base/memory/scoped_ptr.h"
@@ -62,11 +63,12 @@ const NativeTheme* NativeTheme::instance() {
return NativeThemeWin::instance();
}
+static base::LazyInstance<NativeThemeWin> g_native_theme(
+ base::LINKER_INITIALIZED);
+
// static
const NativeThemeWin* NativeThemeWin::instance() {
- // The global NativeThemeWin instance.
- static const NativeThemeWin s_native_theme;
- return &s_native_theme;
+ return g_native_theme.Pointer();
}
NativeThemeWin::NativeThemeWin()
« no previous file with comments | « ui/gfx/native_theme_win.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698