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

Unified Diff: mojo/edk/system/data_pipe_impl_unittest.cc

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/channel_unittest.cc ('k') | mojo/edk/system/endpoint_relayer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/data_pipe_impl_unittest.cc
diff --git a/mojo/edk/system/data_pipe_impl_unittest.cc b/mojo/edk/system/data_pipe_impl_unittest.cc
index 0350cc7ed018d72850320b416df193a8213bf64d..1cf048037b90167901d2a41e71d43790975b1b5b 100644
--- a/mojo/edk/system/data_pipe_impl_unittest.cc
+++ b/mojo/edk/system/data_pipe_impl_unittest.cc
@@ -12,7 +12,6 @@
#include <memory>
#include <utility>
-#include "base/bind.h"
#include "base/logging.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/simple_platform_support.h"
@@ -234,17 +233,15 @@ class RemoteDataPipeImplTestHelper : public DataPipeImplTestHelper {
message_pipes_[0] = MessagePipe::CreateLocalProxy(&ep[0]);
message_pipes_[1] = MessagePipe::CreateLocalProxy(&ep[1]);
- io_thread_.PostTaskAndWait(base::Bind(
- &RemoteDataPipeImplTestHelper::SetUpOnIOThread, base::Unretained(this),
- base::Passed(&ep[0]), base::Passed(&ep[1])));
+ io_thread_.PostTaskAndWait([this, &ep]() mutable {
+ SetUpOnIOThread(std::move(ep[0]), std::move(ep[1]));
+ });
}
void TearDown() override {
EnsureMessagePipeClosed(0);
EnsureMessagePipeClosed(1);
- io_thread_.PostTaskAndWait(
- base::Bind(&RemoteDataPipeImplTestHelper::TearDownOnIOThread,
- base::Unretained(this)));
+ io_thread_.PostTaskAndWait([this]() { TearDownOnIOThread(); });
}
void Create(const MojoCreateDataPipeOptions& validated_options) override {
@@ -318,10 +315,8 @@ class RemoteDataPipeImplTestHelper : public DataPipeImplTestHelper {
message_pipes_[i] = nullptr;
}
- // TODO(vtl): The arguments should be rvalue references, but that doesn't
- // currently work correctly with base::Bind.
- void SetUpOnIOThread(RefPtr<ChannelEndpoint> ep0,
- RefPtr<ChannelEndpoint> ep1) {
+ void SetUpOnIOThread(RefPtr<ChannelEndpoint>&& ep0,
+ RefPtr<ChannelEndpoint>&& ep1) {
CHECK(io_thread_.IsCurrentAndRunning());
embedder::PlatformChannelPair channel_pair;
« no previous file with comments | « mojo/edk/system/channel_unittest.cc ('k') | mojo/edk/system/endpoint_relayer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698