summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/xml_int.h
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-07-08 15:30:46 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-07-08 15:30:46 -0700
commit3522876d5291922ddc62bf1b70d02743b0850673 (patch)
treeb3fd7eda6e8ed8f07674f6a6fba21e82ca83bee7 /core/src/fxcrt/xml_int.h
parente7ee98e4c6fd56c9e930194e9fc11cc10e8293a1 (diff)
downloadpdfium-3522876d5291922ddc62bf1b70d02743b0850673.tar.xz
Remove custom memory manager
BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003
Diffstat (limited to 'core/src/fxcrt/xml_int.h')
-rw-r--r--core/src/fxcrt/xml_int.h38
1 files changed, 12 insertions, 26 deletions
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index 09737893af..1f75928e51 100644
--- a/core/src/fxcrt/xml_int.h
+++ b/core/src/fxcrt/xml_int.h
@@ -1,7 +1,7 @@
// 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 _FXCRT_XML_INT_
@@ -9,9 +9,8 @@
class CXML_DataBufAcc : public IFX_BufferRead, public CFX_Object
{
public:
- CXML_DataBufAcc(FX_LPCBYTE pBuffer, size_t size, IFX_Allocator* pAllocator = NULL)
- : m_pAllocator(pAllocator)
- , m_pBuffer(pBuffer)
+ CXML_DataBufAcc(FX_LPCBYTE pBuffer, size_t size)
+ : m_pBuffer(pBuffer)
, m_dwSize(size)
, m_dwCurPos(0)
{
@@ -19,11 +18,7 @@ public:
virtual ~CXML_DataBufAcc() {}
virtual void Release()
{
- if (m_pAllocator) {
- FX_DeleteAtAllocator(this, m_pAllocator, CXML_DataBufAcc);
- } else {
- delete this;
- }
+ delete this;
}
virtual FX_BOOL IsEOF()
{
@@ -61,7 +56,6 @@ public:
return 0;
}
protected:
- IFX_Allocator* m_pAllocator;
FX_LPCBYTE m_pBuffer;
size_t m_dwSize;
size_t m_dwCurPos;
@@ -70,9 +64,8 @@ protected:
class CXML_DataStmAcc : public IFX_BufferRead, public CFX_Object
{
public:
- CXML_DataStmAcc(IFX_FileRead *pFileRead, IFX_Allocator* pAllocator = NULL)
- : m_pAllocator(pAllocator)
- , m_pFileRead(pFileRead)
+ CXML_DataStmAcc(IFX_FileRead *pFileRead)
+ : m_pFileRead(pFileRead)
, m_pBuffer(NULL)
, m_nStart(0)
, m_dwSize(0)
@@ -82,16 +75,12 @@ public:
virtual ~CXML_DataStmAcc()
{
if (m_pBuffer) {
- FX_Allocator_Free(m_pAllocator, m_pBuffer);
+ FX_Free(m_pBuffer);
}
}
virtual void Release()
{
- if (m_pAllocator) {
- FX_DeleteAtAllocator(this, m_pAllocator, CXML_DataStmAcc);
- } else {
- delete this;
- }
+ delete this;
}
virtual FX_BOOL IsEOF()
{
@@ -117,7 +106,7 @@ public:
}
m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart);
if (!m_pBuffer) {
- m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_dwSize);
+ m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize);
if (!m_pBuffer) {
return FALSE;
}
@@ -137,7 +126,6 @@ public:
return m_nStart;
}
protected:
- IFX_Allocator* m_pAllocator;
IFX_FileRead *m_pFileRead;
FX_LPBYTE m_pBuffer;
FX_FILESIZE m_nStart;
@@ -146,9 +134,7 @@ protected:
class CXML_Parser
{
public:
- CXML_Parser(IFX_Allocator* pAllocator = NULL) : m_pAllocator(pAllocator) {}
~CXML_Parser();
- IFX_Allocator* m_pAllocator;
IFX_BufferRead* m_pDataAcc;
FX_BOOL m_bOwnedStream;
FX_FILESIZE m_nOffset;
@@ -165,10 +151,10 @@ public:
FX_BOOL IsEOF();
FX_BOOL HaveAvailData();
void SkipWhiteSpaces();
- void GetName(CFX_ByteStringL &space, CFX_ByteStringL &name);
- void GetAttrValue(CFX_WideStringL &value);
+ void GetName(CFX_ByteString& space, CFX_ByteString& name);
+ void GetAttrValue(CFX_WideString &value);
FX_DWORD GetCharRef();
- void GetTagName(CFX_ByteStringL &space, CFX_ByteStringL &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE);
+ void GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE);
void SkipLiterals(FX_BSTR str);
CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE);
void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Element* pElement);