Cleanup in ProcessSingleton.  These originated as candidate fixes for issue 111361, but the true fix is cpu@'s r119830.

a) Unify code to retrieve HMODULE based on address in base::GetModuleFromAddress.  (cpu@'s r119830 already has the fix to use the DLL's HMODULE 119830 rather than the EXE's HINSTANCE)

b) Try harder to unregister the window class, by trying it first in ProcessSingleton::Cleanup, which gets called before the fast shutdown path calls ExitProcess().  Also, use correct HMODULE to unregister.

c) Avoid any possibility of a race to create the message window when the Create() method is called from NotifyOtherProcessOrCreate() or from outside the class by moving the implementation of Create(), which was always called from the constructor, into the constructor and making Create() just return true or false based on the success of the work already done.

BUG=111361


Review URL: http://codereview.chromium.org/9121046

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121480 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed