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/src/fpdfapi/fpdf_page/fpdf_page_func.cpp | 4 ++-- core/src/fpdfapi/fpdf_page/pageint.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'core/src/fpdfapi/fpdf_page') diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp index ae912ac50f..c786df5a5b 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp @@ -21,7 +21,7 @@ typedef enum {PSOP_ADD, PSOP_SUB, PSOP_MUL, PSOP_DIV, PSOP_IDIV, PSOP_MOD, PSOP_IF, PSOP_IFELSE, PSOP_POP, PSOP_EXCH, PSOP_DUP, PSOP_COPY, PSOP_INDEX, PSOP_ROLL, PSOP_PROC, PSOP_CONST } PDF_PSOP; -class CPDF_PSProc : public CFX_Object +class CPDF_PSProc { public: ~CPDF_PSProc(); @@ -30,7 +30,7 @@ public: CFX_PtrArray m_Operators; }; #define PSENGINE_STACKSIZE 100 -class CPDF_PSEngine : public CFX_Object +class CPDF_PSEngine { public: CPDF_PSEngine(); diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h index f6b6bea4b9..d9d16a3134 100644 --- a/core/src/fpdfapi/fpdf_page/pageint.h +++ b/core/src/fpdfapi/fpdf_page/pageint.h @@ -11,7 +11,7 @@ #define PARSE_STEP_LIMIT 100 #define STREAM_PARSE_BUFSIZE 20480 class CPDF_QuickFontCache; -class CPDF_StreamParser : public CFX_Object +class CPDF_StreamParser { public: @@ -118,7 +118,7 @@ typedef struct { #define _FPDF_MAX_FORM_LEVEL_ 30 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 -class CPDF_StreamContentParser : public CFX_Object +class CPDF_StreamContentParser { public: CPDF_StreamContentParser(); @@ -280,7 +280,7 @@ public: void Handle_NextLineShowText_Space(); void Handle_Invalid(); }; -class CPDF_ContentParser : public CFX_Object +class CPDF_ContentParser { public: CPDF_ContentParser(); @@ -359,7 +359,7 @@ FX_BOOL PDF_DocPageData_Release(CFX_MapPtrTemplate