summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-21 17:05:15 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-21 21:38:37 +0000
commitb872a93e5cd940dc28ad960b13b0cf01a6db3400 (patch)
tree057208e10b41e1cc3c2ac1b782af9394aadbe87d /core/fpdfapi
parentaee0db0e6a12bdaacebeb8fb791f4e0d45e18a0d (diff)
downloadpdfium-b872a93e5cd940dc28ad960b13b0cf01a6db3400.tar.xz
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 <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/font/cpdf_fontencoding.cpp2
-rw-r--r--core/fpdfapi/font/cpdf_fontencoding.h4
-rw-r--r--core/fpdfapi/page/cpdf_streamparser.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_streamparser.h6
-rw-r--r--core/fpdfapi/parser/cpdf_array.cpp3
-rw-r--r--core/fpdfapi/parser/cpdf_array.h4
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.cpp4
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.h8
-rw-r--r--core/fpdfapi/parser/cpdf_indirect_object_holder.h6
-rw-r--r--core/fpdfapi/parser/cpdf_name.cpp2
-rw-r--r--core/fpdfapi/parser/cpdf_name.h4
-rw-r--r--core/fpdfapi/parser/cpdf_string.cpp5
-rw-r--r--core/fpdfapi/parser/cpdf_string.h8
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.cpp4
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.h6
15 files changed, 32 insertions, 36 deletions
diff --git a/core/fpdfapi/font/cpdf_fontencoding.cpp b/core/fpdfapi/font/cpdf_fontencoding.cpp
index 6290f20f5e..921d5842b8 100644
--- a/core/fpdfapi/font/cpdf_fontencoding.cpp
+++ b/core/fpdfapi/font/cpdf_fontencoding.cpp
@@ -1672,7 +1672,7 @@ bool CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const {
}
std::unique_ptr<CPDF_Object> CPDF_FontEncoding::Realize(
- CFX_WeakPtr<ByteStringPool> pPool) {
+ WeakPtr<ByteStringPool> pPool) {
int predefined = 0;
for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS;
cs++) {
diff --git a/core/fpdfapi/font/cpdf_fontencoding.h b/core/fpdfapi/font/cpdf_fontencoding.h
index d96f787da1..cb99975b98 100644
--- a/core/fpdfapi/font/cpdf_fontencoding.h
+++ b/core/fpdfapi/font/cpdf_fontencoding.h
@@ -9,9 +9,9 @@
#include <memory>
-#include "core/fxcrt/cfx_weak_ptr.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/string_pool_template.h"
+#include "core/fxcrt/weak_ptr.h"
#define PDFFONT_ENCODING_BUILTIN 0
#define PDFFONT_ENCODING_WINANSI 1
@@ -53,7 +53,7 @@ class CPDF_FontEncoding {
m_Unicodes[charcode] = unicode;
}
- std::unique_ptr<CPDF_Object> Realize(CFX_WeakPtr<ByteStringPool> pPool);
+ std::unique_ptr<CPDF_Object> Realize(WeakPtr<ByteStringPool> pPool);
public:
wchar_t m_Unicodes[256];
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index ffd76005e0..e9320cbc6f 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -107,7 +107,7 @@ CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize)
CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData,
uint32_t dwSize,
- const CFX_WeakPtr<ByteStringPool>& pPool)
+ const WeakPtr<ByteStringPool>& pPool)
: m_pBuf(pData), m_Size(dwSize), m_Pos(0), m_pPool(pPool) {}
CPDF_StreamParser::~CPDF_StreamParser() {}
diff --git a/core/fpdfapi/page/cpdf_streamparser.h b/core/fpdfapi/page/cpdf_streamparser.h
index 53d5dfd135..158726b026 100644
--- a/core/fpdfapi/page/cpdf_streamparser.h
+++ b/core/fpdfapi/page/cpdf_streamparser.h
@@ -14,8 +14,8 @@
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
-#include "core/fxcrt/cfx_weak_ptr.h"
#include "core/fxcrt/string_pool_template.h"
+#include "core/fxcrt/weak_ptr.h"
class CPDF_StreamParser {
public:
@@ -24,7 +24,7 @@ class CPDF_StreamParser {
CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize);
CPDF_StreamParser(const uint8_t* pData,
uint32_t dwSize,
- const CFX_WeakPtr<ByteStringPool>& pPool);
+ const WeakPtr<ByteStringPool>& pPool);
~CPDF_StreamParser();
SyntaxType ParseNextElement();
@@ -56,7 +56,7 @@ class CPDF_StreamParser {
uint8_t m_WordBuffer[256];
uint32_t m_WordSize;
std::unique_ptr<CPDF_Object> m_pLastObj;
- CFX_WeakPtr<ByteStringPool> m_pPool;
+ WeakPtr<ByteStringPool> m_pPool;
};
#endif // CORE_FPDFAPI_PAGE_CPDF_STREAMPARSER_H_
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<ByteStringPool>& pPool)
- : m_pPool(pPool) {}
+CPDF_Array::CPDF_Array(const WeakPtr<ByteStringPool>& 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<std::unique_ptr<CPDF_Object>>::const_iterator;
CPDF_Array();
- explicit CPDF_Array(const CFX_WeakPtr<ByteStringPool>& pPool);
+ explicit CPDF_Array(const WeakPtr<ByteStringPool>& pPool);
~CPDF_Array() override;
// CPDF_Object:
@@ -112,7 +112,7 @@ class CPDF_Array : public CPDF_Object {
std::set<const CPDF_Object*>* pVisited) const override;
std::vector<std::unique_ptr<CPDF_Object>> m_Objects;
- CFX_WeakPtr<ByteStringPool> m_pPool;
+ WeakPtr<ByteStringPool> 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<ByteStringPool>()) {}
+ : CPDF_Dictionary(WeakPtr<ByteStringPool>()) {}
-CPDF_Dictionary::CPDF_Dictionary(const CFX_WeakPtr<ByteStringPool>& pPool)
+CPDF_Dictionary::CPDF_Dictionary(const WeakPtr<ByteStringPool>& 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 <utility>
#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<ByteString, std::unique_ptr<CPDF_Object>>::const_iterator;
CPDF_Dictionary();
- explicit CPDF_Dictionary(const CFX_WeakPtr<ByteStringPool>& pPool);
+ explicit CPDF_Dictionary(const WeakPtr<ByteStringPool>& 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<ByteStringPool> GetByteStringPool() const { return m_pPool; }
+ WeakPtr<ByteStringPool> 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<const CPDF_Object*>* visited) const override;
- CFX_WeakPtr<ByteStringPool> m_pPool;
+ WeakPtr<ByteStringPool> m_pPool;
std::map<ByteString, std::unique_ptr<CPDF_Object>> 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 <vector>
#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<ByteStringPool> GetByteStringPool() const {
+ WeakPtr<ByteStringPool> GetByteStringPool() const {
return m_pByteStringPool;
}
@@ -72,7 +72,7 @@ class CPDF_IndirectObjectHolder {
uint32_t m_LastObjNum;
std::map<uint32_t, std::unique_ptr<CPDF_Object>> m_IndirectObjs;
std::vector<std::unique_ptr<CPDF_Object>> m_OrphanObjs;
- CFX_WeakPtr<ByteStringPool> m_pByteStringPool;
+ WeakPtr<ByteStringPool> 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<ByteStringPool> pPool, const ByteString& str)
+CPDF_Name::CPDF_Name(WeakPtr<ByteStringPool> 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 <memory>
#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<ByteStringPool> pPool, const ByteString& str);
+ CPDF_Name(WeakPtr<ByteStringPool> 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<ByteStringPool> pPool,
+CPDF_String::CPDF_String(WeakPtr<ByteStringPool> pPool,
const ByteString& str,
bool bHex)
: m_String(str), m_bHex(bHex) {
@@ -22,8 +22,7 @@ CPDF_String::CPDF_String(CFX_WeakPtr<ByteStringPool> pPool,
m_String = pPool->Intern(m_String);
}
-CPDF_String::CPDF_String(CFX_WeakPtr<ByteStringPool> pPool,
- const WideString& str)
+CPDF_String::CPDF_String(WeakPtr<ByteStringPool> 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 <memory>
#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<ByteStringPool> pPool,
- const ByteString& str,
- bool bHex);
- CPDF_String(CFX_WeakPtr<ByteStringPool> pPool, const WideString& str);
+ CPDF_String(WeakPtr<ByteStringPool> pPool, const ByteString& str, bool bHex);
+ CPDF_String(WeakPtr<ByteStringPool> 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<ByteStringPool>()) {}
+ : CPDF_SyntaxParser(WeakPtr<ByteStringPool>()) {}
-CPDF_SyntaxParser::CPDF_SyntaxParser(const CFX_WeakPtr<ByteStringPool>& pPool)
+CPDF_SyntaxParser::CPDF_SyntaxParser(const WeakPtr<ByteStringPool>& 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 <algorithm>
#include <memory>
-#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<ByteStringPool>& pPool);
+ explicit CPDF_SyntaxParser(const WeakPtr<ByteStringPool>& pPool);
~CPDF_SyntaxParser();
void InitParser(const RetainPtr<IFX_SeekableReadStream>& pFileAccess,
@@ -121,7 +121,7 @@ class CPDF_SyntaxParser {
RetainPtr<CPDF_CryptoHandler> m_pCryptoHandler;
uint8_t m_WordBuffer[257];
uint32_t m_WordSize;
- CFX_WeakPtr<ByteStringPool> m_pPool;
+ WeakPtr<ByteStringPool> m_pPool;
};
#endif // CORE_FPDFAPI_PARSER_CPDF_SYNTAX_PARSER_H_