From 6fc8cbb4ffbc17732045d243e1b95bc04c8a3b33 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 14 Apr 2015 13:50:34 -0700 Subject: Merge to XFA: Kill CFX_Object. Not just a simple merge, but changes to remove CFX_Object from XFA. Original Review URL: https://codereview.chromium.org/1088733002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1087053002 --- core/include/fxcrt/fx_basic.h | 38 ++++++++++---------- core/include/fxcrt/fx_coordinates.h | 8 ++--- core/include/fxcrt/fx_memory.h | 71 ++++--------------------------------- core/include/fxcrt/fx_string.h | 10 +++--- core/include/fxcrt/fx_ucd.h | 2 +- core/include/fxcrt/fx_xml.h | 8 ++--- 6 files changed, 40 insertions(+), 97 deletions(-) (limited to 'core/include/fxcrt') diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 33d5881c6a..1ef9410fb3 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -27,7 +27,7 @@ template char (&ArraySizeHelper(T (&array)[N]))[N]; -class CFX_BinaryBuf : public CFX_Object +class CFX_BinaryBuf { public: CFX_BinaryBuf(); @@ -155,7 +155,7 @@ public: CFX_WideStringC GetWideString() const; }; -class CFX_ArchiveSaver : public CFX_Object +class CFX_ArchiveSaver { public: CFX_ArchiveSaver() : m_pStream(NULL) {} @@ -198,7 +198,7 @@ protected: IFX_FileStream* m_pStream; }; -class CFX_ArchiveLoader : public CFX_Object +class CFX_ArchiveLoader { public: @@ -260,7 +260,7 @@ protected: FX_STRSIZE m_Length; }; -class CFX_FileBufferArchive : public IFX_BufferArchive, public CFX_Object +class CFX_FileBufferArchive : public IFX_BufferArchive { public: CFX_FileBufferArchive(FX_STRSIZE size = 32768); @@ -352,7 +352,7 @@ CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl); CFX_WideString FX_UrlDecode(const CFX_ByteString& bsUrl); CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI); CFX_WideString FX_DecodeURI(const CFX_ByteString& bsURI); -class CFX_BasicArray : public CFX_Object +class CFX_BasicArray { protected: CFX_BasicArray(int unit_size); @@ -665,7 +665,7 @@ public: }; typedef CFX_ObjectArray CFX_ByteStringArray; typedef CFX_ObjectArray CFX_WideStringArray; -class CFX_BaseSegmentedArray : public CFX_Object +class CFX_BaseSegmentedArray { public: CFX_BaseSegmentedArray(int unit_size = 1, int segment_units = 512, int index_size = 8); @@ -734,7 +734,7 @@ public: } }; template -class CFX_FixedBufGrow : public CFX_Object +class CFX_FixedBufGrow { public: CFX_FixedBufGrow() : m_pData(NULL) @@ -799,7 +799,7 @@ public: private: DataType* m_pData; }; -class CFX_MapPtrToPtr : public CFX_Object +class CFX_MapPtrToPtr { protected: @@ -916,7 +916,7 @@ public: rValue = (ValueType)(FX_UINTPTR)pValue; } }; -class CFX_CMapDWordToDWord : public CFX_Object +class CFX_CMapDWordToDWord { public: @@ -933,7 +933,7 @@ protected: CFX_BinaryBuf m_Buffer; }; -class CFX_MapByteStringToPtr : public CFX_Object +class CFX_MapByteStringToPtr { protected: @@ -1013,7 +1013,7 @@ public: ~CFX_MapByteStringToPtr(); }; -class CFX_CMapByteStringToPtr : public CFX_Object +class CFX_CMapByteStringToPtr { public: CFX_CMapByteStringToPtr(); @@ -1041,7 +1041,7 @@ private: CFX_BaseSegmentedArray m_Buffer; }; -class CFX_PtrList : public CFX_Object +class CFX_PtrList { protected: @@ -1190,7 +1190,7 @@ protected: void AddData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct); }; -class CFX_BitStream : public CFX_Object +class CFX_BitStream { public: @@ -1223,7 +1223,7 @@ protected: FX_LPCBYTE m_pData; }; -template class CFX_CountRef : public CFX_Object +template class CFX_CountRef { public: @@ -1373,7 +1373,7 @@ public: virtual ~IFX_Pause() { } virtual FX_BOOL NeedToPauseNow() = 0; }; -class CFX_DataFilter : public CFX_Object +class CFX_DataFilter { public: @@ -1448,7 +1448,7 @@ protected: }; #define FX_DATALIST_LENGTH 1024 template -class CFX_SortListArray : public CFX_Object +class CFX_SortListArray { protected: @@ -1562,7 +1562,7 @@ protected: CFX_ArrayTemplate m_DataLists; }; template -class CFX_ListArrayTemplate : public CFX_Object +class CFX_ListArrayTemplate { public: @@ -1610,7 +1610,7 @@ public: }; #define FX_IsOdd(a) ((a) & 1) -class CFX_Vector_3by1 : public CFX_Object +class CFX_Vector_3by1 { public: @@ -1626,7 +1626,7 @@ public: FX_FLOAT b; FX_FLOAT c; }; -class CFX_Matrix_3by3 : public CFX_Object +class CFX_Matrix_3by3 { public: diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h index 0b4b920195..758d33762e 100644 --- a/core/include/fxcrt/fx_coordinates.h +++ b/core/include/fxcrt/fx_coordinates.h @@ -18,7 +18,7 @@ template class CFX_ATemplate; template class CFX_RRTemplate; class CFX_Matrix; template -class CFX_PSVTemplate : public CFX_Object +class CFX_PSVTemplate { public: typedef CFX_PSVTemplate FXT_PSV; @@ -230,7 +230,7 @@ public: typedef CFX_VTemplate CFX_Vector; typedef CFX_VTemplate CFX_VectorF; template -class CFX_RTemplate: public CFX_Object +class CFX_RTemplate { public: typedef CFX_PSVTemplate FXT_POINT; @@ -610,7 +610,7 @@ struct FX_SMALL_RECT { FX_SHORT Bottom; }; -class CFX_FloatRect : public CFX_Object +class CFX_FloatRect { public: @@ -749,7 +749,7 @@ public: FX_FLOAT top; }; -class CFX_Matrix : public CFX_Object +class CFX_Matrix { public: diff --git a/core/include/fxcrt/fx_memory.h b/core/include/fxcrt/fx_memory.h index 15dc7da8cf..7884d6b11d 100644 --- a/core/include/fxcrt/fx_memory.h +++ b/core/include/fxcrt/fx_memory.h @@ -10,6 +10,7 @@ #include "fx_system.h" #ifdef __cplusplus +#include extern "C" { #endif #define FX_Alloc(type, size) (type*)calloc(size, sizeof(type)) @@ -22,76 +23,18 @@ void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags); void FXMEM_DefaultFree(void* pointer, int flags); #ifdef __cplusplus } -#endif -#ifdef __cplusplus -class CFX_Object -{ -public: - void* operator new (size_t size, FX_LPCSTR file, int line) - { - return malloc(size); - } - void operator delete (void* p, FX_LPCSTR file, int line) - { - free(p); - } - void* operator new (size_t size) - { - return malloc(size); - } - void operator delete (void* p) - { - free(p); - } - void* operator new[] (size_t size, FX_LPCSTR file, int line) - { - return malloc(size); - } - void operator delete[] (void* p, FX_LPCSTR file, int line) - { - free(p); - } - void* operator new[] (size_t size) - { - return malloc(size); - } - void operator delete[] (void* p) - { - free(p); - } - void* operator new (size_t, void* buf) - { - return buf; - } - void operator delete (void*, void*) {} -}; -#endif -#ifdef __cplusplus -#if defined(_DEBUG) -#define FX_NEW new(__FILE__, __LINE__) -#else -#define FX_NEW new -#endif -#define FX_NEW_VECTOR(Pointer, Class, Count) \ - { \ - Pointer = FX_Alloc(Class, Count); \ - if (Pointer) { \ - for (int i = 0; i < (Count); i ++) new (Pointer + i) Class; \ - } \ - } -#define FX_DELETE_VECTOR(Pointer, Class, Count) \ - { \ - for (int i = 0; i < (Count); i ++) Pointer[i].~Class(); \ - FX_Free(Pointer); \ - } -class CFX_DestructObject : public CFX_Object +#define FX_NEW new(std::nothrow) +#define FX_NEW_VECTOR(Pointer, Class, Count) (Pointer = FX_NEW Class[Count]) +#define FX_DELETE_VECTOR(Pointer, Class, Count) delete[] Pointer + +class CFX_DestructObject { public: virtual ~CFX_DestructObject() {} }; -class CFX_GrowOnlyPool : public CFX_Object +class CFX_GrowOnlyPool { public: diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h index ad1d083323..df7dd0c762 100644 --- a/core/include/fxcrt/fx_string.h +++ b/core/include/fxcrt/fx_string.h @@ -21,7 +21,7 @@ class CFX_WideStringL; // An immutable string with caller-provided storage which must outlive the // string itself. -class CFX_ByteStringC : public CFX_Object +class CFX_ByteStringC { public: typedef FX_CHAR value_type; @@ -171,7 +171,7 @@ struct CFX_StringData { FX_CHAR m_String[1]; }; -class CFX_ByteString : public CFX_Object +class CFX_ByteString { public: typedef FX_CHAR value_type; @@ -428,7 +428,7 @@ inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2) { return CFX_ByteString(str1, str2); } -class CFX_StringBufBase : public CFX_Object +class CFX_StringBufBase { public: @@ -484,7 +484,7 @@ public: FX_CHAR m_Buffer[limit]; }; typedef CFX_StringBufTemplate<256> CFX_StringBuf256; -class CFX_WideStringC : public CFX_Object +class CFX_WideStringC { public: typedef FX_WCHAR value_type; @@ -630,7 +630,7 @@ struct CFX_StringDataW { FX_WCHAR m_String[1]; }; -class CFX_WideString : public CFX_Object +class CFX_WideString { public: typedef FX_WCHAR value_type; diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h index 0b0f7b8051..66e980e13c 100644 --- a/core/include/fxcrt/fx_ucd.h +++ b/core/include/fxcrt/fx_ucd.h @@ -112,7 +112,7 @@ FX_BOOL FX_IsCombinationChar(FX_WCHAR wch); FX_BOOL FX_IsBidiChar(FX_WCHAR wch); FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical); FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, FX_BOOL bRTL, FX_BOOL bVertical); -class CFX_Char : public CFX_Object +class CFX_Char { public: CFX_Char() : m_wCharCode(0) diff --git a/core/include/fxcrt/fx_xml.h b/core/include/fxcrt/fx_xml.h index 8fb00158a7..7f3dbcc205 100644 --- a/core/include/fxcrt/fx_xml.h +++ b/core/include/fxcrt/fx_xml.h @@ -9,14 +9,14 @@ #include "fx_basic.h" -class CXML_AttrItem : public CFX_Object +class CXML_AttrItem { public: CFX_ByteString m_QSpaceName; CFX_ByteString m_AttrName; CFX_WideString m_Value; }; -class CXML_AttrMap : public CFX_Object +class CXML_AttrMap { public: CXML_AttrMap() @@ -35,7 +35,7 @@ public: CXML_AttrItem& GetAt(int index) const; CFX_ObjectArray* m_pMap; }; -class CXML_Content : public CFX_Object +class CXML_Content { public: CXML_Content() : m_bCDATA(FALSE), m_Content() {} @@ -47,7 +47,7 @@ public: FX_BOOL m_bCDATA; CFX_WideString m_Content; }; -class CXML_Element : public CFX_Object +class CXML_Element { public: static CXML_Element* Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL); -- cgit v1.2.3