Skip to content

Commit

Permalink
Use
Browse files Browse the repository at this point in the history
#if DCHECK_IS_ON() in base/threading/thread_checker.h

Use #if DCHECK_IS_ON() instead of
(!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) in
base/threading/thread_checker.h because it
is same thing and more succinct and centralized.

Review URL: https://codereview.chromium.org/1324673002

Cr-Commit-Position: refs/heads/master@{#346574}
  • Loading branch information
olli.raula authored and Commit bot committed Sep 1, 2015
1 parent 5c9f9fd commit 3e81715
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions base/threading/thread_checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
#ifndef BASE_THREADING_THREAD_CHECKER_H_
#define BASE_THREADING_THREAD_CHECKER_H_

#include "base/logging.h"
#include "base/threading/thread_checker_impl.h"

// Apart from debug builds, we also enable the thread checker in
// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
// with this define will get the same level of thread checking as
// debug bots.
//
// Note that this does not perfectly match situations where DCHECK is
// enabled. For example a non-official release build may have
// DCHECK_ALWAYS_ON undefined (and therefore ThreadChecker would be
// disabled) but have DCHECKs enabled at runtime.
#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
#if DCHECK_IS_ON()
#define ENABLE_THREAD_CHECKER 1
#else
#define ENABLE_THREAD_CHECKER 0
#endif

#include "base/threading/thread_checker_impl.h"

namespace base {

// Do nothing implementation, for use in release mode.
Expand Down

0 comments on commit 3e81715

Please sign in to comment.