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

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

Issue 2921903003: Remove base::NonThreadSafe now that all users are gone!! (Closed)
Patch Set: rebase on r477274 Created 3 years, 6 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
« no previous file with comments | « base/ios/weak_nsobject.h ('k') | base/threading/non_thread_safe_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_THREADING_NON_THREAD_SAFE_H_
6 #define BASE_THREADING_NON_THREAD_SAFE_H_
7
8 // Classes deriving from NonThreadSafe may need to suppress MSVC warning 4275:
9 // non dll-interface class 'Bar' used as base for dll-interface class 'Foo'.
10 // There is a specific macro to do it: NON_EXPORTED_BASE(), defined in
11 // compiler_specific.h
12 #include "base/compiler_specific.h"
13 #include "base/logging.h"
14 #include "base/threading/non_thread_safe_impl.h"
15
16 namespace base {
17
18 // Do nothing implementation of NonThreadSafe, for release mode.
19 //
20 // Note: You should almost always use the NonThreadSafe class to get
21 // the right version of the class for your build configuration.
22 class NonThreadSafeDoNothing {
23 public:
24 bool CalledOnValidThread() const {
25 return true;
26 }
27
28 protected:
29 ~NonThreadSafeDoNothing() {}
30 void DetachFromThread() {}
31 };
32
33 // DEPRECATED! Use base::SequenceChecker (for thread-safety) or
34 // base::ThreadChecker (for thread-affinity) -- see their documentation for
35 // details. Use a checker as a protected member instead of inheriting from
36 // NonThreadSafe if you need subclasses to have access.
37 #if DCHECK_IS_ON()
38 typedef NonThreadSafeImpl NonThreadSafe;
39 #else
40 typedef NonThreadSafeDoNothing NonThreadSafe;
41 #endif // DCHECK_IS_ON()
42
43 } // namespace base
44
45 #endif // BASE_THREADING_NON_THREAD_SAFE_H_
OLDNEW
« no previous file with comments | « base/ios/weak_nsobject.h ('k') | base/threading/non_thread_safe_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698