Index: ui/base/win/window_impl.cc |
diff --git a/ui/base/win/window_impl.cc b/ui/base/win/window_impl.cc |
index dce0f2f7b6341723c1690a7ab69e9c02ef587830..580721a50f8e179c0c0bae87227835a2cbed98d0 100644 |
--- a/ui/base/win/window_impl.cc |
+++ b/ui/base/win/window_impl.cc |
@@ -45,17 +45,11 @@ struct ClassInfo { |
class ClassRegistrar { |
public: |
static ClassRegistrar* GetInstance() { |
- return Singleton<ClassRegistrar>::get(); |
+ return Singleton<ClassRegistrar, |
+ LeakySingletonTraits<ClassRegistrar> >::get(); |
} |
~ClassRegistrar() { |
- for (RegisteredClasses::iterator i = registered_classes_.begin(); |
- i != registered_classes_.end(); ++i) { |
- if (!UnregisterClass(MAKEINTATOM(i->atom), i->instance)) { |
- LOG(ERROR) << "Failed to unregister class " << i->name.c_str() |
- << ". Error = " << GetLastError(); |
- } |
- } |
} |
// Puts the name for the class matching |class_info| in |class_name|, creating |
@@ -76,24 +70,17 @@ class ClassRegistrar { |
} |
void RegisterClass(const ClassInfo& class_info, |
- const std::wstring& name, |
- ATOM atom, |
- HMODULE instance) { |
- registered_classes_.push_back( |
- RegisteredClass(class_info, name, atom, instance)); |
+ const std::wstring& name) { |
+ registered_classes_.push_back(RegisteredClass(class_info, name)); |
} |
private: |
// Represents a registered window class. |
struct RegisteredClass { |
RegisteredClass(const ClassInfo& info, |
- const std::wstring& name, |
- ATOM atom, |
- HMODULE instance) |
+ const std::wstring& name) |
: info(info), |
- name(name), |
- atom(atom), |
- instance(instance) { |
+ name(name) { |
} |
// Info used to create the class. |
@@ -101,12 +88,6 @@ class ClassRegistrar { |
// The name given to the window class. |
std::wstring name; |
- |
- // The ATOM returned from registering the window class. |
- ATOM atom; |
- |
- // The handle of the module containing the window procedure. |
- HMODULE instance; |
}; |
ClassRegistrar() : registered_count_(0) { } |
@@ -269,8 +250,7 @@ std::wstring WindowImpl::GetWindowClassName() { |
ATOM atom = RegisterClassEx(&window_class); |
CHECK(atom) << GetLastError(); |
- ClassRegistrar::GetInstance()->RegisterClass( |
- class_info, name, atom, instance); |
+ ClassRegistrar::GetInstance()->RegisterClass(class_info, name); |
return name; |
} |