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

Unified Diff: xfa/fxfa/app/xfa_checksum.cpp

Issue 1930533002: More IFX_ interface cleanup. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 | « xfa/fwl/theme/cfwl_widgettp.cpp ('k') | xfa/fxfa/app/xfa_ffapp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_checksum.cpp
diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp
index 59bf37b6a5ba795f3ecdf65a83d1fb1b9c2b9c64..195033bfab8c85bde5be4330c2c6ffc5550fc1d3 100644
--- a/xfa/fxfa/app/xfa_checksum.cpp
+++ b/xfa/fxfa/app/xfa_checksum.cpp
@@ -126,30 +126,28 @@ void CXFA_SAXReaderHandler::UpdateChecksum(FX_BOOL bCheckSpace) {
}
CXFA_ChecksumContext::CXFA_ChecksumContext()
- : m_pSAXReader(NULL), m_pByteContext(NULL) {}
+ : m_pSAXReader(nullptr), m_pByteContext(nullptr) {}
+
CXFA_ChecksumContext::~CXFA_ChecksumContext() {
FinishChecksum();
}
-FX_BOOL CXFA_ChecksumContext::StartChecksum() {
+
+void CXFA_ChecksumContext::StartChecksum() {
FinishChecksum();
m_pByteContext = FX_Alloc(uint8_t, 128);
CRYPT_SHA1Start(m_pByteContext);
m_bsChecksum.clear();
- m_pSAXReader = FX_SAXReader_Create();
- return m_pSAXReader != NULL;
+ m_pSAXReader = new CFX_SAXReader;
}
+
FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_FileRead* pSrcFile,
FX_FILESIZE offset,
size_t size) {
- if (m_pSAXReader == NULL) {
- return FALSE;
- }
- if (pSrcFile == NULL) {
+ if (!m_pSAXReader || !pSrcFile)
return FALSE;
- }
- if (size < 1) {
+ if (size < 1)
size = pSrcFile->GetSize();
- }
+
CXFA_SAXReaderHandler handler(this);
m_pSAXReader->SetHandler(&handler);
if (m_pSAXReader->StartParse(
@@ -161,6 +159,7 @@ FX_BOOL CXFA_ChecksumContext::UpdateChecksum(IFX_FileRead* pSrcFile,
}
return m_pSAXReader->ContinueParse(NULL) > 99;
}
+
void CXFA_ChecksumContext::FinishChecksum() {
if (m_pSAXReader) {
m_pSAXReader->Release();
« no previous file with comments | « xfa/fwl/theme/cfwl_widgettp.cpp ('k') | xfa/fxfa/app/xfa_ffapp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698