summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_main_runner.cc
diff options
context:
space:
mode:
authorrlp <rlp@chromium.org>2014-11-24 18:29:22 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-25 02:29:44 +0000
commit164f18e2da53ac9da9c360749c7de859d5975089 (patch)
treefdf513d86de1fece38581ed35c725b978b53cca6 /content/browser/browser_main_runner.cc
parent962a1419cc1ed75c220a7e66cc69a8d7fcc33702 (diff)
downloadchromium_src-164f18e2da53ac9da9c360749c7de859d5975089.zip
chromium_src-164f18e2da53ac9da9c360749c7de859d5975089.tar.gz
chromium_src-164f18e2da53ac9da9c360749c7de859d5975089.tar.bz2
Revert of Attempt to fix a DirectWrite metrics retrieval browser crasher in Canary. (patchset #1 id:1 of https://codereview.chromium.org/744463004/)
Reason for revert: Causes a compile error on WebKit Win x64 Builder (dbg): FAILED: ninja -t msvc -e environment.x64 -- C:\b\build\goma/gomacc "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64\cl.exe" /nologo /showIncludes /FC @obj\content\browser\content.browser_main_runner.obj.rsp /c ..\..\content\browser\browser_main_runner.cc /Foobj\content\browser\content.browser_main_runner.obj /Fdobj\content\content.cc.pdb c:\b\build\slave\webkit-win-latest-dbg-x64\build\src\content\browser\browser_main_runner.cc(150) : error C2664: 'SkFontMgr *SkFontMgr_New_DirectWrite(IDWriteFactory *)' : cannot convert argument 1 from 'base::win::ScopedComPtr<IDWriteFactory,& _GUID_b859ee5a_d838_4b5b_a2e8_1adc7d93db48>' to 'IDWriteFactory *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called c:\b\build\slave\webkit-win-latest-dbg-x64\build\src\content\browser\browser_main_runner.cc(153) : error C2664: 'void gfx::PlatformFontWin::SetDirectWriteFactory(IDWriteFactory *)' : cannot convert argument 1 from 'base::win::ScopedComPtr<IDWriteFactory,& _GUID_b859ee5a_d838_4b5b_a2e8_1adc7d93db48>' to 'IDWriteFactory *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called ninja: build stopped: subcommand failed. Original issue's description: > 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 > > Committed: https://crrev.com/5f617d4e5cd396000457acd0c71c603aa45d6fd3 > Cr-Commit-Position: refs/heads/master@{#305566} TBR=cpu@chromium.org,ananta@chromium.org NOTREECHECKS=true NOTRY=true BUG=436146 Review URL: https://codereview.chromium.org/755063002 Cr-Commit-Position: refs/heads/master@{#305568}
Diffstat (limited to 'content/browser/browser_main_runner.cc')
-rw-r--r--content/browser/browser_main_runner.cc22
1 files changed, 6 insertions, 16 deletions
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index 07a0783..ab548c6 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -21,7 +21,6 @@
#if defined(OS_WIN)
#include <dwrite.h>
-#include "base/win/scoped_comptr.h"
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "net/cert/sha256_legacy_support_win.h"
@@ -135,23 +134,14 @@ void MaybeEnableDirectWriteFontRendering() {
// Not finding the DWriteCreateFactory function indicates a corrupt dll.
CHECK(dwrite_create_factory_proc);
- base::win::ScopedComPtr<IDWriteFactory> factory;
+ IDWriteFactory* factory = NULL;
CHECK(SUCCEEDED(
- dwrite_create_factory_proc(
- DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
- reinterpret_cast<IUnknown**>(factory.Receive()))));
- // The skia call to create a new DirectWrite font manager instance can fail
- // if we are unable to get the system font collection from the DirectWrite
- // factory. The GetSystemFontCollection method in the IDWriteFactory
- // interface fails with E_INVALIDARG on certain Windows 7 gold versions
- // (6.1.7600.*). We should just use GDI in these cases.
- SkFontMgr* direct_write_font_mgr = SkFontMgr_New_DirectWrite(factory);
- if (direct_write_font_mgr) {
- SetDefaultSkiaFactory(direct_write_font_mgr);
- gfx::PlatformFontWin::SetDirectWriteFactory(factory);
- }
+ dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED,
+ __uuidof(IDWriteFactory),
+ reinterpret_cast<IUnknown**>(&factory))));
+ SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory));
+ gfx::PlatformFontWin::SetDirectWriteFactory(factory);
}
}