SSL: don't ask for next proto if we got an error.
SSL: don't ask for next proto if we got an error.

GetNextProto only returns an error if the NSPR socket passed in is not a valid
SSL socket. However, this happens in tests (see the bug).

It appears that in some code paths the socket is invalid by the time that we
call HttpNetworkTransaction::DoSSLConnectComplete.

This also fixes the case where we would use SPDY if the server supports NPN,
but didn't actually advertise support for it.

BUG=31611

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

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