From b872a93e5cd940dc28ad960b13b0cf01a6db3400 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 17:05:15 -0400 Subject: Move CFX_WeakPtr to WeakPtr This CL renames CFX_WeakPtr to WeakPtr and moves into the fxcrt namespace. Bug: pdfium:898 Change-Id: Ide50a8afeb1e987c48c8fbd103898745c9199d6a Reviewed-on: https://pdfium-review.googlesource.com/14621 Commit-Queue: dsinclair Commit-Queue: Tom Sepez Reviewed-by: Tom Sepez --- core/fpdfapi/parser/cpdf_array.cpp | 3 +-- core/fpdfapi/parser/cpdf_array.h | 4 ++-- core/fpdfapi/parser/cpdf_dictionary.cpp | 4 ++-- core/fpdfapi/parser/cpdf_dictionary.h | 8 ++++---- core/fpdfapi/parser/cpdf_indirect_object_holder.h | 6 +++--- core/fpdfapi/parser/cpdf_name.cpp | 2 +- core/fpdfapi/parser/cpdf_name.h | 4 ++-- core/fpdfapi/parser/cpdf_string.cpp | 5 ++--- core/fpdfapi/parser/cpdf_string.h | 8 +++----- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 4 ++-- core/fpdfapi/parser/cpdf_syntax_parser.h | 6 +++--- 11 files changed, 25 insertions(+), 29 deletions(-) (limited to 'core/fpdfapi/parser') diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp index f4907ffdf1..5a5cdc9be0 100644 --- a/core/fpdfapi/parser/cpdf_array.cpp +++ b/core/fpdfapi/parser/cpdf_array.cpp @@ -20,8 +20,7 @@ CPDF_Array::CPDF_Array() {} -CPDF_Array::CPDF_Array(const CFX_WeakPtr& pPool) - : m_pPool(pPool) {} +CPDF_Array::CPDF_Array(const WeakPtr& pPool) : m_pPool(pPool) {} CPDF_Array::~CPDF_Array() { // Break cycles for cyclic references. diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h index 3b18025b2d..bf8cb426c4 100644 --- a/core/fpdfapi/parser/cpdf_array.h +++ b/core/fpdfapi/parser/cpdf_array.h @@ -24,7 +24,7 @@ class CPDF_Array : public CPDF_Object { std::vector>::const_iterator; CPDF_Array(); - explicit CPDF_Array(const CFX_WeakPtr& pPool); + explicit CPDF_Array(const WeakPtr& pPool); ~CPDF_Array() override; // CPDF_Object: @@ -112,7 +112,7 @@ class CPDF_Array : public CPDF_Object { std::set* pVisited) const override; std::vector> m_Objects; - CFX_WeakPtr m_pPool; + WeakPtr m_pPool; }; inline CPDF_Array* ToArray(CPDF_Object* obj) { diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp index 570c57e557..5cdcf34f81 100644 --- a/core/fpdfapi/parser/cpdf_dictionary.cpp +++ b/core/fpdfapi/parser/cpdf_dictionary.cpp @@ -22,9 +22,9 @@ #include "third_party/base/stl_util.h" CPDF_Dictionary::CPDF_Dictionary() - : CPDF_Dictionary(CFX_WeakPtr()) {} + : CPDF_Dictionary(WeakPtr()) {} -CPDF_Dictionary::CPDF_Dictionary(const CFX_WeakPtr& pPool) +CPDF_Dictionary::CPDF_Dictionary(const WeakPtr& pPool) : m_pPool(pPool) {} CPDF_Dictionary::~CPDF_Dictionary() { diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h index a9ff353fbe..688e88e510 100644 --- a/core/fpdfapi/parser/cpdf_dictionary.h +++ b/core/fpdfapi/parser/cpdf_dictionary.h @@ -13,10 +13,10 @@ #include #include "core/fpdfapi/parser/cpdf_object.h" -#include "core/fxcrt/cfx_weak_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/string_pool_template.h" +#include "core/fxcrt/weak_ptr.h" #include "third_party/base/ptr_util.h" class CPDF_IndirectObjectHolder; @@ -27,7 +27,7 @@ class CPDF_Dictionary : public CPDF_Object { std::map>::const_iterator; CPDF_Dictionary(); - explicit CPDF_Dictionary(const CFX_WeakPtr& pPool); + explicit CPDF_Dictionary(const WeakPtr& pPool); ~CPDF_Dictionary() override; // CPDF_Object: @@ -97,7 +97,7 @@ class CPDF_Dictionary : public CPDF_Object { const_iterator begin() const { return m_Map.begin(); } const_iterator end() const { return m_Map.end(); } - CFX_WeakPtr GetByteStringPool() const { return m_pPool; } + WeakPtr GetByteStringPool() const { return m_pPool; } protected: ByteString MaybeIntern(const ByteString& str); @@ -105,7 +105,7 @@ class CPDF_Dictionary : public CPDF_Object { bool bDirect, std::set* visited) const override; - CFX_WeakPtr m_pPool; + WeakPtr m_pPool; std::map> m_Map; }; diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.h b/core/fpdfapi/parser/cpdf_indirect_object_holder.h index ea70c4a351..57374b9cc2 100644 --- a/core/fpdfapi/parser/cpdf_indirect_object_holder.h +++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.h @@ -14,9 +14,9 @@ #include #include "core/fpdfapi/parser/cpdf_object.h" -#include "core/fxcrt/cfx_weak_ptr.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/string_pool_template.h" +#include "core/fxcrt/weak_ptr.h" #include "third_party/base/ptr_util.h" class CPDF_IndirectObjectHolder { @@ -58,7 +58,7 @@ class CPDF_IndirectObjectHolder { uint32_t GetLastObjNum() const { return m_LastObjNum; } void SetLastObjNum(uint32_t objnum) { m_LastObjNum = objnum; } - CFX_WeakPtr GetByteStringPool() const { + WeakPtr GetByteStringPool() const { return m_pByteStringPool; } @@ -72,7 +72,7 @@ class CPDF_IndirectObjectHolder { uint32_t m_LastObjNum; std::map> m_IndirectObjs; std::vector> m_OrphanObjs; - CFX_WeakPtr m_pByteStringPool; + WeakPtr m_pByteStringPool; }; #endif // CORE_FPDFAPI_PARSER_CPDF_INDIRECT_OBJECT_HOLDER_H_ diff --git a/core/fpdfapi/parser/cpdf_name.cpp b/core/fpdfapi/parser/cpdf_name.cpp index 0dd9890702..0607a30342 100644 --- a/core/fpdfapi/parser/cpdf_name.cpp +++ b/core/fpdfapi/parser/cpdf_name.cpp @@ -10,7 +10,7 @@ #include "core/fxcrt/fx_stream.h" #include "third_party/base/ptr_util.h" -CPDF_Name::CPDF_Name(CFX_WeakPtr pPool, const ByteString& str) +CPDF_Name::CPDF_Name(WeakPtr pPool, const ByteString& str) : m_Name(str) { if (pPool) m_Name = pPool->Intern(m_Name); diff --git a/core/fpdfapi/parser/cpdf_name.h b/core/fpdfapi/parser/cpdf_name.h index 8a1cf2b63b..880c10aedb 100644 --- a/core/fpdfapi/parser/cpdf_name.h +++ b/core/fpdfapi/parser/cpdf_name.h @@ -10,12 +10,12 @@ #include #include "core/fpdfapi/parser/cpdf_object.h" -#include "core/fxcrt/cfx_weak_ptr.h" #include "core/fxcrt/string_pool_template.h" +#include "core/fxcrt/weak_ptr.h" class CPDF_Name : public CPDF_Object { public: - CPDF_Name(CFX_WeakPtr pPool, const ByteString& str); + CPDF_Name(WeakPtr pPool, const ByteString& str); ~CPDF_Name() override; // CPDF_Object: diff --git a/core/fpdfapi/parser/cpdf_string.cpp b/core/fpdfapi/parser/cpdf_string.cpp index 1539861622..851442e8b4 100644 --- a/core/fpdfapi/parser/cpdf_string.cpp +++ b/core/fpdfapi/parser/cpdf_string.cpp @@ -14,7 +14,7 @@ CPDF_String::CPDF_String() : m_bHex(false) {} -CPDF_String::CPDF_String(CFX_WeakPtr pPool, +CPDF_String::CPDF_String(WeakPtr pPool, const ByteString& str, bool bHex) : m_String(str), m_bHex(bHex) { @@ -22,8 +22,7 @@ CPDF_String::CPDF_String(CFX_WeakPtr pPool, m_String = pPool->Intern(m_String); } -CPDF_String::CPDF_String(CFX_WeakPtr pPool, - const WideString& str) +CPDF_String::CPDF_String(WeakPtr pPool, const WideString& str) : m_String(PDF_EncodeText(str)), m_bHex(false) { if (pPool) m_String = pPool->Intern(m_String); diff --git a/core/fpdfapi/parser/cpdf_string.h b/core/fpdfapi/parser/cpdf_string.h index 6f762ae27b..b6aaacb043 100644 --- a/core/fpdfapi/parser/cpdf_string.h +++ b/core/fpdfapi/parser/cpdf_string.h @@ -10,18 +10,16 @@ #include #include "core/fpdfapi/parser/cpdf_object.h" -#include "core/fxcrt/cfx_weak_ptr.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/string_pool_template.h" +#include "core/fxcrt/weak_ptr.h" class CPDF_String : public CPDF_Object { public: CPDF_String(); - CPDF_String(CFX_WeakPtr pPool, - const ByteString& str, - bool bHex); - CPDF_String(CFX_WeakPtr pPool, const WideString& str); + CPDF_String(WeakPtr pPool, const ByteString& str, bool bHex); + CPDF_String(WeakPtr pPool, const WideString& str); ~CPDF_String() override; // CPDF_Object: diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 7bea4c45fc..bf6d90ca9a 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -41,9 +41,9 @@ enum class ReadStatus { Normal, Backslash, Octal, FinishOctal, CarriageReturn }; int CPDF_SyntaxParser::s_CurrentRecursionDepth = 0; CPDF_SyntaxParser::CPDF_SyntaxParser() - : CPDF_SyntaxParser(CFX_WeakPtr()) {} + : CPDF_SyntaxParser(WeakPtr()) {} -CPDF_SyntaxParser::CPDF_SyntaxParser(const CFX_WeakPtr& pPool) +CPDF_SyntaxParser::CPDF_SyntaxParser(const WeakPtr& pPool) : m_MetadataObjnum(0), m_pFileAccess(nullptr), m_pFileBuf(nullptr), diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h index cb266837dc..2b642b5963 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.h +++ b/core/fpdfapi/parser/cpdf_syntax_parser.h @@ -10,8 +10,8 @@ #include #include -#include "core/fxcrt/cfx_weak_ptr.h" #include "core/fxcrt/string_pool_template.h" +#include "core/fxcrt/weak_ptr.h" class CPDF_CryptoHandler; class CPDF_Dictionary; @@ -26,7 +26,7 @@ class CPDF_SyntaxParser { enum class ParseType { kStrict, kLoose }; CPDF_SyntaxParser(); - explicit CPDF_SyntaxParser(const CFX_WeakPtr& pPool); + explicit CPDF_SyntaxParser(const WeakPtr& pPool); ~CPDF_SyntaxParser(); void InitParser(const RetainPtr& pFileAccess, @@ -121,7 +121,7 @@ class CPDF_SyntaxParser { RetainPtr m_pCryptoHandler; uint8_t m_WordBuffer[257]; uint32_t m_WordSize; - CFX_WeakPtr m_pPool; + WeakPtr m_pPool; }; #endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_ -- cgit v1.2.3