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

Side by Side Diff: core/src/fxcrt/xml_int.h

Issue 1145843005: Revert "Remove FX_Alloc() null checks now that it can't return NULL." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « core/src/fxcrt/fxcrt_posix.cpp ('k') | core/src/fxge/agg/agg23/agg_array.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FXCRT_XML_INT_ 7 #ifndef _FXCRT_XML_INT_
8 #define _FXCRT_XML_INT_ 8 #define _FXCRT_XML_INT_
9 class CXML_DataBufAcc : public IFX_BufferRead 9 class CXML_DataBufAcc : public IFX_BufferRead
10 { 10 {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 m_nStart = 0; 100 m_nStart = 0;
101 } 101 }
102 FX_FILESIZE nLength = m_pFileRead->GetSize(); 102 FX_FILESIZE nLength = m_pFileRead->GetSize();
103 m_nStart += (FX_FILESIZE)m_dwSize; 103 m_nStart += (FX_FILESIZE)m_dwSize;
104 if (m_nStart >= nLength) { 104 if (m_nStart >= nLength) {
105 return FALSE; 105 return FALSE;
106 } 106 }
107 m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStar t); 107 m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStar t);
108 if (!m_pBuffer) { 108 if (!m_pBuffer) {
109 m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize); 109 m_pBuffer = FX_Alloc(FX_BYTE, m_dwSize);
110 if (!m_pBuffer) {
111 return FALSE;
112 }
110 } 113 }
111 return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize); 114 return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize);
112 } 115 }
113 virtual FX_LPCBYTE GetBlockBuffer() 116 virtual FX_LPCBYTE GetBlockBuffer()
114 { 117 {
115 return (FX_LPCBYTE)m_pBuffer; 118 return (FX_LPCBYTE)m_pBuffer;
116 } 119 }
117 virtual size_t GetBlockSize() 120 virtual size_t GetBlockSize()
118 { 121 {
119 return m_dwSize; 122 return m_dwSize;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void GetAttrValue(CFX_WideString &value); 155 void GetAttrValue(CFX_WideString &value);
153 FX_DWORD GetCharRef(); 156 FX_DWORD GetCharRef();
154 void GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE); 157 void GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE);
155 void SkipLiterals(FX_BSTR str); 158 void SkipLiterals(FX_BSTR str);
156 CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE); 159 CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE);
157 void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR con tent, CXML_Element* pElement); 160 void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR con tent, CXML_Element* pElement);
158 void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXM L_Element* pElement); 161 void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXM L_Element* pElement);
159 }; 162 };
160 void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX _ByteStringC &bsName); 163 void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX _ByteStringC &bsName);
161 #endif 164 #endif
OLDNEW
« no previous file with comments | « core/src/fxcrt/fxcrt_posix.cpp ('k') | core/src/fxge/agg/agg23/agg_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698