| 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 #ifndef CONTENT_PUBLIC_COMMON_RENDER_FONT_WARMUP_WIN_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_RENDER_FONT_WARMUP_WIN_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_RENDER_FONT_WARMUP_WIN_H_ | 6 #define CONTENT_PUBLIC_COMMON_RENDER_FONT_WARMUP_WIN_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" |
| 8 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 9 | 10 |
| 10 class SkFontMgr; | 11 class SkFontMgr; |
| 11 class SkTypeface; | 12 class SkTypeface; |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 | 15 |
| 15 // Make necessary calls to cache the data for a given font, used before | 16 // Make necessary calls to cache the data for a given font, used before |
| 16 // sandbox lockdown. | 17 // sandbox lockdown. |
| 17 CONTENT_EXPORT void DoPreSandboxWarmupForTypeface(SkTypeface* typeface); | 18 CONTENT_EXPORT void DoPreSandboxWarmupForTypeface(SkTypeface* typeface); |
| 18 | 19 |
| 19 // Get the shared font manager used during pre-sandbox warmup for DirectWrite | 20 // Get the shared font manager used during pre-sandbox warmup for DirectWrite |
| 20 // fonts. | 21 // fonts. |
| 21 CONTENT_EXPORT SkFontMgr* GetPreSandboxWarmupFontMgr(); | 22 CONTENT_EXPORT SkFontMgr* GetPreSandboxWarmupFontMgr(); |
| 22 | 23 |
| 24 class GdiFontPatchData { |
| 25 public: |
| 26 virtual ~GdiFontPatchData() {} |
| 27 protected: |
| 28 GdiFontPatchData() {} |
| 29 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(GdiFontPatchData); |
| 31 }; |
| 32 |
| 33 // Hook a module's imported GDI font functions to reimplement font enumeration |
| 34 // and font data retrieval for DLLs which can't be easily modified. |
| 35 CONTENT_EXPORT GdiFontPatchData* |
| 36 PatchGdiFontEnumeration(const base::FilePath& path); |
| 37 |
| 38 // Sets the pre-sandbox warmup font manager directly. This should only be used |
| 39 // for testing the implementation. |
| 40 CONTENT_EXPORT void SetPreSandboxWarmupFontMgr(SkFontMgr* fontmgr); |
| 41 |
| 23 } // namespace content | 42 } // namespace content |
| 24 | 43 |
| 25 #endif // CONTENT_PUBLIC_COMMON_RENDER_FONT_WARMUP_WIN_H_ | 44 #endif // CONTENT_PUBLIC_COMMON_RENDER_FONT_WARMUP_WIN_H_ |
| OLD | NEW |