| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FXFA_XFA_CHECKSUM_H_ | 7 #ifndef XFA_FXFA_XFA_CHECKSUM_H_ |
| 8 #define XFA_FXFA_XFA_CHECKSUM_H_ | 8 #define XFA_FXFA_XFA_CHECKSUM_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "core/fdrm/crypto/fx_crypt.h" | 12 #include "core/fdrm/crypto/fx_crypt.h" |
| 11 #include "xfa/fde/xml/cfx_saxreader.h" | 13 #include "xfa/fde/xml/cfx_saxreader.h" |
| 12 #include "xfa/fxfa/fxfa.h" | 14 #include "xfa/fxfa/fxfa.h" |
| 13 | 15 |
| 14 class CXFA_SAXReaderHandler; | 16 class CXFA_SAXReaderHandler; |
| 15 class CXFA_ChecksumContext; | 17 class CXFA_ChecksumContext; |
| 16 | 18 |
| 17 class CXFA_SAXContext { | 19 class CXFA_SAXContext { |
| 18 public: | 20 public: |
| 19 CXFA_SAXContext() : m_eNode(CFX_SAXItem::Type::Unknown) {} | 21 CXFA_SAXContext() : m_eNode(CFX_SAXItem::Type::Unknown) {} |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 65 |
| 64 void StartChecksum(); | 66 void StartChecksum(); |
| 65 void Update(const CFX_ByteStringC& bsText); | 67 void Update(const CFX_ByteStringC& bsText); |
| 66 bool UpdateChecksum(const CFX_RetainPtr<IFX_SeekableReadStream>& pSrcFile, | 68 bool UpdateChecksum(const CFX_RetainPtr<IFX_SeekableReadStream>& pSrcFile, |
| 67 FX_FILESIZE offset = 0, | 69 FX_FILESIZE offset = 0, |
| 68 size_t size = 0); | 70 size_t size = 0); |
| 69 void FinishChecksum(); | 71 void FinishChecksum(); |
| 70 CFX_ByteString GetChecksum() const; | 72 CFX_ByteString GetChecksum() const; |
| 71 | 73 |
| 72 protected: | 74 protected: |
| 73 CFX_SAXReader* m_pSAXReader; | 75 std::unique_ptr<CFX_SAXReader> m_pSAXReader; |
| 74 CRYPT_sha1_context* m_pByteContext; | 76 std::unique_ptr<CRYPT_sha1_context> m_pByteContext; |
| 75 CFX_ByteString m_bsChecksum; | 77 CFX_ByteString m_bsChecksum; |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 #endif // XFA_FXFA_XFA_CHECKSUM_H_ | 80 #endif // XFA_FXFA_XFA_CHECKSUM_H_ |
| OLD | NEW |