OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/threading/non_thread_safe.h" | 5 #include "base/threading/non_thread_safe.h" |
| 6 #include "base/threading/thread_checker.h" |
6 | 7 |
7 // These checks are only done in debug builds. | 8 // These checks are only done in debug builds. |
8 #ifndef NDEBUG | 9 #ifndef NDEBUG |
9 | 10 |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 | 14 |
14 NonThreadSafe::~NonThreadSafe() { | 15 NonThreadSafe::~NonThreadSafe() { |
15 DCHECK(CalledOnValidThread()); | 16 DCHECK(CalledOnValidThread()); |
16 } | 17 } |
17 | 18 |
18 bool NonThreadSafe::CalledOnValidThread() const { | 19 bool NonThreadSafe::CalledOnValidThread() const { |
19 return thread_checker_.CalledOnValidThread(); | 20 return thread_checker_.CalledOnValidThread(); |
20 } | 21 } |
21 | 22 |
22 void NonThreadSafe::DetachFromThread() { | 23 void NonThreadSafe::DetachFromThread() { |
23 thread_checker_.DetachFromThread(); | 24 thread_checker_.DetachFromThread(); |
24 } | 25 } |
25 | 26 |
26 } // namespace base | 27 } // namespace base |
27 | 28 |
28 #endif // NDEBUG | 29 #endif // NDEBUG |
OLD | NEW |