summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fwltheme.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-04-25 18:49:21 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-25 18:49:21 +0000
commiteb3ec8f29846a5df67269a53ca94d1d740c84513 (patch)
tree4a3717eb9fa56ff3e0c2b529aa4696fefa14fe42 /xfa/fxfa/cxfa_fwltheme.h
parent2929d135d076fb6927a02ff94935d5efc45e7257 (diff)
downloadpdfium-eb3ec8f29846a5df67269a53ca94d1d740c84513.tar.xz
Allow failing to build CFXA_FWLTheme if unable to load fonts
The current implementation of this class potentially does a lot of work in the constructor. Specifically when getting a calendar font it might cause the whole font loading pipeline to run. This can fail if it is unable to load fonts. Breaking out the font loading part, so that the factory method can return nullptr if it fails. Additionally adding a guard for the case the font manager fails to load, which is the root cause of the crash in the bug. BUG=chromium:835608 Change-Id: I05b987aaad6f0814907066904331610a7fbb7f70 Reviewed-on: https://pdfium-review.googlesource.com/31330 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fwltheme.h')
-rw-r--r--xfa/fxfa/cxfa_fwltheme.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/xfa/fxfa/cxfa_fwltheme.h b/xfa/fxfa/cxfa_fwltheme.h
index bdab7cfdc5..b8f8ff68be 100644
--- a/xfa/fxfa/cxfa_fwltheme.h
+++ b/xfa/fxfa/cxfa_fwltheme.h
@@ -29,6 +29,8 @@ class CXFA_FWLTheme final : public IFWL_ThemeProvider {
explicit CXFA_FWLTheme(CXFA_FFApp* pApp);
~CXFA_FWLTheme() override;
+ bool LoadCalendarFont();
+
// IFWL_ThemeProvider:
void DrawBackground(CFWL_ThemeBackground* pParams) override;
void DrawText(CFWL_ThemeText* pParams) override;