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

Unified Diff: cc/resources/worker_pool.h

Issue 73923003: Shared Raster Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build Error for Mac, macro conflict, moving setter to WorkerPool. Created 6 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 | « cc/resources/tile_manager.cc ('k') | cc/resources/worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/worker_pool.h
diff --git a/cc/resources/worker_pool.h b/cc/resources/worker_pool.h
index b4d2623842d0a70482ff56373b39be9785249ddf..ee095d1336d723127794ee7c3336f21d715c04b8 100644
--- a/cc/resources/worker_pool.h
+++ b/cc/resources/worker_pool.h
@@ -105,7 +105,16 @@ class CC_EXPORT WorkerPool {
// completed.
virtual void Shutdown();
- protected:
+ // Sets the number of threads to use for running raster tasks.
+ // Can only be called once prior to GetNumRasterThreads().
+ // Caller is responsible for correct ordering.
+ // TODO(reveman): Move this to RasterWorkerPool: crbug.com/331844
+ static void SetNumRasterThreads(int num_threads);
+
+ // Gets the number of threads to use for running raster tasks.
+ // TODO(reveman): Move this to RasterWorkerPool: crbug.com/331844
+ static int GetNumRasterThreads();
+
// A task graph contains a unique set of tasks with edges between
// dependencies pointing in the direction of the dependents. Each task
// need to be assigned a unique priority and a run count that matches
@@ -113,8 +122,10 @@ class CC_EXPORT WorkerPool {
typedef base::ScopedPtrHashMap<internal::WorkerPoolTask*, internal::GraphNode>
GraphNodeMap;
typedef GraphNodeMap TaskGraph;
+ typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector;
- WorkerPool(size_t num_threads, const std::string& thread_name_prefix);
+ protected:
+ WorkerPool();
// Schedule running of tasks in |graph|. Any previously scheduled tasks
// that are not already running will be canceled. Canceled tasks don't run
@@ -125,17 +136,9 @@ class CC_EXPORT WorkerPool {
void CheckForCompletedWorkerTasks();
private:
- class Inner;
- friend class Inner;
-
- typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector;
-
void ProcessCompletedTasks(const TaskVector& completed_tasks);
bool in_dispatch_completion_callbacks_;
-
- // Hide the gory details of the worker pool in |inner_|.
- const scoped_ptr<Inner> inner_;
};
} // namespace cc
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | cc/resources/worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698