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

Unified Diff: base/sequence_checker_impl.h

Issue 2691263002: Revert of Remove header dependencies from sequence_checker.h to sequenced_worker_pool.h (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « ash/shell.cc ('k') | base/sequence_checker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sequence_checker_impl.h
diff --git a/base/sequence_checker_impl.h b/base/sequence_checker_impl.h
index a54c38845114b15a1e78ff097ad116b55d29cb82..74039718f62de96890aeee3c6e6524766523a1c0 100644
--- a/base/sequence_checker_impl.h
+++ b/base/sequence_checker_impl.h
@@ -5,12 +5,13 @@
#ifndef BASE_SEQUENCE_CHECKER_IMPL_H_
#define BASE_SEQUENCE_CHECKER_IMPL_H_
-#include <memory>
-
#include "base/base_export.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/sequence_token.h"
#include "base/synchronization/lock.h"
+#include "base/threading/sequenced_worker_pool.h"
+#include "base/threading/thread_checker_impl.h"
namespace base {
@@ -34,11 +35,22 @@
void DetachFromSequence();
private:
- class Core;
+ void EnsureSequenceTokenAssigned() const;
// Guards all variables below.
mutable Lock lock_;
- mutable std::unique_ptr<Core> core_;
+
+ // True when the SequenceChecker is bound to a sequence or a thread.
+ mutable bool is_assigned_ = false;
+
+ mutable SequenceToken sequence_token_;
+
+ // TODO(gab): Remove this when SequencedWorkerPool is deprecated in favor of
+ // TaskScheduler. crbug.com/622400
+ mutable SequencedWorkerPool::SequenceToken sequenced_worker_pool_token_;
+
+ // Used when |sequenced_worker_pool_token_| and |sequence_token_| are invalid.
+ ThreadCheckerImpl thread_checker_;
DISALLOW_COPY_AND_ASSIGN(SequenceCheckerImpl);
};
« no previous file with comments | « ash/shell.cc ('k') | base/sequence_checker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698