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

Unified Diff: net/tools/stress_cache/stress_cache.cc

Issue 2410243002: Remove MessageLoop::current() from stress_cache.cc. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/stress_cache/stress_cache.cc
diff --git a/net/tools/stress_cache/stress_cache.cc b/net/tools/stress_cache/stress_cache.cc
index b4375f49d475b4c4641ad5401aee04dad536974f..fefcd72f23d7177f48a743d6bc33cf610fe72b67 100644
--- a/net/tools/stress_cache/stress_cache.cc
+++ b/net/tools/stress_cache/stress_cache.cc
@@ -341,11 +341,11 @@ void StressTheCache(int iteration) {
bool g_crashing = false;
// RunSoon() and CrashCallback() reference each other, unfortunately.
-void RunSoon(base::MessageLoop* target_loop);
+void RunSoon(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
void CrashCallback() {
// Keep trying to run.
- RunSoon(base::MessageLoop::current());
+ RunSoon(base::ThreadTaskRunnerHandle::Get());
if (g_crashing)
return;
@@ -363,10 +363,10 @@ void CrashCallback() {
}
}
-void RunSoon(base::MessageLoop* target_loop) {
+void RunSoon(scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
const base::TimeDelta kTaskDelay = base::TimeDelta::FromSeconds(10);
- target_loop->task_runner()->PostDelayedTask(
- FROM_HERE, base::Bind(&CrashCallback), kTaskDelay);
+ task_runner->PostDelayedTask(FROM_HERE, base::Bind(&CrashCallback),
+ kTaskDelay);
}
// We leak everything here :)
@@ -375,7 +375,7 @@ bool StartCrashThread() {
if (!thread->Start())
return false;
- RunSoon(thread->message_loop());
+ RunSoon(thread->task_runner());
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698