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

Unified Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 1129753002: [content/browser/service_worker] Using ThreadTaskRunnerHandle in lieu of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: content/browser/service_worker/service_worker_browsertest.cc
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc
index 3ef742e3cbb1e292b839ad4105dfb5aac34933ca..dc2bec68d36f9db67f6e0ca5d82bc51db1d4b46c 100644
--- a/content/browser/service_worker/service_worker_browsertest.cc
+++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -6,7 +6,9 @@
#include "base/callback.h"
#include "base/command_line.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/service_worker/embedded_worker_instance.h"
#include "content/browser/service_worker/embedded_worker_registry.h"
@@ -57,7 +59,7 @@ struct FetchResult {
void RunAndQuit(const base::Closure& closure,
const base::Closure& quit,
- base::MessageLoopProxy* original_message_loop) {
+ base::SingleThreadTaskRunner* original_message_loop) {
closure.Run();
original_message_loop->PostTask(FROM_HERE, quit);
}
@@ -66,9 +68,12 @@ void RunOnIOThreadWithDelay(const base::Closure& closure,
base::TimeDelta delay) {
base::RunLoop run_loop;
BrowserThread::PostDelayedTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&RunAndQuit, closure, run_loop.QuitClosure(),
- base::MessageLoopProxy::current()),
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&RunAndQuit,
+ closure,
+ run_loop.QuitClosure(),
+ base::ThreadTaskRunnerHandle::Get()),
delay);
run_loop.Run();
}
@@ -81,8 +86,8 @@ void RunOnIOThread(
const base::Callback<void(const base::Closure& continuation)>& closure) {
base::RunLoop run_loop;
base::Closure quit_on_original_thread =
- base::Bind(base::IgnoreResult(&base::MessageLoopProxy::PostTask),
- base::MessageLoopProxy::current().get(),
+ base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+ base::ThreadTaskRunnerHandle::Get().get(),
FROM_HERE,
run_loop.QuitClosure());
BrowserThread::PostTask(BrowserThread::IO,

Powered by Google App Engine
This is Rietveld 408576698