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

Side by Side Diff: content/renderer/categorized_worker_pool.cc

Issue 2785943004: DCHECK tasks posted by TaskRunner::PostTask (Closed)
Patch Set: fix Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/categorized_worker_pool.h" 5 #include "content/renderer/categorized_worker_pool.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 base::Closure task, 56 base::Closure task,
57 base::TimeDelta delay) override { 57 base::TimeDelta delay) override {
58 return PostNonNestableDelayedTask(from_here, std::move(task), delay); 58 return PostNonNestableDelayedTask(from_here, std::move(task), delay);
59 } 59 }
60 bool RunsTasksOnCurrentThread() const override { return true; } 60 bool RunsTasksOnCurrentThread() const override { return true; }
61 61
62 // Overridden from base::SequencedTaskRunner: 62 // Overridden from base::SequencedTaskRunner:
63 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 63 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
64 base::Closure task, 64 base::Closure task,
65 base::TimeDelta delay) override { 65 base::TimeDelta delay) override {
66 DCHECK(task);
66 base::AutoLock lock(lock_); 67 base::AutoLock lock(lock_);
67 68
68 // Remove completed tasks. 69 // Remove completed tasks.
69 DCHECK(completed_tasks_.empty()); 70 DCHECK(completed_tasks_.empty());
70 task_graph_runner_->CollectCompletedTasks(namespace_token_, 71 task_graph_runner_->CollectCompletedTasks(namespace_token_,
71 &completed_tasks_); 72 &completed_tasks_);
72 73
73 tasks_.erase(tasks_.begin(), tasks_.begin() + completed_tasks_.size()); 74 tasks_.erase(tasks_.begin(), tasks_.begin() + completed_tasks_.size());
74 75
75 tasks_.push_back(make_scoped_refptr(new ClosureTask(std::move(task)))); 76 tasks_.push_back(make_scoped_refptr(new ClosureTask(std::move(task))));
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 : closure_(std::move(closure)) {} 419 : closure_(std::move(closure)) {}
419 420
420 // Overridden from cc::Task: 421 // Overridden from cc::Task:
421 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() { 422 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() {
422 std::move(closure_).Run(); 423 std::move(closure_).Run();
423 } 424 }
424 425
425 CategorizedWorkerPool::ClosureTask::~ClosureTask() {} 426 CategorizedWorkerPool::ClosureTask::~ClosureTask() {}
426 427
427 } // namespace content 428 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/after_startup_task_utils.cc ('k') | third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698