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

Unified Diff: tools/gn/scheduler.cc

Issue 2085023004: Remove calls to deprecated MessageLoop methods in tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: tools/gn/scheduler.cc
diff --git a/tools/gn/scheduler.cc b/tools/gn/scheduler.cc
index b2e2a006b96ebe69fba51f4a93e74e78f4bbce24..b5f3dd07a277ecaef22de100fa8d226afc0603b5 100644
--- a/tools/gn/scheduler.cc
+++ b/tools/gn/scheduler.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "tools/gn/standard_out.h"
@@ -101,9 +102,9 @@ void Scheduler::Log(const std::string& verb, const std::string& msg) {
} else {
// The run loop always joins on the sub threads, so the lifetime of this
// object outlives the invocations of this function, hence "unretained".
- main_loop_.PostTask(FROM_HERE,
- base::Bind(&Scheduler::LogOnMainThread,
- base::Unretained(this), verb, msg));
+ main_loop_.task_runner()->PostTask(
+ FROM_HERE, base::Bind(&Scheduler::LogOnMainThread,
+ base::Unretained(this), verb, msg));
}
}
@@ -122,9 +123,9 @@ void Scheduler::FailWithError(const Err& err) {
} else {
// The run loop always joins on the sub threads, so the lifetime of this
// object outlives the invocations of this function, hence "unretained".
- main_loop_.PostTask(FROM_HERE,
- base::Bind(&Scheduler::FailWithErrorOnMainThread,
- base::Unretained(this), err));
+ main_loop_.task_runner()->PostTask(
+ FROM_HERE, base::Bind(&Scheduler::FailWithErrorOnMainThread,
+ base::Unretained(this), err));
}
}
@@ -210,9 +211,9 @@ void Scheduler::DecrementWorkCount() {
if (base::MessageLoop::current() == &main_loop_) {
OnComplete();
} else {
- main_loop_.PostTask(FROM_HERE,
- base::Bind(&Scheduler::OnComplete,
- base::Unretained(this)));
+ main_loop_.task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&Scheduler::OnComplete, base::Unretained(this)));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698