summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_basic.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-15 14:17:33 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-15 14:17:33 -0700
commit6c0d01b0244af7d8f9a896e626c7a7d5476a7373 (patch)
tree1c70510d319148c43eede72be9e937ad393c7920 /core/include/fxcrt/fx_basic.h
parentae4256f45df69bbfdf722a6ec17e1e851911ae4e (diff)
downloadpdfium-6c0d01b0244af7d8f9a896e626c7a7d5476a7373.tar.xz
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
Diffstat (limited to 'core/include/fxcrt/fx_basic.h')
-rw-r--r--core/include/fxcrt/fx_basic.h19
1 files changed, 5 insertions, 14 deletions
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;
}