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

Unified Diff: core/src/fxcrt/fx_xml_parser.cpp

Issue 1052553006: Remove checks in fxcrt now that FX_NEW can't return 0. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 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 | « core/src/fxcrt/fx_basic_util.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_xml_parser.cpp
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 8049a5587e65566f99480f63978122082f617e9a..2c069cb132407b6daaddc4b8c2cf73b172d82cbc 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -14,18 +14,12 @@ CXML_Parser::~CXML_Parser()
}
FX_BOOL CXML_Parser::Init(FX_LPBYTE pBuffer, size_t size)
{
- m_pDataAcc = FX_NEW CXML_DataBufAcc(pBuffer, size);
- if (!m_pDataAcc) {
- return FALSE;
- }
+ m_pDataAcc = new CXML_DataBufAcc(pBuffer, size);
return Init(TRUE);
}
FX_BOOL CXML_Parser::Init(IFX_FileRead *pFileRead)
{
- m_pDataAcc = FX_NEW CXML_DataStmAcc(pFileRead);
- if (!m_pDataAcc) {
- return FALSE;
- }
+ m_pDataAcc = new CXML_DataStmAcc(pFileRead);
return Init(TRUE);
}
FX_BOOL CXML_Parser::Init(IFX_BufferRead *pBuffer)
@@ -377,15 +371,9 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag
if (tag_name.IsEmpty() || bEndTag) {
return NULL;
}
- CXML_Element* pElement;
- pElement = FX_NEW CXML_Element;
- if (pElement) {
- pElement->m_pParent = pParent;
- pElement->SetTag(tag_space, tag_name);
- }
- if (!pElement) {
- return NULL;
- }
+ CXML_Element* pElement = new CXML_Element;
+ pElement->m_pParent = pParent;
+ pElement->SetTag(tag_space, tag_name);
do {
CFX_ByteString attr_space, attr_name;
while (m_dwIndex < m_dwBufferSize) {
@@ -529,11 +517,7 @@ void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Ele
if (content.IsEmpty()) {
return;
}
- CXML_Content* pContent;
- pContent = FX_NEW CXML_Content;
- if (!pContent) {
- return;
- }
+ CXML_Content* pContent = new CXML_Content;
pContent->Set(bCDATA, content);
pElement->m_Children.Add((FX_LPVOID)CXML_Element::Content);
pElement->m_Children.Add(pContent);
@@ -818,10 +802,7 @@ void CXML_AttrMap::SetAt(FX_BSTR space, FX_BSTR name, FX_WSTR value)
}
}
if (!m_pMap) {
- m_pMap = FX_NEW CFX_ObjectArray < CXML_AttrItem > ;
- }
- if (!m_pMap) {
- return;
+ m_pMap = new CFX_ObjectArray<CXML_AttrItem>;
}
CXML_AttrItem* pItem = (CXML_AttrItem*)m_pMap->AddSpace();
if (!pItem) {
« no previous file with comments | « core/src/fxcrt/fx_basic_util.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698