Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: fpdfsdk/cpdfsdk_environment.h

Issue 2397473006: Remove ownership of CPDFSDK_Document from CPDFXFA_Document (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_document.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_environment.h
diff --git a/fpdfsdk/cpdfsdk_environment.h b/fpdfsdk/cpdfsdk_environment.h
index 9943d38c67d37e7f2cae78a0a53d6ab32d63f6ee..bed757c2ba5322acdefcce0f2a19c3691edbad6e 100644
--- a/fpdfsdk/cpdfsdk_environment.h
+++ b/fpdfsdk/cpdfsdk_environment.h
@@ -146,8 +146,7 @@ class CPDFSDK_Environment final {
void JS_docgotoPage(int nPageNum);
FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; }
- void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; }
- CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; }
+ CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc.get(); }
UnderlyingDocumentType* GetUnderlyingDocument() const {
return m_pUnderlyingDoc;
}
@@ -166,10 +165,7 @@ class CPDFSDK_Environment final {
std::unique_ptr<CPDFSDK_ActionHandler> m_pActionHandler;
std::unique_ptr<IJS_Runtime> 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;
+ std::unique_ptr<CPDFSDK_Document> m_pSDKDoc;
UnderlyingDocumentType* const m_pUnderlyingDoc;
std::unique_ptr<CFFL_InteractiveFormFiller> m_pFormFiller;
std::unique_ptr<CFX_SystemHandler> m_pSysHandler;
« no previous file with comments | « fpdfsdk/cpdfsdk_document.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698