diff options
author | Oliver Chang <ochang@chromium.org> | 2015-10-23 18:16:06 -0700 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2015-10-23 18:16:06 -0700 |
commit | d0c02bb2d185333768885ff9325badc23bd044ef (patch) | |
tree | 268db125f5289bb51e8388636df307b062bc6d45 /core/include | |
parent | 8844560e7f1e7669fbeee0ccd48e99ab1882e3e7 (diff) | |
download | pdfium-d0c02bb2d185333768885ff9325badc23bd044ef.tar.xz |
Merge to XFA: Convert some pointers in fpdf_parser_parser to unique_ptr and std::vector.
Clean merge.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1411043003 .
(cherry picked from commit bef190fcacb7dde4fedc1360e3019ab9968db16a)
Review URL: https://codereview.chromium.org/1418223004 .
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/fpdfapi/fpdf_parser.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h index 04c7d90f6f..a5fce34fd7 100644 --- a/core/include/fpdfapi/fpdf_parser.h +++ b/core/include/fpdfapi/fpdf_parser.h @@ -7,6 +7,7 @@ #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ +#include "../../../third_party/base/nonstd_unique_ptr.h" #include "../fxcrt/fx_system.h" #include "fpdf_objects.h" @@ -270,7 +271,7 @@ class CPDF_SyntaxParser { FX_FILESIZE FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit); void SetEncrypt(CPDF_CryptoHandler* pCryptoHandler) { - m_pCryptoHandler = pCryptoHandler; + m_pCryptoHandler.reset(pCryptoHandler); } FX_BOOL IsEncrypted() { return m_pCryptoHandler != NULL; } @@ -326,7 +327,7 @@ class CPDF_SyntaxParser { FX_FILESIZE m_BufOffset; - CPDF_CryptoHandler* m_pCryptoHandler; + nonstd::unique_ptr<CPDF_CryptoHandler> m_pCryptoHandler; uint8_t m_WordBuffer[257]; @@ -375,9 +376,13 @@ class CPDF_Parser { CFX_ByteString GetPassword() { return m_Password; } - CPDF_SecurityHandler* GetSecurityHandler() { return m_pSecurityHandler; } + CPDF_SecurityHandler* GetSecurityHandler() { + return m_pSecurityHandler.get(); + } - CPDF_CryptoHandler* GetCryptoHandler() { return m_Syntax.m_pCryptoHandler; } + CPDF_CryptoHandler* GetCryptoHandler() { + return m_Syntax.m_pCryptoHandler.get(); + } void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE); @@ -495,7 +500,7 @@ class CPDF_Parser { FX_BOOL m_bXRefStream; - CPDF_SecurityHandler* m_pSecurityHandler; + nonstd::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler; FX_BOOL m_bForceUseSecurityHandler; |