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

Unified Diff: mojo/edk/system/test/test_io_thread.h

Issue 1496663002: EDK: Make mojo::platform::TaskRunner's PostTask() take an std::function<void()>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 | « mojo/edk/system/slave_connection_manager.cc ('k') | mojo/edk/system/test/test_io_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/test/test_io_thread.h
diff --git a/mojo/edk/system/test/test_io_thread.h b/mojo/edk/system/test/test_io_thread.h
index a88fa558d22f9e2782af1028e2dac916bd0c78e1..b25c28aa2a857420c3c4252439332fede21de20c 100644
--- a/mojo/edk/system/test/test_io_thread.h
+++ b/mojo/edk/system/test/test_io_thread.h
@@ -5,6 +5,8 @@
#ifndef MOJO_EDK_SYSTEM_TEST_TEST_IO_THREAD_H_
#define MOJO_EDK_SYSTEM_TEST_TEST_IO_THREAD_H_
+#include <functional>
+
#include "base/callback_forward.h"
#include "base/threading/thread.h"
#include "mojo/edk/base_edk/platform_task_runner_impl.h"
@@ -35,9 +37,13 @@ class TestIOThread final {
bool IsCurrentAndRunning() const;
// Posts |task| to the I/O thread.
+ // TODO(vtl): Remove the |base::Closure| version.
+ void PostTask(std::function<void()>&& task);
void PostTask(const base::Closure& task);
// Posts |task| to the I/O thread, blocking the calling thread until the
// posted task is executed (note the deadlock risk!).
+ // TODO(vtl): Remove the |base::Closure| version.
+ void PostTaskAndWait(std::function<void()>&& task);
void PostTaskAndWait(const base::Closure& task);
base::MessageLoopForIO* message_loop() {
« no previous file with comments | « mojo/edk/system/slave_connection_manager.cc ('k') | mojo/edk/system/test/test_io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698