summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.cpp
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-10-03 18:10:10 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-10-03 16:09:25 +0000
commit6caef3028fd5ce9751fb246b084ad0e139aa9c77 (patch)
tree2279a9a55eb913344241d3aec44c572006d2c9de /core/fpdfapi/parser/cpdf_parser.cpp
parent97538d86576da009ea3f40546cd5e8a49d6126a3 (diff)
downloadpdfium-6caef3028fd5ce9751fb246b084ad0e139aa9c77.tar.xz
Change the ownership of the CPDF_CryptoHandler.
Change-Id: I3ae8337c1a77063470eb5baa97db62ea2e90688b Reviewed-on: https://pdfium-review.googlesource.com/15230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 336e6625b5..1965146728 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -155,8 +155,8 @@ void CPDF_Parser::SetEncryptDictionary(CPDF_Dictionary* pDict) {
m_pEncryptDict = pDict;
}
-RetainPtr<CPDF_CryptoHandler> CPDF_Parser::GetCryptoHandler() const {
- return m_pCryptoHandler;
+CPDF_CryptoHandler* CPDF_Parser::GetCryptoHandler() const {
+ return m_pCryptoHandler.get();
}
RetainPtr<IFX_SeekableReadStream> CPDF_Parser::GetFileAccess() const {
@@ -315,16 +315,16 @@ CPDF_Parser::Error CPDF_Parser::SetEncryptHandler() {
return PASSWORD_ERROR;
m_pSecurityHandler = std::move(pSecurityHandler);
- auto pCryptoHandler = pdfium::MakeRetain<CPDF_CryptoHandler>();
+ auto pCryptoHandler = pdfium::MakeUnique<CPDF_CryptoHandler>();
if (!pCryptoHandler->Init(m_pEncryptDict.Get(), m_pSecurityHandler.get()))
return HANDLER_ERROR;
- m_pCryptoHandler = pCryptoHandler;
+ m_pCryptoHandler = std::move(pCryptoHandler);
}
return SUCCESS;
}
void CPDF_Parser::ReleaseEncryptHandler() {
- m_pCryptoHandler.Reset();
+ m_pCryptoHandler.reset();
m_pSecurityHandler.reset();
SetEncryptDictionary(nullptr);
}