diff options
author | tsepez <tsepez@chromium.org> | 2016-12-15 13:51:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-15 13:51:34 -0800 |
commit | 47fb8c06acd0ff9ea50c8c2d7f67510ea5c28577 (patch) | |
tree | b6c3594bdf3690d00f2fd959f06cef1d45ae0f71 /core/fpdfapi/parser/cpdf_stream.cpp | |
parent | b04b96b1ea3ef88385bbf736b2bccab7ed12c486 (diff) | |
download | pdfium-47fb8c06acd0ff9ea50c8c2d7f67510ea5c28577.tar.xz |
Return unique_ptr from CFX_BinaryBuf::DetachBuffer()
In turn, make CPDF_Stream() take an unique_ptr.
Review-Url: https://codereview.chromium.org/2584683002
Diffstat (limited to 'core/fpdfapi/parser/cpdf_stream.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_stream.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp index 3159791e82..e186bc19d1 100644 --- a/core/fpdfapi/parser/cpdf_stream.cpp +++ b/core/fpdfapi/parser/cpdf_stream.cpp @@ -18,10 +18,10 @@ CPDF_Stream::CPDF_Stream() {} -CPDF_Stream::CPDF_Stream(uint8_t* pData, +CPDF_Stream::CPDF_Stream(std::unique_ptr<uint8_t, FxFreeDeleter> pData, uint32_t size, std::unique_ptr<CPDF_Dictionary> pDict) - : m_dwSize(size), m_pDict(std::move(pDict)), m_pDataBuf(pData) {} + : m_dwSize(size), m_pDict(std::move(pDict)), m_pDataBuf(std::move(pData)) {} CPDF_Stream::~CPDF_Stream() { m_ObjNum = kInvalidObjNum; @@ -93,7 +93,7 @@ std::unique_ptr<CPDF_Object> CPDF_Stream::CloneNonCyclic( pNewDict = ToDictionary( static_cast<CPDF_Object*>(pDict)->CloneNonCyclic(bDirect, pVisited)); } - return pdfium::MakeUnique<CPDF_Stream>(acc.DetachData().release(), streamSize, + return pdfium::MakeUnique<CPDF_Stream>(acc.DetachData(), streamSize, std::move(pNewDict)); } |