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

Unified Diff: trunk/src/cc/resources/raster_worker_pool.h

Issue 16178002: Revert 202363 "cc: Cancel and re-prioritize worker pool tasks." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 | « trunk/src/cc/resources/managed_tile_state.h ('k') | trunk/src/cc/resources/raster_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/resources/raster_worker_pool.h
===================================================================
--- trunk/src/cc/resources/raster_worker_pool.h (revision 202735)
+++ trunk/src/cc/resources/raster_worker_pool.h (working copy)
@@ -5,6 +5,8 @@
#ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_
#define CC_RESOURCES_RASTER_WORKER_POOL_H_
+#include <string>
+
#include "cc/base/worker_pool.h"
namespace cc {
@@ -13,73 +15,18 @@
// A worker thread pool that runs raster tasks.
class CC_EXPORT RasterWorkerPool : public WorkerPool {
public:
- class Task {
- public:
- typedef base::Callback<void(bool)> Reply;
+ typedef base::Callback<void(PicturePileImpl* picture_pile)> RasterCallback;
- // Highest priority task first. Order of execution is not guaranteed.
- class Queue {
- public:
- Queue();
- ~Queue();
-
- bool empty() const { return tasks_.empty(); }
-
- // Add task to the back of the queue.
- void Append(const Task& task);
-
- private:
- friend class RasterWorkerPool;
-
- internal::WorkerPoolTask::TaskVector tasks_;
- };
-
- Task();
- Task(const base::Closure& callback, const Reply& reply);
- explicit Task(Queue* dependencies);
- ~Task();
-
- // Returns true if Task is null (doesn't refer to anything).
- bool is_null() const { return !internal_; }
-
- // Returns the Task into an uninitialized state.
- void Reset();
-
- protected:
- friend class RasterWorkerPool;
-
- explicit Task(scoped_refptr<internal::WorkerPoolTask> internal);
-
- scoped_refptr<internal::WorkerPoolTask> internal_;
- };
-
- class PictureTask : public Task {
- public:
- typedef base::Callback<void(PicturePileImpl*)> Callback;
-
- PictureTask(PicturePileImpl* picture_pile,
- const Callback& callback,
- const Reply& reply,
- Queue* dependencies);
- };
-
virtual ~RasterWorkerPool();
static scoped_ptr<RasterWorkerPool> Create(size_t num_threads) {
return make_scoped_ptr(new RasterWorkerPool(num_threads));
}
- // Tells the worker pool to shutdown after canceling all previously
- // scheduled tasks. Reply callbacks are still guaranteed to run.
- virtual void Shutdown() OVERRIDE;
+ void PostRasterTaskAndReply(PicturePileImpl* picture_pile,
+ const RasterCallback& task,
+ const base::Closure& reply);
- // Schedule running of |root| task and all its dependencies. Tasks
- // previously scheduled but no longer needed to run |root| will be
- // canceled unless already running. Once scheduled, reply callbacks
- // are guaranteed to run for all tasks even if they later get
- // canceled by another call to ScheduleTasks().
- void ScheduleTasks(Task* root);
-
private:
explicit RasterWorkerPool(size_t num_threads);
« no previous file with comments | « trunk/src/cc/resources/managed_tile_state.h ('k') | trunk/src/cc/resources/raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698