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

Unified Diff: base/threading/sequenced_worker_pool.h

Issue 9558007: Ensure that SequencedWorkerPools in tests don't outlive their tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failures Created 8 years, 9 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 | « no previous file | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.h
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index de318287b3796880cabb4af0dd76cef07ceb16af..e86814d2ad41a8d4b508d27a3bb02c862ddb5c2a 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -22,6 +22,10 @@ class Location;
namespace base {
+class MessageLoopProxy;
+
+template <class T> class DeleteHelper;
+
// A worker thread pool that enforces ordering between sets of tasks. It also
// allows you to specify what should happen to your tasks on shutdown.
//
@@ -119,6 +123,7 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
public:
virtual ~TestingObserver() {}
virtual void WillWaitForShutdown() = 0;
+ virtual void OnDestruct() = 0;
};
// Pass the maximum number of threads (they will be lazily created as needed)
@@ -225,14 +230,19 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
protected:
virtual ~SequencedWorkerPool();
+ virtual void OnDestruct() const OVERRIDE;
+
private:
friend class RefCountedThreadSafe<SequencedWorkerPool>;
+ friend class DeleteHelper<SequencedWorkerPool>;
class Inner;
class Worker;
- // Avoid pulling in too many headers by putting everything into
- // |inner_|.
+ const scoped_refptr<MessageLoopProxy> constructor_message_loop_;
+
+ // Avoid pulling in too many headers by putting (almost) everything
+ // into |inner_|.
const scoped_ptr<Inner> inner_;
DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool);
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698