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

Unified Diff: base/threading/thread_checker_impl.h

Issue 2213263002: Make ThreadChecker::CalledOnValidThread() return true when called from the same task. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: similarity Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/threading/thread_checker_impl.h
diff --git a/base/threading/thread_checker_impl.h b/base/threading/thread_checker_impl.h
index 3e46316bc4e713fad2c0b84502339bc4b3a64904..e84dc8439855636cb86c8145a128169e695c804c 100644
--- a/base/threading/thread_checker_impl.h
+++ b/base/threading/thread_checker_impl.h
@@ -7,7 +7,7 @@
#include "base/base_export.h"
#include "base/compiler_specific.h"
-#include "base/sequence_token.h"
+#include "base/sequence_and_task_token.h"
#include "base/synchronization/lock.h"
#include "base/threading/platform_thread.h"
@@ -42,6 +42,12 @@ class BASE_EXPORT ThreadCheckerImpl {
// Thread on which CalledOnValidThread() may return true.
mutable PlatformThreadRef thread_id_;
+ // TaskToken for which CalledOnValidThread() always returns true. This allows
+ // CalledOnValidThread() to return true when called multiple times from the
+ // same task. CalledOnValidThread() may return true even if the current
gab 2016/08/08 16:34:22 Prefix the last sentence with "Note: "
gab 2016/08/08 16:34:22 s/same task/same task, even if it's not running in
fdoray 2016/08/08 17:45:18 Done.
fdoray 2016/08/08 17:45:18 Done.
+ // TaskToken is not equal to this.
+ mutable TaskToken task_token_;
+
// SequenceToken for which CalledOnValidThread() may return true. Used to
// ensure that CalledOnValidThread() doesn't return true for TaskScheduler
// tasks that happen to run on the same thread but weren't posted to the same

Powered by Google App Engine
This is Rietveld 408576698