| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_IMPL_H_ | 5 #ifndef BASE_THREADING_THREAD_CHECKER_IMPL_H_ |
| 6 #define BASE_THREADING_THREAD_CHECKER_IMPL_H_ | 6 #define BASE_THREADING_THREAD_CHECKER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/sequence_token.h" | 10 #include "base/sequence_token.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Synchronizes access to all members. | 39 // Synchronizes access to all members. |
| 40 mutable base::Lock lock_; | 40 mutable base::Lock lock_; |
| 41 | 41 |
| 42 // Thread on which CalledOnValidThread() may return true. | 42 // Thread on which CalledOnValidThread() may return true. |
| 43 mutable PlatformThreadRef thread_id_; | 43 mutable PlatformThreadRef thread_id_; |
| 44 | 44 |
| 45 // TaskToken for which CalledOnValidThread() always returns true. This allows | 45 // TaskToken for which CalledOnValidThread() always returns true. This allows |
| 46 // CalledOnValidThread() to return true when called multiple times from the | 46 // CalledOnValidThread() to return true when called multiple times from the |
| 47 // same task, even if it's not running in a single-threaded context itself | 47 // same task, even if it's not running in a single-threaded context itself |
| 48 // (allowing usage of ThreadChecker/NonThreadSafe objects on the stack in the | 48 // (allowing usage of ThreadChecker objects on the stack in the scope of one- |
| 49 // scope of one-off tasks). Note: CalledOnValidThread() may return true even | 49 // off tasks). Note: CalledOnValidThread() may return true even if the current |
| 50 // if the current TaskToken is not equal to this. | 50 // TaskToken is not equal to this. |
| 51 mutable TaskToken task_token_; | 51 mutable TaskToken task_token_; |
| 52 | 52 |
| 53 // SequenceToken for which CalledOnValidThread() may return true. Used to | 53 // SequenceToken for which CalledOnValidThread() may return true. Used to |
| 54 // ensure that CalledOnValidThread() doesn't return true for TaskScheduler | 54 // ensure that CalledOnValidThread() doesn't return true for TaskScheduler |
| 55 // tasks that happen to run on the same thread but weren't posted to the same | 55 // tasks that happen to run on the same thread but weren't posted to the same |
| 56 // SingleThreadTaskRunner. | 56 // SingleThreadTaskRunner. |
| 57 mutable SequenceToken sequence_token_; | 57 mutable SequenceToken sequence_token_; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace base | 60 } // namespace base |
| 61 | 61 |
| 62 #endif // BASE_THREADING_THREAD_CHECKER_IMPL_H_ | 62 #endif // BASE_THREADING_THREAD_CHECKER_IMPL_H_ |
| OLD | NEW |