Index: base/threading/sequenced_worker_pool.h |
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h |
index 7e04b071428c838dfcec0faa647f82baf2932045..aa585de3c3baa108135557623260060bbee58750 100644 |
--- a/base/threading/sequenced_worker_pool.h |
+++ b/base/threading/sequenced_worker_pool.h |
@@ -159,7 +159,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
TestingObserver* observer); |
// Returns a unique token that can be used to sequence tasks posted to |
- // PostSequencedWorkerTask(). Valid tokens are alwys nonzero. |
+ // PostSequencedWorkerTask(). Valid tokens are always nonzero. |
SequenceToken GetSequenceToken(); |
// Returns the sequence token associated with the given name. Calling this |
@@ -168,6 +168,11 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
// will be created. |
SequenceToken GetNamedSequenceToken(const std::string& name); |
+ // Retrieves the sequence token associated with the current thread. |
+ // If current thread is not part in worker pool, this returns false and |
+ // |result_token| is unmodified. |result_token| may not be NULL. |
+ bool GetCurrentThreadSequenceToken(SequenceToken* result_token) const; |
+ |
// Returns a SequencedTaskRunner wrapper which posts to this |
// SequencedWorkerPool using the given sequence token. Tasks with nonzero |
// delay are posted with SKIP_ON_SHUTDOWN behavior and tasks with zero delay |
@@ -322,6 +327,11 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
virtual void OnDestruct() const OVERRIDE; |
private: |
+ friend class SequenceCheckerImpl; |
+ |
+ // Gets the SequencedWorkerPool that owns the current thread. May be NULL. |
+ static SequencedWorkerPool* Owner(); |
+ |
friend class RefCountedThreadSafe<SequencedWorkerPool>; |
friend class DeleteHelper<SequencedWorkerPool>; |