OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/child/font_warmup_win.h" | 5 #include "content/child/font_warmup_win.h" |
6 | 6 |
7 #include <dwrite.h> | 7 #include <dwrite.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 patched = g_iat_patch_start_service.Patch( | 408 patched = g_iat_patch_start_service.Patch( |
409 L"dwrite.dll", service_provider_dll, "StartServiceW", StartServiceWPatch); | 409 L"dwrite.dll", service_provider_dll, "StartServiceW", StartServiceWPatch); |
410 DCHECK(patched == 0); | 410 DCHECK(patched == 0); |
411 | 411 |
412 patched = g_iat_patch_nt_connect_port.Patch( | 412 patched = g_iat_patch_nt_connect_port.Patch( |
413 L"dwrite.dll", "ntdll.dll", "NtAlpcConnectPort", NtALpcConnectPortPatch); | 413 L"dwrite.dll", "ntdll.dll", "NtAlpcConnectPort", NtALpcConnectPortPatch); |
414 DCHECK(patched == 0); | 414 DCHECK(patched == 0); |
415 } | 415 } |
416 | 416 |
417 GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) { | 417 GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) { |
418 if (!g_warmup_fontmgr) | 418 if (!g_warmup_fontmgr) |
f(malita)
2017/01/09 15:25:34
What would it take to convert g_warmup_fontmgr to
bungeman-chromium
2017/01/09 19:15:28
We've tried this before and had to revert. See htt
| |
419 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(); | 419 g_warmup_fontmgr = SkFontMgr_New_DirectWrite().release(); |
420 DCHECK(g_warmup_fontmgr); | 420 DCHECK(g_warmup_fontmgr); |
421 return new GdiFontPatchDataImpl(path); | 421 return new GdiFontPatchDataImpl(path); |
422 } | 422 } |
423 | 423 |
424 size_t GetEmulatedGdiHandleCountForTesting() { | 424 size_t GetEmulatedGdiHandleCountForTesting() { |
425 return g_fake_gdi_object_factory.Get().GetObjectCount(); | 425 return g_fake_gdi_object_factory.Get().GetObjectCount(); |
426 } | 426 } |
427 | 427 |
428 void ResetEmulatedGdiHandlesForTesting() { | 428 void ResetEmulatedGdiHandlesForTesting() { |
429 g_fake_gdi_object_factory.Get().ResetObjectHandles(); | 429 g_fake_gdi_object_factory.Get().ResetObjectHandles(); |
430 } | 430 } |
431 | 431 |
432 void SetPreSandboxWarmupFontMgrForTesting(SkFontMgr* fontmgr) { | 432 void SetPreSandboxWarmupFontMgrForTesting(sk_sp<SkFontMgr> fontmgr) { |
433 g_warmup_fontmgr = fontmgr; | 433 SkSafeUnref(g_warmup_fontmgr); |
434 g_warmup_fontmgr = fontmgr.release(); | |
434 } | 435 } |
435 | 436 |
436 } // namespace content | 437 } // namespace content |
OLD | NEW |