Reland 61124 - Disk Cache: Add a quick return path for truncating an empty stream and make sure that Flush() doesn't fail when it has nothing to do.
Reland 61124 - Disk Cache: Add a quick return path for truncating an empty stream
and make sure that Flush() doesn't fail when it has nothing to do.

BUG=56872, 57395
TEST=none

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

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

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

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