diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-23 12:11:20 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-23 17:37:55 +0000 |
commit | 80c487809858b74783a00e05cc8164edf4b1307c (patch) | |
tree | 6aecc491645c428fb298f21b54ef80864a7dd331 /xfa/fxfa/xfa_checksum.h | |
parent | 6bdd824188bc9a2e6b24b5752a3170ce10185c1d (diff) | |
download | pdfium-80c487809858b74783a00e05cc8164edf4b1307c.tar.xz |
Cleanup some xfa/fxfa code.
This CL moves the .h files to have names corresponding to the contained
classes. The .cpp files are moved alongside the .h files. Any extra
classes in the .h files have been split into their own files.
Change-Id: I14b4efc02417f0df946500e87b6c502e77020db8
Reviewed-on: https://pdfium-review.googlesource.com/3160
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/xfa_checksum.h')
-rw-r--r-- | xfa/fxfa/xfa_checksum.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/xfa/fxfa/xfa_checksum.h b/xfa/fxfa/xfa_checksum.h deleted file mode 100644 index 31cf101553..0000000000 --- a/xfa/fxfa/xfa_checksum.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FXFA_XFA_CHECKSUM_H_ -#define XFA_FXFA_XFA_CHECKSUM_H_ - -#include <memory> - -#include "core/fdrm/crypto/fx_crypt.h" -#include "xfa/fde/xml/cfx_saxreader.h" -#include "xfa/fxfa/fxfa.h" - -class CXFA_SAXReaderHandler; -class CXFA_ChecksumContext; - -class CXFA_SAXContext { - public: - CXFA_SAXContext() : m_eNode(CFX_SAXItem::Type::Unknown) {} - - CFX_ByteTextBuf m_TextBuf; - CFX_ByteString m_bsTagName; - CFX_SAXItem::Type m_eNode; -}; - -class CXFA_SAXReaderHandler { - public: - explicit CXFA_SAXReaderHandler(CXFA_ChecksumContext* pContext); - ~CXFA_SAXReaderHandler(); - - CXFA_SAXContext* OnTagEnter(const CFX_ByteStringC& bsTagName, - CFX_SAXItem::Type eType, - uint32_t dwStartPos); - void OnTagAttribute(CXFA_SAXContext* pTag, - const CFX_ByteStringC& bsAttri, - const CFX_ByteStringC& bsValue); - void OnTagBreak(CXFA_SAXContext* pTag); - void OnTagData(CXFA_SAXContext* pTag, - CFX_SAXItem::Type eType, - const CFX_ByteStringC& bsData, - uint32_t dwStartPos); - void OnTagClose(CXFA_SAXContext* pTag, uint32_t dwEndPos); - void OnTagEnd(CXFA_SAXContext* pTag, - const CFX_ByteStringC& bsTagName, - uint32_t dwEndPos); - - void OnTargetData(CXFA_SAXContext* pTag, - CFX_SAXItem::Type eType, - const CFX_ByteStringC& bsData, - uint32_t dwStartPos); - - protected: - void UpdateChecksum(bool bCheckSpace); - - CXFA_ChecksumContext* m_pContext; - CXFA_SAXContext m_SAXContext; -}; - -class CXFA_ChecksumContext { - public: - CXFA_ChecksumContext(); - ~CXFA_ChecksumContext(); - - void StartChecksum(); - void Update(const CFX_ByteStringC& bsText); - bool UpdateChecksum(const CFX_RetainPtr<IFX_SeekableReadStream>& pSrcFile, - FX_FILESIZE offset = 0, - size_t size = 0); - void FinishChecksum(); - CFX_ByteString GetChecksum() const; - - protected: - std::unique_ptr<CFX_SAXReader> m_pSAXReader; - std::unique_ptr<CRYPT_sha1_context> m_pByteContext; - CFX_ByteString m_bsChecksum; -}; - -#endif // XFA_FXFA_XFA_CHECKSUM_H_ |