summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_dictionary.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-04 11:38:40 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-04 11:38:40 -0700
commit33fdebc3da676bff84d0fd0f69b9087c0c12dfeb (patch)
tree274499f6bc4df60ebb57a52bf78b82180ea52295 /core/fpdfapi/parser/cpdf_dictionary.h
parent761eed284e1248f851fbb23beaa45835b644ecee (diff)
downloadpdfium-33fdebc3da676bff84d0fd0f69b9087c0c12dfeb.tar.xz
Reland "Remove CPDF_Object::Release() in favor of direct delete"
This reverts commit f0d5b6c35fa343108a3ab7a25bc2cc2b3cf105b3. Review-Url: https://codereview.chromium.org/2478303002
Diffstat (limited to 'core/fpdfapi/parser/cpdf_dictionary.h')
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h
index fb8200f78c..4ef2f96ce7 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.h
+++ b/core/fpdfapi/parser/cpdf_dictionary.h
@@ -26,6 +26,7 @@ class CPDF_Dictionary : public CPDF_Object {
CPDF_Dictionary();
explicit CPDF_Dictionary(const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
+ ~CPDF_Dictionary() override;
// CPDF_Object.
Type GetType() const override;
@@ -88,8 +89,6 @@ class CPDF_Dictionary : public CPDF_Object {
CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; }
protected:
- ~CPDF_Dictionary() override;
-
CFX_ByteString MaybeIntern(const CFX_ByteString& str);
CPDF_Object* CloneNonCyclic(
bool bDirect,
@@ -99,9 +98,6 @@ class CPDF_Dictionary : public CPDF_Object {
std::map<CFX_ByteString, CPDF_Object*> m_Map;
};
-using UniqueDictionary =
- std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Object>>;
-
inline CPDF_Dictionary* ToDictionary(CPDF_Object* obj) {
return obj ? obj->AsDictionary() : nullptr;
}
@@ -110,12 +106,13 @@ inline const CPDF_Dictionary* ToDictionary(const CPDF_Object* obj) {
return obj ? obj->AsDictionary() : nullptr;
}
-inline UniqueDictionary ToDictionary(UniqueObject obj) {
+inline std::unique_ptr<CPDF_Dictionary> ToDictionary(
+ std::unique_ptr<CPDF_Object> obj) {
CPDF_Dictionary* pDict = ToDictionary(obj.get());
if (!pDict)
return nullptr;
obj.release();
- return UniqueDictionary(pDict);
+ return std::unique_ptr<CPDF_Dictionary>(pDict);
}
#endif // CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_