Ensure GpuVideoDecoder satisfies outstanding reads before firing callback indicating it is reset.
Ensure GpuVideoDecoder satisfies outstanding reads before firing callback indicating it is reset.

Previously GVD would post the fake frame to VideoRendererBase, but fire the
callback without waiting for VRB to process the frame.  Now the callback is
posted to the same loop so VRB is guaranteed to see the frame before
VRB::OnDecoderFlushDone() DCHECKs that !pending_read_.

TEST=closing a tab playing HW-accelerated video no longer DCHECKs in VRB::OnDecoderFlushDone.


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

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

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