Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1109)

Unified Diff: core/include/fxcrt/fx_basic.h

Issue 1052553006: Remove checks in fxcrt now that FX_NEW can't return 0. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcrt/fx_basic.h
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 7b700d36a8b77ecbcaf3fefe188e9b8aecebc159..275653ef9ecfbc8bc69c4cab26327ab057e061a9 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;
}
« no previous file with comments | « no previous file | core/src/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698