Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: core/include/fpdfapi/fpdf_parser.h

Issue 1411043003: Convert some pointers in fpdf_parser_parser to unique_ptr and std::vector. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix derp Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfapi/fpdf_parser.h
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 04c7d90f6fc067cae49787f340f27f41ecd0840b..a5fce34fd7630b3efa990b262cd9fb6e16375107 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;
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698