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

Unified Diff: cc/raster_worker_pool.h

Issue 12079028: cc: Fix RasterWorkerPool shutdown crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | cc/raster_worker_pool.cc » ('j') | cc/raster_worker_pool.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster_worker_pool.h
diff --git a/cc/raster_worker_pool.h b/cc/raster_worker_pool.h
index a7c3341c7348abe6c3ac32f976d99623fc2f93c1..e4073129a8c84002c36114a18912e30e5bfec43b 100644
--- a/cc/raster_worker_pool.h
+++ b/cc/raster_worker_pool.h
@@ -29,6 +29,17 @@ class RasterWorkerPool {
return make_scoped_ptr(new RasterWorkerPool(num_raster_threads));
}
+ // Starts the worker pool. Returns true if the worker pool was successfully
+ // started; otherwise, returns false.
+ bool Start();
+
+ // Tells the worker pool to stop and returns once all pending tasks have
+ // completed.
+ void Stop();
+
+ // Returns true if the worker pool has been started, and not yet stopped.
+ bool IsRunning() const;
+
bool IsBusy();
void PostRasterTaskAndReply(PicturePileImpl* picture_pile,
@@ -89,8 +100,13 @@ class RasterWorkerPool {
scoped_refptr<PicturePileImpl> picture_pile,
const base::Closure& reply);
+ void SortRasterThreadsIfNeeded();
+
+ bool is_running_;
+
typedef std::vector<Thread*> ThreadVector;
ThreadVector raster_threads_;
+ bool raster_threads_need_sorting_;
DISALLOW_COPY_AND_ASSIGN(RasterWorkerPool);
};
« no previous file with comments | « no previous file | cc/raster_worker_pool.cc » ('j') | cc/raster_worker_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698