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

Unified Diff: fpdfsdk/fpdfdoc_unittest.cpp

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/fpdf_dataavail.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfdoc_unittest.cpp
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index 896c7d0c72f71165b0ab1dcf40dcb5938bc1093e..a555e961f3889f9378644cbf43b1b8fb5d3dfa2e 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -10,6 +10,7 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_name.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_number.h"
+#include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_string.h"
#include "core/fpdfapi/include/cpdf_modulemgr.h"
@@ -23,7 +24,7 @@
class CPDF_TestDocument : public CPDF_Document {
public:
- CPDF_TestDocument() : CPDF_Document(nullptr) {}
+ CPDF_TestDocument() : CPDF_Document(std::unique_ptr<CPDF_Parser>()) {}
void SetRoot(CPDF_Dictionary* root) { m_pRootDict = root; }
CPDF_IndirectObjectHolder* GetHolder() { return this; }
@@ -33,7 +34,8 @@ class CPDF_TestDocument : public CPDF_Document {
class CPDF_TestXFADocument : public CPDFXFA_Document {
public:
CPDF_TestXFADocument()
- : CPDFXFA_Document(new CPDF_TestDocument(), CPDFXFA_App::GetInstance()) {}
+ : CPDFXFA_Document(WrapUnique(new CPDF_TestDocument()),
+ CPDFXFA_App::GetInstance()) {}
void SetRoot(CPDF_Dictionary* root) {
reinterpret_cast<CPDF_TestDocument*>(GetPDFDoc())->SetRoot(root);
« no previous file with comments | « fpdfsdk/fpdf_dataavail.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698