From 4926900ab54a493d236291b5a24dfa4476792182 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 14 Apr 2015 12:54:38 -0700 Subject: Kill CFX_Object. CFX_Object is a type that implements its own new operators that return NULL on error. There's no need for this given the |new (std::nothrow)| syntax; in fact, the current code can only work if there is no activity in the constructors. This may explain the pervasive lack of constructors and reliance on Init() methods throughout the codebase. The activity takes place in fx_memory.h, where FX_NEW is mapped onto the std::nothrow syntax. The rest is just cleanup. Down the road, we will simply throw and remove all the error-checking paths for new objects. Landing this patch first will at least show a simple path back to the old behaviour without having to re-introduce CFX_Object should someone want to do so in their own fork. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1088733002 --- core/include/fxcrt/fx_basic.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'core/include/fxcrt/fx_basic.h') diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 45a5a6e23c..7b700d36a8 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: @@ -1603,7 +1603,7 @@ typedef enum { #define ProgressiveStatus FX_ProgressiveStatus #define FX_NAMESPACE_DECLARE(namespace, type) namespace::type -class CFX_Vector_3by1 : public CFX_Object +class CFX_Vector_3by1 { public: @@ -1619,7 +1619,7 @@ public: FX_FLOAT b; FX_FLOAT c; }; -class CFX_Matrix_3by3 : public CFX_Object +class CFX_Matrix_3by3 { public: -- cgit v1.2.3