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

Side by Side Diff: base/non_thread_safe.h

Issue 19617: Add thread checks to the IPC channel.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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 | chrome/common/ipc_channel_win.h » ('j') | chrome/common/ipc_channel_win.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_NON_THREAD_SAFE_H__ 5 #ifndef BASE_NON_THREAD_SAFE_H__
6 #define BASE_NON_THREAD_SAFE_H__ 6 #define BASE_NON_THREAD_SAFE_H__
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/platform_thread.h" 9 #include "base/platform_thread.h"
10 10
(...skipping 14 matching lines...) Expand all
25 // } 25 // }
26 // 26 //
27 // In Release mode, CalledOnValidThread will always return true. 27 // In Release mode, CalledOnValidThread will always return true.
28 // 28 //
29 #ifndef NDEBUG 29 #ifndef NDEBUG
30 class NonThreadSafe { 30 class NonThreadSafe {
31 public: 31 public:
32 NonThreadSafe(); 32 NonThreadSafe();
33 ~NonThreadSafe(); 33 ~NonThreadSafe();
34 34
35 protected:
36 bool CalledOnValidThread() const; 35 bool CalledOnValidThread() const;
37 36
38 private: 37 private:
39 PlatformThreadId valid_thread_id_; 38 PlatformThreadId valid_thread_id_;
40 }; 39 };
41 #else 40 #else
42 // Do nothing in release mode. 41 // Do nothing in release mode.
43 class NonThreadSafe { 42 class NonThreadSafe {
44 public: 43 public:
45 NonThreadSafe() {} 44 NonThreadSafe() {}
46 ~NonThreadSafe() {} 45 ~NonThreadSafe() {}
47 46
48 protected:
49 bool CalledOnValidThread() const { 47 bool CalledOnValidThread() const {
50 return true; 48 return true;
51 } 49 }
52 }; 50 };
53 #endif // NDEBUG 51 #endif // NDEBUG
54 52
55 #endif // BASE_NON_THREAD_SAFE_H__ 53 #endif // BASE_NON_THREAD_SAFE_H__
56 54
OLDNEW
« no previous file with comments | « no previous file | chrome/common/ipc_channel_win.h » ('j') | chrome/common/ipc_channel_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698