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

Side by Side Diff: base/threading/thread_checker.h

Issue 10414072: Fix ENABLE_THREAD_CHECKER (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: define 0 for false case Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_THREADING_THREAD_CHECKER_H_ 5 #ifndef BASE_THREADING_THREAD_CHECKER_H_
6 #define BASE_THREADING_THREAD_CHECKER_H_ 6 #define BASE_THREADING_THREAD_CHECKER_H_
7 #pragma once 7 #pragma once
8 8
9 // Apart from debug builds, we also enable the thread checker in 9 // Apart from debug builds, we also enable the thread checker in
10 // builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots 10 // builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots
11 // with this define will get the same level of thread checking as 11 // with this define will get the same level of thread checking as
12 // debug bots. 12 // debug bots.
13 // 13 //
14 // Note that this does not perfectly match situations where DCHECK is 14 // Note that this does not perfectly match situations where DCHECK is
15 // enabled. For example a non-official release build may have 15 // enabled. For example a non-official release build may have
16 // DCHECK_ALWAYS_ON undefined (and therefore ThreadChecker would be 16 // DCHECK_ALWAYS_ON undefined (and therefore ThreadChecker would be
17 // disabled) but have DCHECKs enabled at runtime. 17 // disabled) but have DCHECKs enabled at runtime.
18 #define ENABLE_THREAD_CHECKER (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) 18 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
19 #define ENABLE_THREAD_CHECKER 1
20 #else
21 #define ENABLE_THREAD_CHECKER 0
22 #endif
19 23
20 #if ENABLE_THREAD_CHECKER 24 #if ENABLE_THREAD_CHECKER
21 #include "base/threading/thread_checker_impl.h" 25 #include "base/threading/thread_checker_impl.h"
22 #endif 26 #endif
23 27
24 namespace base { 28 namespace base {
25 29
26 // Do nothing implementation, for use in release mode. 30 // Do nothing implementation, for use in release mode.
27 // 31 //
28 // Note: You should almost always use the ThreadChecker class to get the 32 // Note: You should almost always use the ThreadChecker class to get the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #else 67 #else
64 class ThreadChecker : public ThreadCheckerDoNothing { 68 class ThreadChecker : public ThreadCheckerDoNothing {
65 }; 69 };
66 #endif // ENABLE_THREAD_CHECKER 70 #endif // ENABLE_THREAD_CHECKER
67 71
68 #undef ENABLE_THREAD_CHECKER 72 #undef ENABLE_THREAD_CHECKER
69 73
70 } // namespace base 74 } // namespace base
71 75
72 #endif // BASE_THREADING_THREAD_CHECKER_H_ 76 #endif // BASE_THREADING_THREAD_CHECKER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698