Move the window destruction and registration out of cleanup and into BrowserProcessImpl::EndSession to make sure it happens after profiles are written out.

BUG=127607
TEST=Run on slow computer, open three or more profiles, exit from wrench menu, immediately open chrome again. There should be no reports of profile corruption and logs should show that profile writing is not occuring after second chrome starts.

Review URL: https://chromiumcodereview.appspot.com/10542151

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