diff options
author | tsepez <tsepez@chromium.org> | 2016-10-03 15:24:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-03 15:24:27 -0700 |
commit | 36eb4bdcae719cf33c536ff72ac000482aed8382 (patch) | |
tree | b3c3467fa10eafc3863a619ef511d1bf20af6367 /core/fpdfapi | |
parent | 76383db4906c9357292846ace77566b34eb47de9 (diff) | |
download | pdfium-36eb4bdcae719cf33c536ff72ac000482aed8382.tar.xz |
Add ptr_util.h from base until std::make_unique<> available
Review-Url: https://codereview.chromium.org/2386273004
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/fpdf_font/cpdf_font.cpp | 3 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_page/fpdf_page_parser.cpp | 3 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cfdf_document.cpp | 3 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_document.cpp | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp index 9b6fc5e824..96ebda740a 100644 --- a/core/fpdfapi/fpdf_font/cpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp @@ -24,6 +24,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" #include "core/fxcrt/fx_memory.h" #include "core/fxge/fx_freetype.h" +#include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" namespace { @@ -454,7 +455,7 @@ const FX_CHAR* CPDF_Font::GetAdobeCharName( uint32_t CPDF_Font::FallbackFontFromCharcode(uint32_t charcode) { if (m_FontFallbacks.empty()) { - m_FontFallbacks.push_back(WrapUnique(new CFX_Font())); + m_FontFallbacks.push_back(pdfium::MakeUnique<CFX_Font>()); m_FontFallbacks[0]->LoadSubst("Arial", IsTrueTypeFont(), m_Flags, m_StemV * 5, m_ItalicAngle, 0, IsVertWriting()); diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 4fc4bdc934..5356e1f5b5 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -36,6 +36,7 @@ #include "core/fxcrt/fx_safe_types.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" +#include "third_party/base/ptr_util.h" namespace { @@ -790,7 +791,7 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, pImageObj->SetUnownedImage(m_pDocument->LoadImageF(pStream)); } else { pImageObj->SetOwnedImage( - WrapUnique(new CPDF_Image(m_pDocument, pStream, bInline))); + pdfium::MakeUnique<CPDF_Image>(m_pDocument, pStream, bInline)); } SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(), FALSE, FALSE); diff --git a/core/fpdfapi/fpdf_parser/cfdf_document.cpp b/core/fpdfapi/fpdf_parser/cfdf_document.cpp index 3721bf885b..c8ed9edada 100644 --- a/core/fpdfapi/fpdf_parser/cfdf_document.cpp +++ b/core/fpdfapi/fpdf_parser/cfdf_document.cpp @@ -9,13 +9,14 @@ #include "core/fpdfapi/fpdf_edit/cpdf_creator.h" #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" #include "core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" +#include "third_party/base/ptr_util.h" CFDF_Document::CFDF_Document() : CPDF_IndirectObjectHolder(), m_pRootDict(nullptr), m_pFile(nullptr), m_bOwnFile(FALSE), - m_pByteStringPool(WrapUnique(new CFX_ByteStringPool)) {} + m_pByteStringPool(pdfium::MakeUnique<CFX_ByteStringPool>()) {} CFDF_Document::~CFDF_Document() { if (m_bOwnFile && m_pFile) diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp index f8b4f9b87b..75e6a84598 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp @@ -23,6 +23,7 @@ #include "core/fxcodec/JBig2_DocumentContext.h" #include "core/fxge/cfx_unicodeencoding.h" #include "core/fxge/fx_font.h" +#include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" namespace { @@ -415,7 +416,7 @@ CPDF_Document::CPDF_Document(std::unique_ptr<CPDF_Parser> pParser) m_dwFirstPageObjNum(0), m_pDocPage(new CPDF_DocPageData(this)), m_pDocRender(new CPDF_DocRenderData(this)), - m_pByteStringPool(WrapUnique(new CFX_ByteStringPool)) { + m_pByteStringPool(pdfium::MakeUnique<CFX_ByteStringPool>()) { if (pParser) SetLastObjNum(m_pParser->GetLastObjNum()); } |