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

Unified Diff: core/fpdfapi/fpdf_parser/include/cpdf_document.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 | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/include/cpdf_document.h
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
index 31988d8c9db6f012183ef852a12529ba1593be37..f3322425edc27f3b074850a66f74d8ce65ab6a76 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
@@ -40,10 +40,10 @@ class JBig2_DocumentContext;
class CPDF_Document : public CPDF_IndirectObjectHolder {
public:
- explicit CPDF_Document(CPDF_Parser* pParser);
+ explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser);
~CPDF_Document() override;
- CPDF_Parser* GetParser() const { return m_pParser; }
+ CPDF_Parser* GetParser() const { return m_pParser.get(); }
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
CPDF_Dictionary* GetInfo() const { return m_pInfoDict; }
@@ -128,7 +128,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting);
CPDF_Object* ParseIndirectObject(uint32_t objnum) override;
- CPDF_Parser* m_pParser;
+ std::unique_ptr<CPDF_Parser> m_pParser;
CPDF_Dictionary* m_pRootDict;
CPDF_Dictionary* m_pInfoDict;
CFX_ByteString m_ID1;
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698