From ad2441ef675866eb84c7392eeda03391a5a5d474 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 24 Oct 2016 10:19:11 -0700 Subject: Rename IFX_ stream names It's been troubling for some time that an IFX_FileStream might actually be an in-memory buffer with no backing file. Review-Url: https://codereview.chromium.org/2443723002 --- xfa/fxfa/app/xfa_checksum.cpp | 2 +- xfa/fxfa/app/xfa_ffapp.cpp | 2 +- xfa/fxfa/app/xfa_ffdoc.cpp | 11 ++++++----- xfa/fxfa/app/xfa_ffwidget.cpp | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'xfa/fxfa/app') diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 5e2b1feb0f..351ae73a03 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -225,7 +225,7 @@ void CXFA_ChecksumContext::StartChecksum() { m_pSAXReader = new CFX_SAXReader; } -FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_FileRead* pSrcFile, +FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_SeekableReadStream* pSrcFile, FX_FILESIZE offset, size_t size) { if (!m_pSAXReader || !pSrcFile) diff --git a/xfa/fxfa/app/xfa_ffapp.cpp b/xfa/fxfa/app/xfa_ffapp.cpp index f233eccf6f..d60d48fa75 100644 --- a/xfa/fxfa/app/xfa_ffapp.cpp +++ b/xfa/fxfa/app/xfa_ffapp.cpp @@ -90,7 +90,7 @@ CXFA_FFDocHandler* CXFA_FFApp::GetDocHandler() { } CXFA_FFDoc* CXFA_FFApp::CreateDoc(IXFA_DocEnvironment* pDocEnvironment, - IFX_FileRead* pStream, + IFX_SeekableReadStream* pStream, FX_BOOL bTakeOverFile) { std::unique_ptr pDoc(new CXFA_FFDoc(this, pDocEnvironment)); FX_BOOL bSuccess = pDoc->OpenDoc(pStream, bTakeOverFile); diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index 25c78bd14b..494091b2f9 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -290,7 +290,8 @@ CXFA_FFDocView* CXFA_FFDoc::GetDocView() { return it != m_TypeToDocViewMap.end() ? it->second.get() : nullptr; } -FX_BOOL CXFA_FFDoc::OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile) { +FX_BOOL CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream, + FX_BOOL bTakeOverFile) { m_bOwnStream = bTakeOverFile; m_pStream = pStream; return TRUE; @@ -324,7 +325,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) { if (xfaStreams.empty()) return FALSE; - IFX_FileRead* pFileRead = new CXFA_FileRead(xfaStreams); + IFX_SeekableReadStream* pFileRead = new CXFA_FileRead(xfaStreams); m_pPDFDoc = pPDFDoc; if (m_pStream) { m_pStream->Release(); @@ -416,7 +417,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(const CFX_WideStringC& wsName, CPDF_StreamAcc streamAcc; streamAcc.LoadAllData(pStream); - IFX_FileRead* pImageFileRead = + IFX_SeekableReadStream* pImageFileRead = FX_CreateMemoryStream((uint8_t*)streamAcc.GetData(), streamAcc.GetSize()); CFX_DIBitmap* pDibSource = XFA_LoadImageFromBuffer( @@ -427,7 +428,7 @@ CFX_DIBitmap* CXFA_FFDoc::GetPDFNamedImage(const CFX_WideStringC& wsName, } bool CXFA_FFDoc::SavePackage(XFA_HashCode code, - IFX_FileWrite* pFile, + IFX_SeekableWriteStream* pFile, CXFA_ChecksumContext* pCSContext) { CXFA_Document* doc = m_pDocumentParser->GetDocument(); @@ -445,7 +446,7 @@ bool CXFA_FFDoc::SavePackage(XFA_HashCode code, pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); } -FX_BOOL CXFA_FFDoc::ImportData(IFX_FileRead* pStream, FX_BOOL bXDP) { +FX_BOOL CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP) { std::unique_ptr importer( new CXFA_DataImporter(m_pDocumentParser->GetDocument())); return importer->ImportData(pStream); diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 0e84ad6be5..c0c559aaf5 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -1056,7 +1056,7 @@ CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, FXCODEC_IMAGE_TYPE type = XFA_GetImageType(wsContentType); CFX_ByteString bsContent; uint8_t* pImageBuffer = nullptr; - IFX_FileRead* pImageFileRead = nullptr; + IFX_SeekableReadStream* pImageFileRead = nullptr; if (wsImage.GetLength() > 0) { XFA_ATTRIBUTEENUM iEncoding = (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); @@ -1117,7 +1117,7 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, } return dibFormat; } -CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, +CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_SeekableReadStream* pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t& iImageXDpi, int32_t& iImageYDpi) { -- cgit v1.2.3