From 0b95042db2e6dab5876abd12ce485fff0a8e08fe Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 15:49:49 -0400 Subject: Rename CFX_RetainPtr to RetainPtr This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fxcrt/xml/cfx_saxreader.cpp | 4 ++-- core/fxcrt/xml/cfx_saxreader.h | 8 +++---- core/fxcrt/xml/cfx_xmldoc.cpp | 2 +- core/fxcrt/xml/cfx_xmldoc.h | 6 ++--- core/fxcrt/xml/cfx_xmlnode.cpp | 2 +- core/fxcrt/xml/cfx_xmlnode.h | 4 ++-- core/fxcrt/xml/cfx_xmlparser.cpp | 5 ++--- core/fxcrt/xml/cfx_xmlparser.h | 6 ++--- core/fxcrt/xml/cfx_xmlsyntaxparser.cpp | 2 +- core/fxcrt/xml/cfx_xmlsyntaxparser.h | 6 ++--- core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp | 30 ++++++++++++------------- 11 files changed, 37 insertions(+), 38 deletions(-) (limited to 'core/fxcrt/xml') diff --git a/core/fxcrt/xml/cfx_saxreader.cpp b/core/fxcrt/xml/cfx_saxreader.cpp index e2c09d14cc..762144f4bb 100644 --- a/core/fxcrt/xml/cfx_saxreader.cpp +++ b/core/fxcrt/xml/cfx_saxreader.cpp @@ -54,7 +54,7 @@ CFX_SAXFile::CFX_SAXFile() CFX_SAXFile::~CFX_SAXFile() {} -bool CFX_SAXFile::StartFile(const CFX_RetainPtr& pFile, +bool CFX_SAXFile::StartFile(const RetainPtr& pFile, uint32_t dwStart, uint32_t dwLen) { ASSERT(!m_pFile && pFile); @@ -186,7 +186,7 @@ bool CFX_SAXReader::SkipSpace(uint8_t ch) { } int32_t CFX_SAXReader::StartParse( - const CFX_RetainPtr& pFile, + const RetainPtr& pFile, uint32_t dwStart, uint32_t dwLen, uint32_t dwParseMode) { diff --git a/core/fxcrt/xml/cfx_saxreader.h b/core/fxcrt/xml/cfx_saxreader.h index 51d9e43121..9ff755d053 100644 --- a/core/fxcrt/xml/cfx_saxreader.h +++ b/core/fxcrt/xml/cfx_saxreader.h @@ -11,8 +11,8 @@ #include #include -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" class CFX_SAXCommentContext; class CFX_SAXContext; @@ -45,13 +45,13 @@ class CFX_SAXFile { CFX_SAXFile(); ~CFX_SAXFile(); - bool StartFile(const CFX_RetainPtr& pFile, + bool StartFile(const RetainPtr& pFile, uint32_t dwStart, uint32_t dwLen); bool ReadNextBlock(); void Reset(); - CFX_RetainPtr m_pFile; + RetainPtr m_pFile; uint32_t m_dwStart; uint32_t m_dwEnd; uint32_t m_dwCur; @@ -99,7 +99,7 @@ class CFX_SAXReader { CFX_SAXReader(); ~CFX_SAXReader(); - int32_t StartParse(const CFX_RetainPtr& pFile, + int32_t StartParse(const RetainPtr& pFile, uint32_t dwStart = 0, uint32_t dwLen = -1, uint32_t dwParseMode = 0); diff --git a/core/fxcrt/xml/cfx_xmldoc.cpp b/core/fxcrt/xml/cfx_xmldoc.cpp index e9a09b761b..30e4a47e72 100644 --- a/core/fxcrt/xml/cfx_xmldoc.cpp +++ b/core/fxcrt/xml/cfx_xmldoc.cpp @@ -48,7 +48,7 @@ void CFX_XMLDoc::CloseXML() { } void CFX_XMLDoc::SaveXMLNode( - const CFX_RetainPtr& pXMLStream, + const RetainPtr& pXMLStream, CFX_XMLNode* pINode) { CFX_XMLNode* pNode = (CFX_XMLNode*)pINode; switch (pNode->GetType()) { diff --git a/core/fxcrt/xml/cfx_xmldoc.h b/core/fxcrt/xml/cfx_xmldoc.h index c182504f6f..28de7fdba1 100644 --- a/core/fxcrt/xml/cfx_xmldoc.h +++ b/core/fxcrt/xml/cfx_xmldoc.h @@ -9,8 +9,8 @@ #include -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_seekablestreamproxy.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/xml/cfx_xmlnode.h" #include "core/fxcrt/xml/cfx_xmlparser.h" @@ -24,14 +24,14 @@ class CFX_XMLDoc { void CloseXML(); CFX_XMLNode* GetRoot() const { return m_pRoot.get(); } - void SaveXMLNode(const CFX_RetainPtr& pXMLStream, + void SaveXMLNode(const RetainPtr& pXMLStream, CFX_XMLNode* pNode); private: int32_t m_iStatus; std::unique_ptr m_pRoot; std::unique_ptr m_pXMLParser; - CFX_RetainPtr m_pStream; + RetainPtr m_pStream; }; #endif // CORE_FXCRT_XML_CFX_XMLDOC_H_ diff --git a/core/fxcrt/xml/cfx_xmlnode.cpp b/core/fxcrt/xml/cfx_xmlnode.cpp index 7a893af4a0..a1e3ac2740 100644 --- a/core/fxcrt/xml/cfx_xmlnode.cpp +++ b/core/fxcrt/xml/cfx_xmlnode.cpp @@ -330,7 +330,7 @@ std::unique_ptr CFX_XMLNode::Clone() { } void CFX_XMLNode::SaveXMLNode( - const CFX_RetainPtr& pXMLStream) { + const RetainPtr& pXMLStream) { CFX_XMLNode* pNode = (CFX_XMLNode*)this; switch (pNode->GetType()) { case FX_XMLNODE_Instruction: { diff --git a/core/fxcrt/xml/cfx_xmlnode.h b/core/fxcrt/xml/cfx_xmlnode.h index 7cbc2b6642..278b3bf15a 100644 --- a/core/fxcrt/xml/cfx_xmlnode.h +++ b/core/fxcrt/xml/cfx_xmlnode.h @@ -9,8 +9,8 @@ #include -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_seekablestreamproxy.h" +#include "core/fxcrt/retain_ptr.h" enum FX_XMLNODETYPE { FX_XMLNODE_Unknown = 0, @@ -64,7 +64,7 @@ class CFX_XMLNode { bool InsertNodeItem(CFX_XMLNode::NodeItem eItem, CFX_XMLNode* pNode); CFX_XMLNode* RemoveNodeItem(CFX_XMLNode::NodeItem eItem); - void SaveXMLNode(const CFX_RetainPtr& pXMLStream); + void SaveXMLNode(const RetainPtr& pXMLStream); CFX_XMLNode* m_pParent; CFX_XMLNode* m_pChild; diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp index 280c06d3f1..a8bb2c9565 100644 --- a/core/fxcrt/xml/cfx_xmlparser.cpp +++ b/core/fxcrt/xml/cfx_xmlparser.cpp @@ -13,9 +13,8 @@ #include "core/fxcrt/xml/cfx_xmltext.h" #include "third_party/base/ptr_util.h" -CFX_XMLParser::CFX_XMLParser( - CFX_XMLNode* pParent, - const CFX_RetainPtr& pStream) +CFX_XMLParser::CFX_XMLParser(CFX_XMLNode* pParent, + const RetainPtr& pStream) : m_nElementStart(0), m_dwCheckStatus(0), m_dwCurrentCheckStatus(0), diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h index f98b658d9a..0038f6d9b2 100644 --- a/core/fxcrt/xml/cfx_xmlparser.h +++ b/core/fxcrt/xml/cfx_xmlparser.h @@ -10,8 +10,8 @@ #include #include -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/xml/cfx_xmlsyntaxparser.h" class CFX_XMLElement; @@ -21,7 +21,7 @@ class CFX_SeekableStreamProxy; class CFX_XMLParser { public: CFX_XMLParser(CFX_XMLNode* pParent, - const CFX_RetainPtr& pStream); + const RetainPtr& pStream); ~CFX_XMLParser(); int32_t DoParser(); @@ -33,7 +33,7 @@ class CFX_XMLParser { uint16_t m_dwCurrentCheckStatus; private: - CFX_RetainPtr m_pStream; + RetainPtr m_pStream; std::unique_ptr m_pParser; CFX_XMLNode* m_pParent; CFX_XMLNode* m_pChild; diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp index d55985240d..5dcb867623 100644 --- a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp +++ b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp @@ -76,7 +76,7 @@ bool CFX_XMLSyntaxParser::IsXMLNameChar(wchar_t ch, bool bFirstChar) { } CFX_XMLSyntaxParser::CFX_XMLSyntaxParser( - const CFX_RetainPtr& pStream) + const RetainPtr& pStream) : m_pStream(pStream), m_iXMLPlaneSize(32 * 1024), m_iCurrentPos(0), diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser.h b/core/fxcrt/xml/cfx_xmlsyntaxparser.h index d3f4bf2edb..8379aa445b 100644 --- a/core/fxcrt/xml/cfx_xmlsyntaxparser.h +++ b/core/fxcrt/xml/cfx_xmlsyntaxparser.h @@ -11,9 +11,9 @@ #include #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 "core/fxcrt/retain_ptr.h" #include "core/fxcrt/xml/cfx_xmlnode.h" enum class FX_XmlSyntaxResult { @@ -39,7 +39,7 @@ class CFX_XMLSyntaxParser { static bool IsXMLNameChar(wchar_t ch, bool bFirstChar); explicit CFX_XMLSyntaxParser( - const CFX_RetainPtr& pStream); + const RetainPtr& pStream); ~CFX_XMLSyntaxParser(); FX_XmlSyntaxResult DoSyntaxParse(); @@ -100,7 +100,7 @@ class CFX_XMLSyntaxParser { void ParseTextChar(wchar_t ch); - CFX_RetainPtr m_pStream; + RetainPtr m_pStream; FX_STRSIZE m_iXMLPlaneSize; FX_FILESIZE m_iCurrentPos; int32_t m_iCurrentNodeNum; diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp b/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp index c3cc3d26bf..b7f7c416b1 100644 --- a/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp +++ b/core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp @@ -26,7 +26,7 @@ TEST(CFX_XMLSyntaxParserTest, CData) { L" app.alert(\"Tclams\");\n" L" "; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -74,7 +74,7 @@ TEST(CFX_XMLSyntaxParserTest, CDataWithInnerScript) { L" \n" L" "; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -111,7 +111,7 @@ TEST(CFX_XMLSyntaxParserTest, ArrowBangArrow) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -146,7 +146,7 @@ TEST(CFX_XMLSyntaxParserTest, ArrowBangBracketArrow) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -176,7 +176,7 @@ TEST(CFX_XMLSyntaxParserTest, IncompleteCData) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -206,7 +206,7 @@ TEST(CFX_XMLSyntaxParserTest, UnClosedCData) { " "; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -236,7 +236,7 @@ TEST(CFX_XMLSyntaxParserTest, EmptyCData) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -273,7 +273,7 @@ TEST(CFX_XMLSyntaxParserTest, Comment) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -307,7 +307,7 @@ TEST(CFX_XMLSyntaxParserTest, IncorrectCommentStart) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -341,7 +341,7 @@ TEST(CFX_XMLSyntaxParserTest, CommentEmpty) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -375,7 +375,7 @@ TEST(CFX_XMLSyntaxParserTest, CommentThreeDash) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -403,7 +403,7 @@ TEST(CFX_XMLSyntaxParserTest, CommentTwoDash) { " \n" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -435,7 +435,7 @@ TEST(CFX_XMLSyntaxParserTest, Entities) { "�" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -467,7 +467,7 @@ TEST(CFX_XMLSyntaxParserTest, EntityOverflowHex) { "�" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -499,7 +499,7 @@ TEST(CFX_XMLSyntaxParserTest, EntityOverflowDecimal) { "�" ""; - CFX_RetainPtr stream = + RetainPtr stream = pdfium::MakeRetain( reinterpret_cast(const_cast(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); -- cgit v1.2.3