From 6c0d01b0244af7d8f9a896e626c7a7d5476a7373 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 15 Apr 2015 14:17:33 -0700 Subject: Remove checks in fxcrt now that FX_NEW can't return 0. Replace them with |new| so that we can tell by the presence of FX_NEW the places that still need to be audited. R=thestig@google.com, thestig@chromium.org Review URL: https://codereview.chromium.org/1052553006 --- core/include/fxcrt/fx_basic.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'core/include/fxcrt') diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 7b700d36a8..275653ef9e 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -1271,12 +1271,8 @@ public: if (m_pObject->m_RefCount <= 0) { delete m_pObject; } - m_pObject = NULL; - } - m_pObject = FX_NEW CountedObj; - if (!m_pObject) { - return NULL; } + m_pObject = new CountedObj; m_pObject->m_RefCount = 1; return m_pObject; } @@ -1331,18 +1327,13 @@ public: ObjClass* GetModify() { if (m_pObject == NULL) { - m_pObject = FX_NEW CountedObj; - if (m_pObject) { - m_pObject->m_RefCount = 1; - } + m_pObject = new CountedObj; + m_pObject->m_RefCount = 1; } else if (m_pObject->m_RefCount > 1) { m_pObject->m_RefCount --; CountedObj* pOldObject = m_pObject; - m_pObject = NULL; - m_pObject = FX_NEW CountedObj(*pOldObject); - if (m_pObject) { - m_pObject->m_RefCount = 1; - } + m_pObject = new CountedObj(*pOldObject); + m_pObject->m_RefCount = 1; } return m_pObject; } -- cgit v1.2.3