From aa31fd95a7ba0c8bdfdb3cfd37f44641ae8c8c2b Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 30 May 2018 21:11:21 +0000 Subject: Remove unused CFX_MemoryStream::{Attach,Detach}Buffer() methods Also, EstimateSize() is similarly unused. Change-Id: Idbbb5a4a1105448731d3541365c30ba37ff7eb29 Reviewed-on: https://pdfium-review.googlesource.com/33314 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- core/fxcrt/cfx_memorystream.cpp | 35 ----------------------------------- core/fxcrt/cfx_memorystream.h | 4 ---- 2 files changed, 39 deletions(-) (limited to 'core/fxcrt') diff --git a/core/fxcrt/cfx_memorystream.cpp b/core/fxcrt/cfx_memorystream.cpp index dcd21f073f..0115e37b6f 100644 --- a/core/fxcrt/cfx_memorystream.cpp +++ b/core/fxcrt/cfx_memorystream.cpp @@ -156,41 +156,6 @@ bool CFX_MemoryStream::Seek(size_t pos) { return true; } -void CFX_MemoryStream::EstimateSize(size_t nInitSize, size_t nGrowSize) { - if (m_dwFlags & Type::kConsecutive) { - if (m_Blocks.empty()) { - m_Blocks.push_back( - FX_Alloc(uint8_t, std::max(nInitSize, static_cast(4096)))); - } - m_nGrowSize = std::max(nGrowSize, static_cast(4096)); - } else if (m_Blocks.empty()) { - m_nGrowSize = std::max(nGrowSize, static_cast(4096)); - } -} - -void CFX_MemoryStream::AttachBuffer(uint8_t* pBuffer, size_t nSize) { - if (!(m_dwFlags & Type::kConsecutive)) - return; - - m_Blocks.clear(); - m_Blocks.push_back(pBuffer); - m_nTotalSize = nSize; - m_nCurSize = nSize; - m_nCurPos = 0; - m_dwFlags = Type::kConsecutive; -} - -void CFX_MemoryStream::DetachBuffer() { - if (!(m_dwFlags & Type::kConsecutive)) - return; - - m_Blocks.clear(); - m_nTotalSize = 0; - m_nCurSize = 0; - m_nCurPos = 0; - m_dwFlags = Type::kTakeOver; -} - bool CFX_MemoryStream::ExpandBlocks(size_t size) { m_nCurSize = std::max(m_nCurSize, size); if (size <= m_nTotalSize) diff --git a/core/fxcrt/cfx_memorystream.h b/core/fxcrt/cfx_memorystream.h index a56a2dbe2c..64ea2cd5b5 100644 --- a/core/fxcrt/cfx_memorystream.h +++ b/core/fxcrt/cfx_memorystream.h @@ -37,10 +37,6 @@ class CFX_MemoryStream : public IFX_SeekableStream { return !m_Blocks.empty() ? m_Blocks.front() : nullptr; } - void EstimateSize(size_t nInitSize, size_t nGrowSize); - void AttachBuffer(uint8_t* pBuffer, size_t nSize); - void DetachBuffer(); - private: explicit CFX_MemoryStream(bool bConsecutive); CFX_MemoryStream(uint8_t* pBuffer, size_t nSize, bool bTakeOver); -- cgit v1.2.3