Use DCHECK_IS_ON() instead of !NDEBUG for debug logic (issue #1961)

This commit is contained in:
Marshall Greenblatt
2016-09-01 14:24:30 +03:00
parent ad1619dbd7
commit 5068b50b48
278 changed files with 320 additions and 525 deletions

View File

@ -382,11 +382,11 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
if len(names) > 0:
names = sorted(names)
result += '\n#ifndef NDEBUG'\
result += '\n#if DCHECK_IS_ON()'\
'\n // Check that all wrapper objects have been destroyed'
for name in names:
result += '\n DCHECK(base::AtomicRefCountIsZero(&'+name+'::DebugObjCt));';
result += '\n#endif // !NDEBUG'
result += '\n#endif // DCHECK_IS_ON()'
if len(result) != result_len:
result += '\n'
@ -553,7 +553,7 @@ def make_cpptoc_class_impl(header, clsname, impl):
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
' return NULL;\n'+ \
'}\n\n'+ \
'#ifndef NDEBUG\n'+ \
'#if DCHECK_IS_ON()\n'+ \
'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \
'#endif\n\n'+ \
'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';'