Index: base/threading/sequenced_worker_pool.h |
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h |
index 961a532b5d9d152b60d51d6a00ada163ede2c743..ded2b0a5e730ed491bde3e7341357af4968da28a 100644 |
--- a/base/threading/sequenced_worker_pool.h |
+++ b/base/threading/sequenced_worker_pool.h |
@@ -122,6 +122,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
class TestingObserver { |
public: |
virtual ~TestingObserver() {} |
+ virtual void OnHasWork() = 0; |
virtual void WillWaitForShutdown() = 0; |
virtual void OnDestruct() = 0; |
}; |
@@ -131,6 +132,12 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
SequencedWorkerPool(size_t max_threads, |
const std::string& thread_name_prefix); |
+ // Like above, but with |observer| for testing. Does not take |
+ // ownership of |observer|. |
+ SequencedWorkerPool(size_t max_threads, |
+ const std::string& thread_name_prefix, |
+ TestingObserver* observer); |
+ |
// Returns a unique token that can be used to sequence tasks posted to |
// PostSequencedWorkerTask(). Valid tokens are alwys nonzero. |
SequenceToken GetSequenceToken(); |
@@ -219,10 +226,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
void FlushForTesting(); |
// Spuriously signal that there is work to be done. |
- void TriggerSpuriousWorkSignalForTesting(); |
- |
- // Get the number of times the work signal has been triggered. |
- int GetWorkSignalCountForTesting() const; |
+ void SignalHasWorkForTesting(); |
// Implements the worker pool shutdown. This should be called during app |
// shutdown, and will discard/join with appropriate tasks before returning. |
@@ -231,10 +235,6 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { |
// Must be called from the same thread this object was constructed on. |
void Shutdown(); |
- // Called by tests to set the testing observer. This is NULL by default |
- // and ownership of the pointer is kept with the caller. |
- void SetTestingObserver(TestingObserver* observer); |
- |
protected: |
virtual ~SequencedWorkerPool(); |