From a939bfe3e102bfb28b4e8a5d951333d16badf80b Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 22 Sep 2016 13:18:45 -0700 Subject: Make creation of CPDFSDK_Document clearer Move the creation of the CPDFSDK_Document into FPDFDOC_InitFormFillEnvironment instead of hidden inside a Get method in CDPFXFA_Document. Review-Url: https://codereview.chromium.org/2353303004 --- fpdfsdk/include/cpdfsdk_environment.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fpdfsdk/include') diff --git a/fpdfsdk/include/cpdfsdk_environment.h b/fpdfsdk/include/cpdfsdk_environment.h index 61916e46ad..b694359320 100644 --- a/fpdfsdk/include/cpdfsdk_environment.h +++ b/fpdfsdk/include/cpdfsdk_environment.h @@ -166,6 +166,9 @@ class CPDFSDK_Environment final { std::unique_ptr m_pActionHandler; std::unique_ptr m_pJSRuntime; FPDF_FORMFILLINFO* const m_pInfo; + // Ownership of |m_pSDKDoc| depends on if this is XFA. If we're in XFA then + // the object is owned by the CPDFXFA_Document. In non-xfa then we own + // the pointer. CPDFSDK_Document* m_pSDKDoc; UnderlyingDocumentType* const m_pUnderlyingDoc; std::unique_ptr m_pFormFiller; -- cgit v1.2.3