summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2018-07-18 03:42:38 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-18 03:42:38 +0000
commita18536af5b32b63f795d8b5812a4303c7ee6ea97 (patch)
tree6522c1588f4ad073486abc9ef789bdedb0bd1357 /core/fpdfapi/parser/cpdf_parser.h
parent89063ecda876e3be7df5935860235eb5f8199ded (diff)
downloadpdfium-a18536af5b32b63f795d8b5812a4303c7ee6ea97.tar.xz
Make CPDF_Parser::GetTrailer const method.
Use own copy of encryption dictionary within CPDF_Parser, to prevent modification of original trailer. Change-Id: I6246b872d431b94411fcec694c5176f8d85dfe26 Reviewed-on: https://pdfium-review.googlesource.com/35450 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index c998063394..e9b2a760ea 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -64,7 +64,7 @@ class CPDF_Parser {
void SetPassword(const char* password) { m_Password = password; }
ByteString GetPassword() const { return m_Password; }
- CPDF_Dictionary* GetTrailer() const;
+ const CPDF_Dictionary* GetTrailer() const;
// Returns a new trailer which combines the last read trailer with the /Root
// and /Info from previous ones.
@@ -78,7 +78,7 @@ class CPDF_Parser {
const CPDF_Array* GetIDArray() const;
CPDF_Dictionary* GetRoot() const;
- CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict.Get(); }
+ CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict.get(); }
std::unique_ptr<CPDF_Object> ParseIndirectObject(uint32_t objnum);
@@ -159,7 +159,7 @@ class CPDF_Parser {
Error LoadLinearizedMainXRefTable();
const CPDF_ObjectStream* GetObjectStream(uint32_t object_number);
std::unique_ptr<CPDF_LinearizedHeader> ParseLinearizedHeader();
- void SetEncryptDictionary(CPDF_Dictionary* pDict);
+ void SetEncryptDictionary(const CPDF_Dictionary* pDict);
void ShrinkObjectMap(uint32_t size);
// A simple check whether the cross reference table matches with
// the objects.
@@ -190,7 +190,7 @@ class CPDF_Parser {
// m_TrailerData must be destroyed after m_pSecurityHandler due to the
// ownership of the ID array data.
std::unique_ptr<TrailerData> m_TrailerData;
- UnownedPtr<CPDF_Dictionary> m_pEncryptDict;
+ std::unique_ptr<CPDF_Dictionary> m_pEncryptDict;
FX_FILESIZE m_LastXRefOffset;
std::unique_ptr<CPDF_SecurityHandler> m_pSecurityHandler;
ByteString m_Password;