Chromium Code Reviews| Index: core/fpdfapi/parser/cpdf_document_unittest.cpp |
| diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp |
| index 34661b18153e16bb648369dba6c623391a9cae87..32fdd9a8be28be959b10601fead617c0753931ca 100644 |
| --- a/core/fpdfapi/parser/cpdf_document_unittest.cpp |
| +++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp |
| @@ -10,6 +10,7 @@ |
| #include "core/fpdfapi/parser/cpdf_array.h" |
| #include "core/fpdfapi/parser/cpdf_dictionary.h" |
| #include "core/fpdfapi/parser/cpdf_parser.h" |
| +#include "core/fxcrt/fx_memory.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace { |
| @@ -68,11 +69,14 @@ class CPDF_TestDocumentForPages : public CPDF_Document { |
| allPages->AddReference(this, branch4->GetObjNum()); |
| CPDF_Dictionary* pagesDict = CreatePageTreeNode(allPages, this, 7); |
| - CPDF_Dictionary* root = new CPDF_Dictionary(); |
| - root->SetReferenceFor("Pages", this, AddIndirectObject(pagesDict)); |
| - m_pRootDict = root; |
| + rootDict.reset(new CPDF_Dictionary()); |
| + rootDict->SetReferenceFor("Pages", this, AddIndirectObject(pagesDict)); |
| + m_pRootDict = rootDict.get(); |
| m_PageList.SetSize(7); |
| } |
| + |
| + private: |
| + std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> rootDict; |
|
Tom Sepez
2016/10/24 16:09:52
nit: how about root_dict_ to go with the chromium
npm
2016/10/24 16:17:34
Done.
|
| }; |
| TEST(cpdf_document, GetPages) { |