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

Unified Diff: fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h

Issue 2275773003: Flip document and parser ownership (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@private_parser
Patch Set: Rebase to master Created 4 years, 4 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/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/pdfwindow/PWL_FontMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
index ed4c8727fce4495b7902ffd9cdbb1899f6b62a67..c83c770f97a8e9daa476e145cf8833bc9864a238 100644
--- a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
+++ b/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
@@ -27,12 +27,13 @@ class CXFA_FFDocHandler;
class CPDFXFA_Document : public IXFA_DocProvider {
public:
- CPDFXFA_Document(CPDF_Document* pPDFDoc, CPDFXFA_App* pProvider);
+ CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc,
+ CPDFXFA_App* pProvider);
~CPDFXFA_Document() override;
FX_BOOL LoadXFADoc();
CPDFXFA_App* GetApp() { return m_pApp; }
- CPDF_Document* GetPDFDoc() { return m_pPDFDoc; }
+ CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); }
CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); }
CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; }
@@ -200,7 +201,10 @@ class CPDFXFA_Document : public IXFA_DocProvider {
}
int m_iDocType;
- CPDF_Document* m_pPDFDoc;
+
+ // |m_pSDKDoc| has to be released before |m_pPDFDoc| since it needs to access
+ // it to kill focused annotations.
+ std::unique_ptr<CPDF_Document> m_pPDFDoc;
std::unique_ptr<CPDFSDK_Document> m_pSDKDoc;
std::unique_ptr<CXFA_FFDoc> m_pXFADoc;
CXFA_FFDocView* m_pXFADocView; // not owned.
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/pdfwindow/PWL_FontMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698