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

Unified Diff: core/fpdfapi/page/cpdf_streamparser.cpp

Issue 2520953004: Avoid calls to WrapUnique in CPDF_streamparser (Closed)
Patch Set: Created 4 years, 1 month 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
Index: core/fpdfapi/page/cpdf_streamparser.cpp
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index 2901d3b50baf25f91257706f121c0f0af5fe73f7..7b0bf6ae03e1b3342ef90556c00dc2341afaa859 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -128,7 +128,7 @@ CPDF_StreamParser::~CPDF_StreamParser() {}
std::unique_ptr<CPDF_Stream> CPDF_StreamParser::ReadInlineStream(
CPDF_Document* pDoc,
- CPDF_Dictionary* pDict,
+ std::unique_ptr<CPDF_Dictionary> pDict,
CPDF_Object* pCSObj) {
if (m_Pos == m_Size)
return nullptr;
@@ -231,8 +231,7 @@ std::unique_ptr<CPDF_Stream> CPDF_StreamParser::ReadInlineStream(
m_Pos += dwStreamSize;
}
pDict->SetNewFor<CPDF_Number>("Length", (int)dwStreamSize);
- return pdfium::MakeUnique<CPDF_Stream>(pData, dwStreamSize,
- pdfium::WrapUnique(pDict));
+ return pdfium::MakeUnique<CPDF_Stream>(pData, dwStreamSize, std::move(pDict));
}
CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement() {

Powered by Google App Engine
This is Rietveld 408576698