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

Unified Diff: mojo/edk/system/remote_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/raw_channel_unittest.cc ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/remote_data_pipe_impl_unittest.cc
diff --git a/mojo/edk/system/remote_data_pipe_impl_unittest.cc b/mojo/edk/system/remote_data_pipe_impl_unittest.cc
index c1e746fbe3ec194641b8dcd5c4645f758cdab83a..bde5087a8357511d07e192383ec6960e11bdb01e 100644
--- a/mojo/edk/system/remote_data_pipe_impl_unittest.cc
+++ b/mojo/edk/system/remote_data_pipe_impl_unittest.cc
@@ -9,7 +9,6 @@
#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"
@@ -49,16 +48,14 @@ class RemoteDataPipeImplTest : public testing::Test {
message_pipes_[0] = MessagePipe::CreateLocalProxy(&ep[0]);
message_pipes_[1] = MessagePipe::CreateLocalProxy(&ep[1]);
- io_thread_.PostTaskAndWait(base::Bind(
- &RemoteDataPipeImplTest::SetUpOnIOThread, base::Unretained(this),
- base::Passed(&ep[0]), base::Passed(&ep[1])));
+ io_thread_.PostTaskAndWait(
+ [this, &ep]() { SetUpOnIOThread(std::move(ep[0]), std::move(ep[1])); });
}
void TearDown() override {
EnsureMessagePipeClosed(0);
EnsureMessagePipeClosed(1);
- io_thread_.PostTaskAndWait(base::Bind(
- &RemoteDataPipeImplTest::TearDownOnIOThread, base::Unretained(this)));
+ io_thread_.PostTaskAndWait([this]() { TearDownOnIOThread(); });
}
protected:
@@ -86,10 +83,8 @@ class RemoteDataPipeImplTest : public testing::Test {
}
private:
- // 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/raw_channel_unittest.cc ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698