Only set MouseLockDispatcher unlocked_by_target_ after mouse lock confirmed.
Only set MouseLockDispatcher unlocked_by_target_ after mouse lock confirmed.

When a target application voluntarily unlocks the mouse we permit
relocking the mouse silently and with no user gesture requirement.
Check that the lock request is not currently pending and not yet
accepted by the browser process before setting |unlocked_by_target_|.

This corrects an ommision in https://chromiumcodereview.appspot.com/10443045/.

It is very difficult to test this possible failure, as the requests must be processed by the renderer process before the browser process can respond to the IPCs. An attempt was made to create this exploit, but was not able to produce the failure.

BUG=113460

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

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

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