Mirror Windows implementation of CancelOnMessageLoopThread.
Mirror Windows implementation of CancelOnMessageLoopThread.

Before this change, there was a code path where the FilePathWatcher could have been canceled but the delegate_ was not set to NULL. At exit, the destructor would then call Cancel() which would try to post a task to the message loop. With this change, the delegate is correctly set to NULL when the MessageLoop is destroyed even if the FilePathWatcher itself has been canceled. This allows Cancel() from the destructor to do the right thing and not call into the MessageLoop.

This implementation matches the Windows version which does not crash.

BUG=83190
TEST=FilePathWatcherTest.*


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

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

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