Fix a Chrome crash, which occurs in a ChromeFrame instance in the destructor of the WidgetWin object for the ExternalTabContainer. Basically the crash happens while dereferencing the chrome ui message loop which has been destroyed. This could happen in a ChromeFrame instance as the message loop is destroyed when the module ref count drops to 0. The ref count is decremented in the destructor of the AutomationProvider which runs before the Widgetwin destructor.
Fix a Chrome crash, which occurs in a ChromeFrame instance in the destructor of the WidgetWin object for
the ExternalTabContainer. Basically the crash happens while dereferencing the chrome ui message loop which
has been destroyed. This could happen in a ChromeFrame instance as the message loop is destroyed when the
module ref count drops to 0. The ref count is decremented in the destructor of the AutomationProvider which
runs before the Widgetwin destructor.

Fix is to move the code in the WidgetWin destructor to the code which processes WM_NCDESTROY

Fixes bug http://code.google.com/p/chromium/issues/detail?id=37163

Bug=37163


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

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@40393 0039d316-1c4b-4281-b951-d872f2087c98

ChromiumWebApps/chromium,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,robclark/chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,ltilve/chromium,markYoungH/chromium.src,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,dednal/chromium.src,hujiajie/pa-chromium,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,chuan9/chromium-crosswalk,ondra-novak/chromium.src,littlstar/chromium.src,krieger-od/nwjs_chromium.src,rogerwang/chromium,robclark/chromium,patrickm/chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,markYoungH/chromium.src,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,jaruba/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,zcbenz/cefode-chromium,zcbenz/cefode-chromium,rogerwang/chromium,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,Jonekee/chromium.src,M4sse/chromium.src,ltilve/chromium,Jonekee/chromium.src,Jonekee/chromium.src,ltilve/chromium,timopulkkinen/BubbleFish,markYoungH/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,keishi/chromium,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,rogerwang/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,robclark/chromium,hgl888/chromium-crosswalk,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,robclark/chromium,dednal/chromium.src,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,robclark/chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,zcbenz/cefode-chromium,robclark/chromium,bright-sparks/chromium-spacewalk,littlstar/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,robclark/chromium,fujunwei/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,robclark/chromium,Chilledheart/chromium,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,rogerwang/chromium,fujunwei/chromium-crosswalk,Jonekee/chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,fujunwei/chromium-crosswalk,ltilve/chromium,bright-sparks/chromium-spacewalk,patrickm/chromium.src,keishi/chromium,rogerwang/chromium,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,M4sse/chromium.src,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,dushu1203/chromium.src,hujiajie/pa-chromium,keishi/chromium,robclark/chromium,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,rogerwang/chromium,keishi/chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,robclark/chromium,rogerwang/chromium,TheTypoMaster/chromium-crosswalk,rogerwang/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,dednal/chromium.src,ondra-novak/chromium.src,keishi/chromium,nacl-webkit/chrome_deps,anirudhSK/chromium,zcbenz/cefode-chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,littlstar/chromium.src,Just-D/chromium-1,ltilve/chromium,littlstar/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,keishi/chromium,Pluto-tv/chromium-crosswalk,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,jaruba/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,keishi/chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,jaruba/chromium.src,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,dednal/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,patrickm/chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,anirudhSK/chromium,ltilve/chromium,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,anirudhSK/chromium,rogerwang/chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,nacl-webkit/chrome_deps,M4sse/chromium.src,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,hujiajie/pa-chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,Just-D/chromium-1,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,keishi/chromium,anirudhSK/chromium,ltilve/chromium,M4sse/chromium.src,zcbenz/cefode-chromium,ltilve/chromium,dushu1203/chromium.src,keishi/chromium,hujiajie/pa-chromium,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,hgl888/chromium-crosswalk,hujiajie/pa-chromium,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,anirudhSK/chromium,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk