summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2015-10-23 17:56:38 -0700
committerOliver Chang <ochang@chromium.org>2015-10-23 17:56:38 -0700
commitbef190fcacb7dde4fedc1360e3019ab9968db16a (patch)
tree0f6cd438ca5992dc1673580bdfb842426b9547d9 /core/include/fpdfapi
parentf0863b6d27ab216f93cf14ccc31841bf83962791 (diff)
downloadpdfium-bef190fcacb7dde4fedc1360e3019ab9968db16a.tar.xz
Convert some pointers in fpdf_parser_parser to unique_ptr and std::vector.
R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1411043003 .
Diffstat (limited to 'core/include/fpdfapi')
-rw-r--r--core/include/fpdfapi/fpdf_parser.h15
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;