diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-12 11:32:32 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-12 17:23:27 +0000 |
commit | 9d6a2089c93c94461289b21a29771039eace95e7 (patch) | |
tree | 5b747786fe129b20aaf2ba3271e7b99051f5ae99 /xfa/fgas/crt | |
parent | b333c9ec415c132451f4a10487b84f91124d08e8 (diff) | |
download | pdfium-9d6a2089c93c94461289b21a29771039eace95e7.tar.xz |
Remove MakeSeekableReadStream
This Cl removes the MakeSeekableReadStream call and, at the one place
it's used, creates an IFX_MemoryStream which is a seekable read stream.
Change-Id: I6b0b23636eff47f8caca5432313ba99703e21e4d
Reviewed-on: https://pdfium-review.googlesource.com/4037
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/crt')
-rw-r--r-- | xfa/fgas/crt/ifgas_stream.cpp | 34 | ||||
-rw-r--r-- | xfa/fgas/crt/ifgas_stream.h | 2 |
2 files changed, 0 insertions, 36 deletions
diff --git a/xfa/fgas/crt/ifgas_stream.cpp b/xfa/fgas/crt/ifgas_stream.cpp index 874330165b..dcd13b162e 100644 --- a/xfa/fgas/crt/ifgas_stream.cpp +++ b/xfa/fgas/crt/ifgas_stream.cpp @@ -169,19 +169,6 @@ class CFGAS_TextStream : public IFGAS_Stream { CFX_RetainPtr<IFGAS_Stream> m_pStreamImp; }; -class CFGAS_FileRead : public IFX_SeekableReadStream { - public: - explicit CFGAS_FileRead(const CFX_RetainPtr<IFGAS_Stream>& pStream); - ~CFGAS_FileRead() override; - - // IFX_SeekableReadStream - FX_FILESIZE GetSize() override; - bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; - - protected: - CFX_RetainPtr<IFGAS_Stream> m_pStream; -}; - IFGAS_StreamImp::IFGAS_StreamImp() : m_dwAccess(0) {} CFGAS_FileReadStreamImp::CFGAS_FileReadStreamImp() @@ -663,23 +650,6 @@ uint16_t CFGAS_Stream::SetCodePage(uint16_t wCodePage) { #endif } -CFGAS_FileRead::CFGAS_FileRead(const CFX_RetainPtr<IFGAS_Stream>& pStream) - : m_pStream(pStream) { - ASSERT(m_pStream); -} - -CFGAS_FileRead::~CFGAS_FileRead() {} - -FX_FILESIZE CFGAS_FileRead::GetSize() { - return (FX_FILESIZE)m_pStream->GetLength(); -} - -bool CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { - m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset); - int32_t iLen = m_pStream->ReadData((uint8_t*)buffer, (int32_t)size); - return iLen == (int32_t)size; -} - } // namespace // static @@ -714,7 +684,3 @@ CFX_RetainPtr<IFGAS_Stream> IFGAS_Stream::CreateWriteStream( return pdfium::MakeRetain<CFGAS_TextStream>( pdfium::MakeRetain<CFGAS_Stream>(std::move(pImp), FX_STREAMACCESS_Write)); } - -CFX_RetainPtr<IFX_SeekableReadStream> IFGAS_Stream::MakeSeekableReadStream() { - return pdfium::MakeRetain<CFGAS_FileRead>(CFX_RetainPtr<IFGAS_Stream>(this)); -} diff --git a/xfa/fgas/crt/ifgas_stream.h b/xfa/fgas/crt/ifgas_stream.h index cfb0722b21..d8efc41afd 100644 --- a/xfa/fgas/crt/ifgas_stream.h +++ b/xfa/fgas/crt/ifgas_stream.h @@ -42,8 +42,6 @@ class IFGAS_Stream : public CFX_Retainable { virtual int32_t GetBOM(uint8_t bom[4]) const = 0; virtual uint16_t GetCodePage() const = 0; virtual uint16_t SetCodePage(uint16_t wCodePage) = 0; - - CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(); }; #endif // XFA_FGAS_CRT_IFGAS_STREAM_H_ |