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

Unified Diff: cc/tiles/image_controller_unittest.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase without dcheck_in_ref_count Created 3 years, 9 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
Index: cc/tiles/image_controller_unittest.cc
diff --git a/cc/tiles/image_controller_unittest.cc b/cc/tiles/image_controller_unittest.cc
index ce728c36d2cbb797fbc02cb1caf4cffeb2929227..9b656facd3a2e64441f3789e081373f4c0cfcee6 100644
--- a/cc/tiles/image_controller_unittest.cc
+++ b/cc/tiles/image_controller_unittest.cc
@@ -26,7 +26,7 @@ class TestWorkerThread : public base::SimpleThread {
void Run() override {
for (;;) {
- base::Closure task;
+ base::OnceClosure task;
{
base::AutoLock hold(lock_);
if (shutdown_)
@@ -50,7 +50,7 @@ class TestWorkerThread : public base::SimpleThread {
condition_.Signal();
}
- void PostTask(base::Closure task) {
+ void PostTask(base::OnceClosure task) {
base::AutoLock hold(lock_);
queue_.push_back(std::move(task));
condition_.Signal();
@@ -59,7 +59,7 @@ class TestWorkerThread : public base::SimpleThread {
private:
base::Lock lock_;
base::ConditionVariable condition_;
- std::vector<base::Closure> queue_;
+ std::vector<base::OnceClosure> queue_;
bool shutdown_ = false;
};
@@ -68,13 +68,13 @@ class WorkerTaskRunner : public base::SequencedTaskRunner {
WorkerTaskRunner() { thread_.Start(); }
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
- base::Closure task,
+ base::OnceClosure task,
base::TimeDelta delay) override {
return PostDelayedTask(from_here, std::move(task), delay);
}
bool PostDelayedTask(const tracked_objects::Location& from_here,
- base::Closure task,
+ base::OnceClosure task,
base::TimeDelta delay) override {
thread_.PostTask(std::move(task));
return true;
@@ -141,7 +141,7 @@ class TestableCache : public ImageDecodeCache {
class DecodeClient {
public:
DecodeClient() {}
- void Callback(base::Closure quit_closure,
+ void Callback(base::OnceClosure quit_closure,
ImageController::ImageDecodeRequestId id,
ImageController::ImageDecodeResult result) {
id_ = id;

Powered by Google App Engine
This is Rietveld 408576698