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

Unified Diff: ipc/ipc_send_fds_test.cc

Issue 1127153003: ipc: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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
« no previous file with comments | « ipc/ipc_perftest_support.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_send_fds_test.cc
diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc
index 2e05e03caf6e79e8aee670c35b8f42f44d2c9b94..148eecab125798ceff28de3e039d20e914a1e0b1 100644
--- a/ipc/ipc_send_fds_test.cc
+++ b/ipc/ipc_send_fds_test.cc
@@ -19,9 +19,10 @@ extern "C" {
#include "base/callback.h"
#include "base/file_descriptor_posix.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/pickle.h"
#include "base/posix/eintr_wrapper.h"
+#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "ipc/ipc_message_attachment_set.h"
#include "ipc/ipc_message_utils.h"
@@ -250,12 +251,10 @@ class PipeChannelHelper {
out = IPC::Channel::CreateClient(out_handle, &cb_listener_);
// PostTask the connect calls to make sure the callbacks happens
// on the right threads.
- in_thread_->message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&PipeChannelHelper::Connect, in.get()));
- out_thread_->message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&PipeChannelHelper::Connect, out.get()));
+ in_thread_->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&PipeChannelHelper::Connect, in.get()));
+ out_thread_->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&PipeChannelHelper::Connect, out.get()));
}
static void DestroyChannel(scoped_ptr<IPC::Channel> *c,
@@ -267,12 +266,10 @@ class PipeChannelHelper {
~PipeChannelHelper() {
base::WaitableEvent a(true, false);
base::WaitableEvent b(true, false);
- in_thread_->message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&PipeChannelHelper::DestroyChannel, &in, &a));
- out_thread_->message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&PipeChannelHelper::DestroyChannel, &out, &b));
+ in_thread_->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&PipeChannelHelper::DestroyChannel, &in, &a));
+ out_thread_->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&PipeChannelHelper::DestroyChannel, &out, &b));
a.Wait();
b.Wait();
}
@@ -321,11 +318,9 @@ class IPCMultiSendingFdsTest : public testing::Test {
for (int i = 0; i < pipes_to_send; i++) {
received_.Reset();
std::pair<int, int> pipe_fds = make_socket_pair();
- t->message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&PipeChannelHelper::Send,
- base::Unretained(dest),
- pipe_fds.second));
+ t->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&PipeChannelHelper::Send,
+ base::Unretained(dest), pipe_fds.second));
char tmp = 'x';
CHECK_EQ(1, HANDLE_EINTR(write(pipe_fds.first, &tmp, 1)));
CHECK_EQ(0, IGNORE_EINTR(close(pipe_fds.first)));
« no previous file with comments | « ipc/ipc_perftest_support.cc ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698