Attempt to fix a DirectWrite metrics retrieval browser crasher in Canary.
Attempt to fix a DirectWrite metrics retrieval browser crasher in Canary.

The crash occurs because the IDWriteFactory::GetSystemFontCollection method returns E_INVALIDARG. From some analysis of
the crash dumps it appears that the crashes are mostly coming from Windows 7 version 6.1.7600.* and dwrite version 6.1.7600.16972.
We tried the same version of dwrite locally in a VM where things work correctly though.

In any case the fix attempted here is to check the return from the SkFontMgr_New_DirectWrite call. If we get back a NULL factory then
it probably means that the skia factory init failed. There is code in the SkFontMgr_New_DirectWrite function to get the system font collection.
If that call fails the function returns NULL. We should not attempt to use DW in that case.

The other change is to use a ScopedComPtr for the IDWriteFactory interface in the MaybeEnableDirectWriteFontRendering function.

Will see how this plays in tomorrows canary.

BUG=436146

Review URL: https://codereview.chromium.org/744463004

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305566}

markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,Just-D/chromium-1,Jonekee/chromium.src,Chilledheart/chromium,dednal/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,markYoungH/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,jaruba/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,dushu1203/chromium.src,ltilve/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,dednal/chromium.src,dednal/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,Just-D/chromium-1,jaruba/chromium.src,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,ltilve/chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,ltilve/chromium,M4sse/chromium.src,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,hgl888/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,ltilve/chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk