summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlparser.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-04-24 18:03:27 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-24 18:03:27 +0000
commit6453a67d84dc321a5f28728e04929dc2ff35ff88 (patch)
treee2bc524cf9cea16aff853e4ed7afed11efa8fd20 /core/fxcrt/xml/cfx_xmlparser.h
parentdf96bf69f22d63a0ab6c5e48556682b0532c3079 (diff)
downloadpdfium-6453a67d84dc321a5f28728e04929dc2ff35ff88.tar.xz
Remove CFX_BlockBufferchromium/3406
This CL removes the usage of CFX_BlockBuffer from CFX_XMLParser. The block buffer has been replaced by a vector which is emptied out after the characters are removed. This should use less memory when parsing XML as the block buffer was previously storing all text characters seen in the file. Change-Id: I89568c664c762bb9feb034348524e5e86c2d9078 Reviewed-on: https://pdfium-review.googlesource.com/31275 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlparser.h')
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h
index 503852753f..6121f0c1dc 100644
--- a/core/fxcrt/xml/cfx_xmlparser.h
+++ b/core/fxcrt/xml/cfx_xmlparser.h
@@ -11,7 +11,6 @@
#include <stack>
#include <vector>
-#include "core/fxcrt/cfx_blockbuffer.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/xml/cfx_xmlnode.h"
@@ -50,7 +49,7 @@ class CFX_XMLParser {
protected:
FX_XmlSyntaxResult DoSyntaxParse();
- WideString GetTextData() const;
+ WideString GetTextData();
private:
enum class FDE_XmlSyntaxState {
@@ -81,7 +80,7 @@ class CFX_XMLParser {
CFX_XMLNode* m_pParent;
CFX_XMLNode* m_pChild = nullptr;
- WideString m_ws1;
+ WideString current_attribute_name_;
RetainPtr<IFX_SeekableReadStream> m_pStream;
FX_FILESIZE m_Start = 0; // Start position in m_Buffer
FX_FILESIZE m_End = 0; // End position in m_Buffer
@@ -92,11 +91,8 @@ class CFX_XMLParser {
std::stack<FX_XMLNODETYPE> m_XMLNodeTypeStack;
std::stack<wchar_t> m_SkipStack;
std::vector<wchar_t> m_Buffer;
- CFX_BlockBuffer m_BlockBuffer;
- wchar_t* m_pCurrentBlock = nullptr; // Pointer into CFX_BlockBuffer
- size_t m_iIndexInBlock = 0;
+ std::vector<wchar_t> current_text_;
size_t m_iXMLPlaneSize = 1024;
- int32_t m_iTextDataLength = 0;
int32_t m_iEntityStart = -1;
wchar_t m_wQuotationMark = 0;
wchar_t m_SkipChar = 0;