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

Unified Diff: gfx/window_impl.cc

Issue 5527004: Access singletons with a new GetInstance() method instead of Singleton<T>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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: gfx/window_impl.cc
diff --git a/gfx/window_impl.cc b/gfx/window_impl.cc
index 74e0e20ad6a5a731c4c101dd4c6baba750519ecf..95561ff0a1d29617366149132d8ca47adf6db6f5 100644
--- a/gfx/window_impl.cc
+++ b/gfx/window_impl.cc
@@ -42,6 +42,10 @@ struct ClassInfo {
class ClassRegistrar {
public:
+ static ClassRegistrar* GetInstance() {
+ return Singleton<ClassRegistrar>::get();
+ }
+
~ClassRegistrar() {
for (RegisteredClasses::iterator i = registered_classes_.begin();
i != registered_classes_.end(); ++i) {
@@ -198,7 +202,7 @@ LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd,
std::wstring WindowImpl::GetWindowClassName() {
ClassInfo class_info(initial_class_style());
std::wstring name;
- if (Singleton<ClassRegistrar>()->RetrieveClassName(class_info, &name))
+ if (ClassRegistrar::GetInstance()->RetrieveClassName(class_info, &name))
return name;
// No class found, need to register one.

Powered by Google App Engine
This is Rietveld 408576698