diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-14 12:54:38 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-14 12:54:38 -0700 |
commit | 4926900ab54a493d236291b5a24dfa4476792182 (patch) | |
tree | e53800a0569300516c934bfccbb036ce39d98cb3 /core/src/fpdfapi/fpdf_page | |
parent | eddab4425614e49146f904f00da4a664ba4b581b (diff) | |
download | pdfium-4926900ab54a493d236291b5a24dfa4476792182.tar.xz |
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
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp | 4 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_page/pageint.h | 16 |
2 files changed, 10 insertions, 10 deletions
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<KeyType, CPDF_CountedObject<V } return FALSE; } -class CPDF_DocPageData : public CFX_Object +class CPDF_DocPageData { public: CPDF_DocPageData(CPDF_Document *pPDFDoc); @@ -393,7 +393,7 @@ public: CPDF_FontFileMap m_FontFileMap; FX_BOOL m_bForceClear; }; -class CPDF_Function : public CFX_Object +class CPDF_Function { public: static CPDF_Function* Load(CPDF_Object* pFuncObj); @@ -416,7 +416,7 @@ protected: virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0; virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0; }; -class CPDF_IccProfile : public CFX_Object +class CPDF_IccProfile { public: CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize); @@ -451,10 +451,10 @@ public: CPDF_CountedColorSpace* m_pCountedBaseCS; }; #define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096 -class CPDF_ResourceNaming : public CFX_Object +class CPDF_ResourceNaming { public: - struct _NamingState : public CFX_Object { + struct _NamingState { CFX_ByteString m_Prefix; int m_nIndex; }; |