| Index: base/threading/thread_checker_impl.cc
|
| diff --git a/base/threading/thread_checker_impl.cc b/base/threading/thread_checker_impl.cc
|
| index 11c2b95b6fcfed31ecab6d442c08226fb5187b04..d5ccbdb943db85d5a399c47f5606075e7f1109e2 100644
|
| --- a/base/threading/thread_checker_impl.cc
|
| +++ b/base/threading/thread_checker_impl.cc
|
| @@ -19,6 +19,11 @@ bool ThreadCheckerImpl::CalledOnValidThread() const {
|
| AutoLock auto_lock(lock_);
|
| EnsureAssigned();
|
|
|
| + // Always return true when called from the task from which this
|
| + // ThreadCheckerImpl was assigned to a thread.
|
| + if (task_token_ == TaskToken::GetForCurrentThread())
|
| + return true;
|
| +
|
| // If this ThreadCheckerImpl is bound to a valid SequenceToken, it must be
|
| // equal to the current SequenceToken and there must be a registered
|
| // ThreadTaskRunnerHandle. Otherwise, the fact that the current task runs on
|
| @@ -35,6 +40,7 @@ bool ThreadCheckerImpl::CalledOnValidThread() const {
|
| void ThreadCheckerImpl::DetachFromThread() {
|
| AutoLock auto_lock(lock_);
|
| thread_id_ = PlatformThreadRef();
|
| + task_token_ = TaskToken();
|
| sequence_token_ = SequenceToken();
|
| }
|
|
|
| @@ -44,6 +50,7 @@ void ThreadCheckerImpl::EnsureAssigned() const {
|
| return;
|
|
|
| thread_id_ = PlatformThread::CurrentRef();
|
| + task_token_ = TaskToken::GetForCurrentThread();
|
| sequence_token_ = SequenceToken::GetForCurrentThread();
|
| }
|
|
|
|
|