Improve the performance of CRX installation
Improve the performance of CRX installation

When install a CRX entension, there is a step for moving the extracted
extension to a temp folder under the profile which will then be moved to
the final destination. The first move is implemented by a copy+delete
currently. The reason of this implementation is Move will attempt rename
instead of moving it into the destination folder as expected. For
example, Move("/a/b/c", "/1/2/3") (c and 3 are both folders here) if
directory named "3" doestn't exist, the move operation will
move all contents in c to "/1/2/3/" behaving as a rename operation
instead of moving c as a subfolder; if directory named "3" already
exists, the move operation will fallback to copy+delete as
implementation in file_util_win/posix.cc.

In this patch, if "/a/b/c" is being moved into "/1/2/3" as a
subfolder, Move("/a/b/c", "/1/2/3/c") will be called. Because move is
faster than copy+delete, it will speedup the CRX extension installation.
For the from_path and to_path are in different volume, Move will
fallback to CopyAndDeleteDirectory (in file_util_win.cc) or
CopyDirectory+Delete (in file_util_posix.cc).

BUG=
TESTS=

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

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

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