summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-05-04 12:09:52 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-04 16:24:55 +0000
commitdf673c28191cca181ef526d02f24b4a7a6f5e200 (patch)
tree8fe9304aa58e3c0045bba5140f6b6fbb322d7ea7 /core/fxcrt
parentc5fc83c50dee0968bd3c16e69ca84300531c6391 (diff)
downloadpdfium-df673c28191cca181ef526d02f24b4a7a6f5e200.tar.xz
Cleanup more null IFX_Pause parameters
This Cl cleans up more IFX_Pause parameters which are always null. Change-Id: Ia48600f06216db64a2db8e6e97222a91bd4ba149 Reviewed-on: https://pdfium-review.googlesource.com/4890 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/cfx_checksumcontext.cpp2
-rw-r--r--core/fxcrt/xml/cfx_saxreader.cpp12
-rw-r--r--core/fxcrt/xml/cfx_saxreader.h2
-rw-r--r--core/fxcrt/xml/cfx_saxreader_unittest.cpp2
-rw-r--r--core/fxcrt/xml/cfx_xmldoc.cpp4
-rw-r--r--core/fxcrt/xml/cfx_xmldoc.h2
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.cpp5
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.h3
8 files changed, 12 insertions, 20 deletions
diff --git a/core/fxcrt/cfx_checksumcontext.cpp b/core/fxcrt/cfx_checksumcontext.cpp
index 97d0af2d75..eb20db69ec 100644
--- a/core/fxcrt/cfx_checksumcontext.cpp
+++ b/core/fxcrt/cfx_checksumcontext.cpp
@@ -122,7 +122,7 @@ bool CFX_ChecksumContext::UpdateChecksum(
CFX_SaxParseMode_NotConvert_sharp) < 0) {
return false;
}
- return m_pSAXReader->ContinueParse(nullptr) > 99;
+ return m_pSAXReader->ContinueParse() > 99;
}
void CFX_ChecksumContext::FinishChecksum() {
diff --git a/core/fxcrt/xml/cfx_saxreader.cpp b/core/fxcrt/xml/cfx_saxreader.cpp
index c345c0c038..42bf510c19 100644
--- a/core/fxcrt/xml/cfx_saxreader.cpp
+++ b/core/fxcrt/xml/cfx_saxreader.cpp
@@ -203,10 +203,10 @@ int32_t CFX_SAXReader::StartParse(
return 0;
}
-int32_t CFX_SAXReader::ContinueParse(IFX_Pause* pPause) {
- if (m_iState < 0 || m_iState > 99) {
+int32_t CFX_SAXReader::ContinueParse() {
+ if (m_iState < 0 || m_iState > 99)
return m_iState;
- }
+
while (m_File.m_dwCur < m_File.m_dwEnd) {
uint32_t& index = m_File.m_dwBufIndex;
uint32_t size = m_File.m_dwBufSize;
@@ -219,17 +219,13 @@ int32_t CFX_SAXReader::ContinueParse(IFX_Pause* pPause) {
m_File.m_dwCur += index;
m_iState = (m_File.m_dwCur - m_File.m_dwStart) * 100 /
(m_File.m_dwEnd - m_File.m_dwStart);
- if (m_File.m_dwCur >= m_File.m_dwEnd) {
+ if (m_File.m_dwCur >= m_File.m_dwEnd)
break;
- }
if (!m_File.ReadNextBlock()) {
m_iState = -2;
break;
}
m_dwDataOffset = 0;
- if (pPause && pPause->NeedToPauseNow()) {
- break;
- }
}
return m_iState;
}
diff --git a/core/fxcrt/xml/cfx_saxreader.h b/core/fxcrt/xml/cfx_saxreader.h
index 47ef79c50f..9f1f324062 100644
--- a/core/fxcrt/xml/cfx_saxreader.h
+++ b/core/fxcrt/xml/cfx_saxreader.h
@@ -101,7 +101,7 @@ class CFX_SAXReader {
uint32_t dwStart = 0,
uint32_t dwLen = -1,
uint32_t dwParseMode = 0);
- int32_t ContinueParse(IFX_Pause* pPause = nullptr);
+ int32_t ContinueParse();
void SetHandler(HandlerIface* pHandler) { m_pHandler = pHandler; }
private:
diff --git a/core/fxcrt/xml/cfx_saxreader_unittest.cpp b/core/fxcrt/xml/cfx_saxreader_unittest.cpp
index dca93b3a16..62828500c9 100644
--- a/core/fxcrt/xml/cfx_saxreader_unittest.cpp
+++ b/core/fxcrt/xml/cfx_saxreader_unittest.cpp
@@ -61,7 +61,7 @@ class CFX_SAXReaderTest : public testing::Test {
int32_t ContinueParse() {
int32_t ret;
do {
- ret = reader_.ContinueParse(nullptr);
+ ret = reader_.ContinueParse();
} while (ret >= 0 && ret < 100);
return ret;
}
diff --git a/core/fxcrt/xml/cfx_xmldoc.cpp b/core/fxcrt/xml/cfx_xmldoc.cpp
index 4f58da91f2..6fce38cea6 100644
--- a/core/fxcrt/xml/cfx_xmldoc.cpp
+++ b/core/fxcrt/xml/cfx_xmldoc.cpp
@@ -36,9 +36,9 @@ bool CFX_XMLDoc::LoadXML(std::unique_ptr<CFX_XMLParser> pXMLParser) {
return true;
}
-int32_t CFX_XMLDoc::DoLoad(IFX_Pause* pPause) {
+int32_t CFX_XMLDoc::DoLoad() {
if (m_iStatus < 100)
- m_iStatus = m_pXMLParser->DoParser(pPause);
+ m_iStatus = m_pXMLParser->DoParser();
return m_iStatus;
}
diff --git a/core/fxcrt/xml/cfx_xmldoc.h b/core/fxcrt/xml/cfx_xmldoc.h
index 5966c096ba..c182504f6f 100644
--- a/core/fxcrt/xml/cfx_xmldoc.h
+++ b/core/fxcrt/xml/cfx_xmldoc.h
@@ -20,7 +20,7 @@ class CFX_XMLDoc {
~CFX_XMLDoc();
bool LoadXML(std::unique_ptr<CFX_XMLParser> pXMLParser);
- int32_t DoLoad(IFX_Pause* pPause);
+ int32_t DoLoad();
void CloseXML();
CFX_XMLNode* GetRoot() const { return m_pRoot.get(); }
diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp
index 0e328f33ea..884f6fc477 100644
--- a/core/fxcrt/xml/cfx_xmlparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlparser.cpp
@@ -31,7 +31,7 @@ CFX_XMLParser::CFX_XMLParser(
CFX_XMLParser::~CFX_XMLParser() {}
-int32_t CFX_XMLParser::DoParser(IFX_Pause* pPause) {
+int32_t CFX_XMLParser::DoParser() {
if (m_syntaxParserResult == FX_XmlSyntaxResult::Error)
return -1;
if (m_syntaxParserResult == FX_XmlSyntaxResult::EndOfString)
@@ -160,9 +160,6 @@ int32_t CFX_XMLParser::DoParser(IFX_Pause* pPause) {
m_syntaxParserResult == FX_XmlSyntaxResult::EndOfString) {
break;
}
- if (pPause && iCount > 500 && pPause->NeedToPauseNow()) {
- break;
- }
}
return (m_syntaxParserResult == FX_XmlSyntaxResult::Error ||
m_NodeStack.size() != 1)
diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h
index dc3cc4c297..9746d78ae8 100644
--- a/core/fxcrt/xml/cfx_xmlparser.h
+++ b/core/fxcrt/xml/cfx_xmlparser.h
@@ -17,7 +17,6 @@
class CFX_XMLElement;
class CFX_XMLNode;
class CFX_SeekableStreamProxy;
-class IFX_Pause;
class CFX_XMLParser {
public:
@@ -25,7 +24,7 @@ class CFX_XMLParser {
const CFX_RetainPtr<CFX_SeekableStreamProxy>& pStream);
~CFX_XMLParser();
- int32_t DoParser(IFX_Pause* pPause);
+ int32_t DoParser();
FX_FILESIZE m_nStart[2];
size_t m_nSize[2];