diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-19 08:58:54 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-19 13:16:57 +0000 |
commit | 3b71d26f092ebc86ca9177fbbe89d83caa67ae1b (patch) | |
tree | a81ab092972ab8a2ce474d8d53984bfe9b6887a8 /xfa/fde | |
parent | 5af27b63bf94e7f60212f6759c8342ce02da5ad2 (diff) | |
download | pdfium-3b71d26f092ebc86ca9177fbbe89d83caa67ae1b.tar.xz |
Move CFGAS_Stream to CFX_SeekableStreamProxy
This CL moves the FGAS stream code into core/fxcrt and renames to
CFX_SeekableStreamProxy.
Change-Id: I6641fe0cca45a128ef3ec281b0b40f8d60296387
Reviewed-on: https://pdfium-review.googlesource.com/4311
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/cfde_txtedtengine.cpp | 4 | ||||
-rw-r--r-- | xfa/fde/cfde_txtedtengine.h | 2 | ||||
-rw-r--r-- | xfa/fde/css/cfde_cssstylesheet.cpp | 2 | ||||
-rw-r--r-- | xfa/fde/css/cfde_csssyntaxparser.cpp | 2 | ||||
-rw-r--r-- | xfa/fde/css/cfde_csstextbuf.h | 2 | ||||
-rw-r--r-- | xfa/fde/css/fde_css.h | 2 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssdatatable.cpp | 2 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmldoc.cpp | 7 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmldoc.h | 6 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlnode.cpp | 5 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlnode.h | 4 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlparser.cpp | 5 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlparser.h | 6 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlsyntaxparser.cpp | 4 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlsyntaxparser.h | 7 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp | 79 |
16 files changed, 79 insertions, 60 deletions
diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index 136735c16e..762c16f4c9 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -106,7 +106,7 @@ CFDE_TxtEdtPage* CFDE_TxtEdtEngine::GetPage(int32_t nIndex) { } void CFDE_TxtEdtEngine::SetTextByStream( - const CFX_RetainPtr<CFGAS_Stream>& pStream) { + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream) { ResetEngine(); int32_t nIndex = 0; if (pStream && pStream->GetLength()) { @@ -118,7 +118,7 @@ void CFDE_TxtEdtEngine::SetTextByStream( bool bPreIsCR = false; if (bValid) { int32_t nPos = pStream->GetBOMLength(); - pStream->Seek(CFGAS_Stream::Pos::Begin, nPos); + pStream->Seek(CFX_SeekableStreamProxy::Pos::Begin, nPos); int32_t nPlateSize = std::min(nStreamLength, m_pTxtBuf->GetChunkSize()); wchar_t* lpwstr = FX_Alloc(wchar_t, nPlateSize); bool bEos = false; diff --git a/xfa/fde/cfde_txtedtengine.h b/xfa/fde/cfde_txtedtengine.h index bbdef8fd7a..4a54c6df98 100644 --- a/xfa/fde/cfde_txtedtengine.h +++ b/xfa/fde/cfde_txtedtengine.h @@ -31,7 +31,7 @@ class CFDE_TxtEdtEngine { int32_t CountPages() const; CFDE_TxtEdtPage* GetPage(int32_t nIndex); - void SetTextByStream(const CFX_RetainPtr<CFGAS_Stream>& pStream); + void SetTextByStream(const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream); void SetText(const CFX_WideString& wsText); int32_t GetTextLength() const; CFX_WideString GetText(int32_t nStart, int32_t nCount) const; diff --git a/xfa/fde/css/cfde_cssstylesheet.cpp b/xfa/fde/css/cfde_cssstylesheet.cpp index 175289be11..c16e25156c 100644 --- a/xfa/fde/css/cfde_cssstylesheet.cpp +++ b/xfa/fde/css/cfde_cssstylesheet.cpp @@ -8,12 +8,12 @@ #include <utility> +#include "core/fxcrt/fx_codepage.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" #include "xfa/fde/css/cfde_cssdeclaration.h" #include "xfa/fde/css/cfde_cssstylerule.h" #include "xfa/fde/css/fde_cssdatatable.h" -#include "xfa/fgas/crt/fgas_codepage.h" CFDE_CSSStyleSheet::CFDE_CSSStyleSheet() {} diff --git a/xfa/fde/css/cfde_csssyntaxparser.cpp b/xfa/fde/css/cfde_csssyntaxparser.cpp index 9c45422ebb..ac1abcc665 100644 --- a/xfa/fde/css/cfde_csssyntaxparser.cpp +++ b/xfa/fde/css/cfde_csssyntaxparser.cpp @@ -8,9 +8,9 @@ #include <algorithm> +#include "core/fxcrt/fx_codepage.h" #include "xfa/fde/css/cfde_cssdeclaration.h" #include "xfa/fde/css/fde_cssdatatable.h" -#include "xfa/fgas/crt/fgas_codepage.h" namespace { diff --git a/xfa/fde/css/cfde_csstextbuf.h b/xfa/fde/css/cfde_csstextbuf.h index 43ff03aa07..71c76f3361 100644 --- a/xfa/fde/css/cfde_csstextbuf.h +++ b/xfa/fde/css/cfde_csstextbuf.h @@ -8,9 +8,9 @@ #define XFA_FDE_CSS_CFDE_CSSTEXTBUF_H_ #include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/cfx_seekablestreamproxy.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_system.h" -#include "xfa/fgas/crt/cfgas_stream.h" class CFDE_CSSTextBuf { public: diff --git a/xfa/fde/css/fde_css.h b/xfa/fde/css/fde_css.h index 9e56fce59a..ac44e30175 100644 --- a/xfa/fde/css/fde_css.h +++ b/xfa/fde/css/fde_css.h @@ -7,8 +7,8 @@ #ifndef XFA_FDE_CSS_FDE_CSS_H_ #define XFA_FDE_CSS_FDE_CSS_H_ +#include "core/fxcrt/cfx_seekablestreamproxy.h" #include "core/fxge/fx_dib.h" -#include "xfa/fgas/crt/cfgas_stream.h" #include "xfa/fgas/font/cfgas_fontmgr.h" enum FDE_CSSVALUETYPE { diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp index d61c610fe9..5fa9cf0dc9 100644 --- a/xfa/fde/css/fde_cssdatatable.cpp +++ b/xfa/fde/css/fde_cssdatatable.cpp @@ -8,10 +8,10 @@ #include <utility> +#include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_ext.h" #include "xfa/fde/css/cfde_cssstyleselector.h" #include "xfa/fde/css/cfde_cssvaluelistparser.h" -#include "xfa/fgas/crt/fgas_codepage.h" static const FDE_CSSPropertyTable g_FDE_CSSProperties[] = { {FDE_CSSProperty::BorderLeft, L"border-left", 0x04080036, diff --git a/xfa/fde/xml/cfde_xmldoc.cpp b/xfa/fde/xml/cfde_xmldoc.cpp index 256164c5f8..fa44472098 100644 --- a/xfa/fde/xml/cfde_xmldoc.cpp +++ b/xfa/fde/xml/cfde_xmldoc.cpp @@ -9,6 +9,7 @@ #include <utility> #include <vector> +#include "core/fxcrt/fx_codepage.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" #include "xfa/fde/xml/cfde_xmlchardata.h" @@ -16,7 +17,6 @@ #include "xfa/fde/xml/cfde_xmlinstruction.h" #include "xfa/fde/xml/cfde_xmlnode.h" #include "xfa/fde/xml/cfde_xmltext.h" -#include "xfa/fgas/crt/fgas_codepage.h" CFDE_XMLDoc::CFDE_XMLDoc() : m_iStatus(0), m_pRoot(pdfium::MakeUnique<CFDE_XMLNode>()) { @@ -47,8 +47,9 @@ void CFDE_XMLDoc::CloseXML() { m_pXMLParser.reset(); } -void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr<CFGAS_Stream>& pXMLStream, - CFDE_XMLNode* pINode) { +void CFDE_XMLDoc::SaveXMLNode( + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pXMLStream, + CFDE_XMLNode* pINode) { CFDE_XMLNode* pNode = (CFDE_XMLNode*)pINode; switch (pNode->GetType()) { case FDE_XMLNODE_Instruction: { diff --git a/xfa/fde/xml/cfde_xmldoc.h b/xfa/fde/xml/cfde_xmldoc.h index b84c9c00a0..c9c7db41b7 100644 --- a/xfa/fde/xml/cfde_xmldoc.h +++ b/xfa/fde/xml/cfde_xmldoc.h @@ -10,9 +10,9 @@ #include <memory> #include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/cfx_seekablestreamproxy.h" #include "xfa/fde/xml/cfde_xmlnode.h" #include "xfa/fde/xml/cfde_xmlparser.h" -#include "xfa/fgas/crt/cfgas_stream.h" class CFDE_XMLDoc { public: @@ -24,14 +24,14 @@ class CFDE_XMLDoc { void CloseXML(); CFDE_XMLNode* GetRoot() const { return m_pRoot.get(); } - void SaveXMLNode(const CFX_RetainPtr<CFGAS_Stream>& pXMLStream, + void SaveXMLNode(const CFX_RetainPtr<CFX_SeekableStreamProxy>& pXMLStream, CFDE_XMLNode* pNode); private: int32_t m_iStatus; std::unique_ptr<CFDE_XMLNode> m_pRoot; std::unique_ptr<CFDE_XMLParser> m_pXMLParser; - CFX_RetainPtr<CFGAS_Stream> m_pStream; + CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; }; #endif // XFA_FDE_XML_CFDE_XMLDOC_H_ diff --git a/xfa/fde/xml/cfde_xmlnode.cpp b/xfa/fde/xml/cfde_xmlnode.cpp index 149d18c3d6..c81de7623a 100644 --- a/xfa/fde/xml/cfde_xmlnode.cpp +++ b/xfa/fde/xml/cfde_xmlnode.cpp @@ -8,12 +8,12 @@ #include <vector> +#include "core/fxcrt/fx_codepage.h" #include "third_party/base/stl_util.h" #include "xfa/fde/xml/cfde_xmlchardata.h" #include "xfa/fde/xml/cfde_xmlelement.h" #include "xfa/fde/xml/cfde_xmlinstruction.h" #include "xfa/fde/xml/cfde_xmltext.h" -#include "xfa/fgas/crt/fgas_codepage.h" CFDE_XMLNode::CFDE_XMLNode() : m_pParent(nullptr), @@ -329,7 +329,8 @@ std::unique_ptr<CFDE_XMLNode> CFDE_XMLNode::Clone() { return nullptr; } -void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr<CFGAS_Stream>& pXMLStream) { +void CFDE_XMLNode::SaveXMLNode( + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pXMLStream) { CFDE_XMLNode* pNode = (CFDE_XMLNode*)this; switch (pNode->GetType()) { case FDE_XMLNODE_Instruction: { diff --git a/xfa/fde/xml/cfde_xmlnode.h b/xfa/fde/xml/cfde_xmlnode.h index a04bd8c812..71e1a712e0 100644 --- a/xfa/fde/xml/cfde_xmlnode.h +++ b/xfa/fde/xml/cfde_xmlnode.h @@ -10,7 +10,7 @@ #include <memory> #include "core/fxcrt/cfx_retain_ptr.h" -#include "xfa/fgas/crt/cfgas_stream.h" +#include "core/fxcrt/cfx_seekablestreamproxy.h" enum FDE_XMLNODETYPE { FDE_XMLNODE_Unknown = 0, @@ -64,7 +64,7 @@ class CFDE_XMLNode { bool InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode); CFDE_XMLNode* RemoveNodeItem(CFDE_XMLNode::NodeItem eItem); - void SaveXMLNode(const CFX_RetainPtr<CFGAS_Stream>& pXMLStream); + void SaveXMLNode(const CFX_RetainPtr<CFX_SeekableStreamProxy>& pXMLStream); CFDE_XMLNode* m_pParent; CFDE_XMLNode* m_pChild; diff --git a/xfa/fde/xml/cfde_xmlparser.cpp b/xfa/fde/xml/cfde_xmlparser.cpp index c29dfc38ab..c8b300f81d 100644 --- a/xfa/fde/xml/cfde_xmlparser.cpp +++ b/xfa/fde/xml/cfde_xmlparser.cpp @@ -14,8 +14,9 @@ #include "xfa/fde/xml/cfde_xmlnode.h" #include "xfa/fde/xml/cfde_xmltext.h" -CFDE_XMLParser::CFDE_XMLParser(CFDE_XMLNode* pParent, - const CFX_RetainPtr<CFGAS_Stream>& pStream) +CFDE_XMLParser::CFDE_XMLParser( + CFDE_XMLNode* pParent, + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream) : m_nElementStart(0), m_dwCheckStatus(0), m_dwCurrentCheckStatus(0), diff --git a/xfa/fde/xml/cfde_xmlparser.h b/xfa/fde/xml/cfde_xmlparser.h index f1a7888fa7..14b2127068 100644 --- a/xfa/fde/xml/cfde_xmlparser.h +++ b/xfa/fde/xml/cfde_xmlparser.h @@ -16,13 +16,13 @@ class CFDE_XMLElement; class CFDE_XMLNode; -class CFGAS_Stream; +class CFX_SeekableStreamProxy; class IFX_Pause; class CFDE_XMLParser { public: CFDE_XMLParser(CFDE_XMLNode* pParent, - const CFX_RetainPtr<CFGAS_Stream>& pStream); + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream); ~CFDE_XMLParser(); int32_t DoParser(IFX_Pause* pPause); @@ -34,7 +34,7 @@ class CFDE_XMLParser { uint16_t m_dwCurrentCheckStatus; private: - CFX_RetainPtr<CFGAS_Stream> m_pStream; + CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; std::unique_ptr<CFDE_XMLSyntaxParser> m_pParser; CFDE_XMLNode* m_pParent; CFDE_XMLNode* m_pChild; diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp index 10eefdc012..5d671bb39a 100644 --- a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp +++ b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp @@ -80,7 +80,7 @@ int32_t GetUTF8EncodeLength(const std::vector<wchar_t>& src, } // namespace CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser( - const CFX_RetainPtr<CFGAS_Stream>& pStream) + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream) : m_pStream(pStream), m_iXMLPlaneSize(32 * 1024), m_iCurrentPos(0), @@ -145,7 +145,7 @@ FDE_XmlSyntaxResult CFDE_XMLSyntaxParser::DoSyntaxParse() { m_ParsedChars += m_End; m_iParsedBytes = m_iCurrentPos; if (m_pStream->GetPosition() != m_iCurrentPos) - m_pStream->Seek(CFGAS_Stream::Pos::Begin, m_iCurrentPos); + m_pStream->Seek(CFX_SeekableStreamProxy::Pos::Begin, m_iCurrentPos); m_iBufferChars = m_pStream->ReadString(m_Buffer.data(), m_iXMLPlaneSize, &m_bEOS); diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.h b/xfa/fde/xml/cfde_xmlsyntaxparser.h index aa4e91827e..8b6c9ac8b5 100644 --- a/xfa/fde/xml/cfde_xmlsyntaxparser.h +++ b/xfa/fde/xml/cfde_xmlsyntaxparser.h @@ -12,9 +12,9 @@ #include "core/fxcrt/cfx_blockbuffer.h" #include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/cfx_seekablestreamproxy.h" #include "core/fxcrt/fx_string.h" #include "xfa/fde/xml/cfde_xmlnode.h" -#include "xfa/fgas/crt/cfgas_stream.h" enum class FDE_XmlSyntaxResult { None, @@ -36,7 +36,8 @@ enum class FDE_XmlSyntaxResult { class CFDE_XMLSyntaxParser { public: - explicit CFDE_XMLSyntaxParser(const CFX_RetainPtr<CFGAS_Stream>& pStream); + explicit CFDE_XMLSyntaxParser( + const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream); ~CFDE_XMLSyntaxParser(); FDE_XmlSyntaxResult DoSyntaxParse(); @@ -97,7 +98,7 @@ class CFDE_XMLSyntaxParser { void ParseTextChar(wchar_t ch); - CFX_RetainPtr<CFGAS_Stream> m_pStream; + CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; FX_STRSIZE m_iXMLPlaneSize; int32_t m_iCurrentPos; int32_t m_iCurrentNodeNum; diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp index aecb3ee39e..45ad3bb2f0 100644 --- a/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp +++ b/xfa/fde/xml/cfde_xmlsyntaxparser_unittest.cpp @@ -6,10 +6,10 @@ #include <memory> +#include "core/fxcrt/cfx_seekablestreamproxy.h" +#include "core/fxcrt/fx_codepage.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/test_support.h" -#include "xfa/fgas/crt/cfgas_stream.h" -#include "xfa/fgas/crt/fgas_codepage.h" class CFDE_XMLSyntaxParserTest : public pdfium::FPDF_Test {}; @@ -28,8 +28,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CData) { L" app.alert(\"Tclams\");\n" L" "; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -75,8 +76,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CDataWithInnerScript) { L" </script>\n" L" "; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -111,8 +113,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangArrow) { " <!>\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -145,8 +148,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, ArrowBangBracketArrow) { " <![>\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -174,8 +178,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, IncompleteCData) { " <![CDATA>\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -203,8 +208,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, UnClosedCData) { " <![CDATA[\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -232,8 +238,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, EmptyCData) { " <![CDATA[]]>\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -268,8 +275,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, Comment) { " <!-- A Comment -->\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -301,8 +309,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, IncorrectCommentStart) { " <!- A Comment -->\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -334,8 +343,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentEmpty) { " <!---->\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -367,8 +377,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentThreeDash) { " <!--->\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -394,8 +405,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, CommentTwoDash) { " <!-->\n" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -425,8 +437,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, Entities) { "�" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -456,8 +469,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowHex) { "�" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); @@ -487,8 +501,9 @@ TEST_F(CFDE_XMLSyntaxParserTest, EntityOverflowDecimal) { "�" "</script>"; - CFX_RetainPtr<CFGAS_Stream> stream = pdfium::MakeRetain<CFGAS_Stream>( - reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); + CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + pdfium::MakeRetain<CFX_SeekableStreamProxy>( + reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); CFDE_XMLSyntaxParser parser(stream); |