| Index: cc/worker_pool.cc
|
| diff --git a/cc/worker_pool.cc b/cc/worker_pool.cc
|
| index 5797ab473c30aa4169f7136544aef5e3fe79e870..11a2a4e9026bbdf4eb98b5efc9c9f0c1e87b6429 100644
|
| --- a/cc/worker_pool.cc
|
| +++ b/cc/worker_pool.cc
|
| @@ -59,12 +59,10 @@ void WorkerPoolTask::Completed() {
|
|
|
| WorkerPool::Worker::Worker(
|
| WorkerPool* worker_pool,
|
| - const std::string name,
|
| - scoped_ptr<RenderingStats> rendering_stats)
|
| + const std::string name)
|
| : base::Thread(name.c_str()),
|
| worker_pool_(worker_pool),
|
| - weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
|
| - rendering_stats_(rendering_stats.Pass()) {
|
| + weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
|
| Start();
|
| DCHECK(IsRunning());
|
| }
|
| @@ -125,18 +123,15 @@ void WorkerPool::Worker::OnTaskCompleted() {
|
| worker_pool_->DidNumPendingTasksChange();
|
| }
|
|
|
| -WorkerPool::WorkerPool(size_t num_threads, bool record_rendering_stats)
|
| +WorkerPool::WorkerPool(size_t num_threads)
|
| : workers_need_sorting_(false),
|
| shutdown_(false) {
|
| const std::string thread_name_prefix = kWorkerThreadNamePrefix;
|
| while (workers_.size() < num_threads) {
|
| int thread_number = workers_.size() + 1;
|
| - scoped_ptr<RenderingStats> rendering_stats = record_rendering_stats ?
|
| - make_scoped_ptr(new RenderingStats) : scoped_ptr<RenderingStats>();
|
| workers_.push_back(new Worker(
|
| this,
|
| - thread_name_prefix + StringPrintf("Worker%d", thread_number).c_str(),
|
| - rendering_stats.Pass()));
|
| + thread_name_prefix + StringPrintf("Worker%d", thread_number).c_str()));
|
| }
|
| }
|
|
|
| @@ -172,6 +167,15 @@ bool WorkerPool::IsBusy() {
|
| return worker->num_pending_tasks() >= kNumPendingTasksPerWorker;
|
| }
|
|
|
| +void WorkerPool::SetRecordRenderingStats(bool record_rendering_stats) {
|
| + for (WorkerVector::iterator it = workers_.begin();
|
| + it != workers_.end(); ++it) {
|
| + Worker* worker = *it;
|
| + worker->SetRenderingStats(record_rendering_stats ?
|
| + make_scoped_ptr(new RenderingStats) : scoped_ptr<RenderingStats>());
|
| + }
|
| +}
|
| +
|
| void WorkerPool::GetRenderingStats(RenderingStats* stats) {
|
| stats->totalRasterizeTime = base::TimeDelta();
|
| stats->totalPixelsRasterized = 0;
|
|
|