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

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

Issue 6599004: Modify ThreadChecker and NonThreadSafe so that their functionality is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update copyright year for new/moved files Created 9 years, 9 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 | « base/threading/non_thread_safe.cc ('k') | base/threading/non_thread_safe_impl.cc » ('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) 2011 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_IMPL_H_
6 #define BASE_THREADING_NON_THREAD_SAFE_IMPL_H_
7 #pragma once
8
9 #include "base/threading/thread_checker_impl.h"
10
11 namespace base {
12
13 // Full implementation of NonThreadSafe, for debug mode or for occasional
14 // temporary use in release mode e.g. when you need to CHECK on a thread
15 // bug that only occurs in the wild.
16 //
17 // Note: You should almost always use the NonThreadSafe class to get
18 // the right version of the class for your build configuration.
19 class NonThreadSafeImpl {
20 public:
21 ~NonThreadSafeImpl();
22
23 bool CalledOnValidThread() const;
24
25 protected:
26 // Changes the thread that is checked for in CalledOnValidThread. The next
27 // call to CalledOnValidThread will attach this class to a new thread. It is
28 // up to the NonThreadSafe derived class to decide to expose this or not.
29 // This may be useful when an object may be created on one thread and then
30 // used exclusively on another thread.
31 void DetachFromThread();
32
33 private:
34 ThreadCheckerImpl thread_checker_;
35 };
36
37 } // namespace base
38
39 #endif // BASE_THREADING_NON_THREAD_SAFE_IMPL_H_
OLDNEW
« no previous file with comments | « base/threading/non_thread_safe.cc ('k') | base/threading/non_thread_safe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698