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

@@ -10,6 +10,7 @@
#include <glib.h>
#include "include/base/cef_logging.h"
#include "include/cef_app.h"
// From base/posix/eintr_wrapper.h.
@@ -19,7 +20,7 @@
// that should be masked) to go unnoticed, there is a limit after which the
// caller will nonetheless see an EINTR in Debug builds.
#if !defined(HANDLE_EINTR)
#if defined(NDEBUG)
#if !DCHECK_IS_ON()
#define HANDLE_EINTR(x) ({ \
decltype(x) eintr_wrapper_result; \
@@ -41,7 +42,7 @@
eintr_wrapper_result; \
})
#endif // defined(NDEBUG)
#endif // !DCHECK_IS_ON()
#endif // !defined(HANDLE_EINTR)
namespace client {

View File

@@ -5,6 +5,7 @@
#include "cefclient/browser/main_message_loop_multithreaded_win.h"
#include "include/base/cef_bind.h"
#include "include/base/cef_logging.h"
#include "include/cef_app.h"
#include "cefclient/browser/resource.h"
#include "cefclient/browser/util_win.h"
@@ -99,7 +100,7 @@ void MainMessageLoopMultithreadedWin::SetCurrentModelessDialog(
HWND hWndDialog) {
DCHECK(RunsTasksOnCurrentThread());
#ifndef NDEBUG
#if DCHECK_IS_ON()
if (hWndDialog) {
// A new dialog reference should not be set while one is currently set.
DCHECK(!dialog_hwnd_);

View File

@@ -14,6 +14,7 @@
#error Platform is not supported.
#endif
#include "include/base/cef_logging.h"
#include "include/wrapper/cef_helpers.h"
#ifndef GL_BGR
@@ -27,7 +28,7 @@
#endif
// DCHECK on gl errors.
#ifndef NDEBUG
#if DCHECK_IS_ON()
#define VERIFY_NO_ERROR { \
int _gl_error = glGetError(); \
DCHECK(_gl_error == GL_NO_ERROR) << \

View File

@@ -7,6 +7,7 @@
#include <algorithm>
#include <string>
#include "include/base/cef_logging.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#include "cefclient/renderer/performance_test_setup.h"
@@ -14,7 +15,7 @@ namespace client {
namespace performance_test {
// Use more interations for a Release build.
#ifdef NDEBUG
#if DCHECK_IS_ON()
const int kDefaultIterations = 100000;
#else
const int kDefaultIterations = 10000;