diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-21 15:49:49 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-21 20:17:31 +0000 |
commit | 0b95042db2e6dab5876abd12ce485fff0a8e08fe (patch) | |
tree | 02132ed53945fde30bfbf230ff4e9b5308dd7732 /core/fxcrt/xml | |
parent | a5eb9f05b7c3f82630784e043ccf75c4e019b18f (diff) | |
download | pdfium-0b95042db2e6dab5876abd12ce485fff0a8e08fe.tar.xz |
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 <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r-- | core/fxcrt/xml/cfx_saxreader.cpp | 4 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_saxreader.h | 8 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmldoc.cpp | 2 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmldoc.h | 6 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlnode.cpp | 2 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlnode.h | 4 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlparser.cpp | 5 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlparser.h | 6 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlsyntaxparser.cpp | 2 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlsyntaxparser.h | 6 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlsyntaxparser_unittest.cpp | 30 |
11 files changed, 37 insertions, 38 deletions
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<IFX_SeekableReadStream>& pFile, +bool CFX_SAXFile::StartFile(const RetainPtr<IFX_SeekableReadStream>& 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<IFX_SeekableReadStream>& pFile, + const RetainPtr<IFX_SeekableReadStream>& 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 <stack> #include <vector> -#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<IFX_SeekableReadStream>& pFile, + bool StartFile(const RetainPtr<IFX_SeekableReadStream>& pFile, uint32_t dwStart, uint32_t dwLen); bool ReadNextBlock(); void Reset(); - CFX_RetainPtr<IFX_SeekableReadStream> m_pFile; + RetainPtr<IFX_SeekableReadStream> 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<IFX_SeekableReadStream>& pFile, + int32_t StartParse(const RetainPtr<IFX_SeekableReadStream>& 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<CFX_SeekableStreamProxy>& pXMLStream, + const RetainPtr<CFX_SeekableStreamProxy>& 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 <memory> -#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<CFX_SeekableStreamProxy>& pXMLStream, + void SaveXMLNode(const RetainPtr<CFX_SeekableStreamProxy>& pXMLStream, CFX_XMLNode* pNode); private: int32_t m_iStatus; std::unique_ptr<CFX_XMLNode> m_pRoot; std::unique_ptr<CFX_XMLParser> m_pXMLParser; - CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; + RetainPtr<CFX_SeekableStreamProxy> 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> CFX_XMLNode::Clone() { } void CFX_XMLNode::SaveXMLNode( - const CFX_RetainPtr<CFX_SeekableStreamProxy>& pXMLStream) { + const RetainPtr<CFX_SeekableStreamProxy>& 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 <memory> -#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<CFX_SeekableStreamProxy>& pXMLStream); + void SaveXMLNode(const RetainPtr<CFX_SeekableStreamProxy>& 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<CFX_SeekableStreamProxy>& pStream) +CFX_XMLParser::CFX_XMLParser(CFX_XMLNode* pParent, + const RetainPtr<CFX_SeekableStreamProxy>& 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 <memory> #include <stack> -#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<CFX_SeekableStreamProxy>& pStream); + const RetainPtr<CFX_SeekableStreamProxy>& pStream); ~CFX_XMLParser(); int32_t DoParser(); @@ -33,7 +33,7 @@ class CFX_XMLParser { uint16_t m_dwCurrentCheckStatus; private: - CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; + RetainPtr<CFX_SeekableStreamProxy> m_pStream; std::unique_ptr<CFX_XMLSyntaxParser> 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<CFX_SeekableStreamProxy>& pStream) + const RetainPtr<CFX_SeekableStreamProxy>& 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 <vector> #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<CFX_SeekableStreamProxy>& pStream); + const RetainPtr<CFX_SeekableStreamProxy>& pStream); ~CFX_XMLSyntaxParser(); FX_XmlSyntaxResult DoSyntaxParse(); @@ -100,7 +100,7 @@ class CFX_XMLSyntaxParser { void ParseTextChar(wchar_t ch); - CFX_RetainPtr<CFX_SeekableStreamProxy> m_pStream; + RetainPtr<CFX_SeekableStreamProxy> 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<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -74,7 +74,7 @@ TEST(CFX_XMLSyntaxParserTest, CDataWithInnerScript) { L" </script>\n" L" "; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -111,7 +111,7 @@ TEST(CFX_XMLSyntaxParserTest, ArrowBangArrow) { " <!>\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -146,7 +146,7 @@ TEST(CFX_XMLSyntaxParserTest, ArrowBangBracketArrow) { " <![>\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -176,7 +176,7 @@ TEST(CFX_XMLSyntaxParserTest, IncompleteCData) { " <![CDATA>\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -206,7 +206,7 @@ TEST(CFX_XMLSyntaxParserTest, UnClosedCData) { " <![CDATA[\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -236,7 +236,7 @@ TEST(CFX_XMLSyntaxParserTest, EmptyCData) { " <![CDATA[]]>\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -273,7 +273,7 @@ TEST(CFX_XMLSyntaxParserTest, Comment) { " <!-- A Comment -->\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -307,7 +307,7 @@ TEST(CFX_XMLSyntaxParserTest, IncorrectCommentStart) { " <!- A Comment -->\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -341,7 +341,7 @@ TEST(CFX_XMLSyntaxParserTest, CommentEmpty) { " <!---->\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -375,7 +375,7 @@ TEST(CFX_XMLSyntaxParserTest, CommentThreeDash) { " <!--->\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -403,7 +403,7 @@ TEST(CFX_XMLSyntaxParserTest, CommentTwoDash) { " <!-->\n" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -435,7 +435,7 @@ TEST(CFX_XMLSyntaxParserTest, Entities) { "�" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -467,7 +467,7 @@ TEST(CFX_XMLSyntaxParserTest, EntityOverflowHex) { "�" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); @@ -499,7 +499,7 @@ TEST(CFX_XMLSyntaxParserTest, EntityOverflowDecimal) { "�" "</script>"; - CFX_RetainPtr<CFX_SeekableStreamProxy> stream = + RetainPtr<CFX_SeekableStreamProxy> stream = pdfium::MakeRetain<CFX_SeekableStreamProxy>( reinterpret_cast<uint8_t*>(const_cast<char*>(input)), strlen(input)); stream->SetCodePage(FX_CODEPAGE_UTF8); |