summaryrefslogtreecommitdiffstats
path: root/mojo/system/message_pipe_test_utils.cc
diff options
context:
space:
mode:
authorviettrungluu <viettrungluu@chromium.org>2014-09-24 12:23:09 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-24 19:23:29 +0000
commit23ae8173cca87c9dd9ca71cf3142f75a88e43919 (patch)
treed5b218afedf74134a50a71e67e751f6f7c3c80a0 /mojo/system/message_pipe_test_utils.cc
parentfaa99f8c03c439f26c5ff497d3804b0818f1cf2f (diff)
downloadchromium_src-23ae8173cca87c9dd9ca71cf3142f75a88e43919.zip
chromium_src-23ae8173cca87c9dd9ca71cf3142f75a88e43919.tar.gz
chromium_src-23ae8173cca87c9dd9ca71cf3142f75a88e43919.tar.bz2
Mojo: Have |ProxyMessagePipeEndpoint|s constructed with a |ChannelEndpoint|.
This eliminates the need for |ProxyMessagePipeEndpoint::Attach()|. R=brettw@chromium.org Review URL: https://codereview.chromium.org/588193004 Cr-Commit-Position: refs/heads/master@{#296485}
Diffstat (limited to 'mojo/system/message_pipe_test_utils.cc')
-rw-r--r--mojo/system/message_pipe_test_utils.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/mojo/system/message_pipe_test_utils.cc b/mojo/system/message_pipe_test_utils.cc
index 40f80d2..c70f0a0c 100644
--- a/mojo/system/message_pipe_test_utils.cc
+++ b/mojo/system/message_pipe_test_utils.cc
@@ -6,7 +6,9 @@
#include "base/bind.h"
#include "base/threading/platform_thread.h" // For |Sleep()|.
+#include "mojo/system/channel.h"
#include "mojo/system/channel_endpoint.h"
+#include "mojo/system/message_pipe.h"
#include "mojo/system/waiter.h"
namespace mojo {
@@ -40,14 +42,14 @@ ChannelThread::~ChannelThread() {
}
void ChannelThread::Start(embedder::ScopedPlatformHandle platform_handle,
- scoped_refptr<MessagePipe> message_pipe) {
+ scoped_refptr<ChannelEndpoint> channel_endpoint) {
test_io_thread_.Start();
test_io_thread_.PostTaskAndWait(
FROM_HERE,
base::Bind(&ChannelThread::InitChannelOnIOThread,
base::Unretained(this),
base::Passed(&platform_handle),
- message_pipe));
+ channel_endpoint));
}
void ChannelThread::Stop() {
@@ -68,7 +70,7 @@ void ChannelThread::Stop() {
void ChannelThread::InitChannelOnIOThread(
embedder::ScopedPlatformHandle platform_handle,
- scoped_refptr<MessagePipe> message_pipe) {
+ scoped_refptr<ChannelEndpoint> channel_endpoint) {
CHECK_EQ(base::MessageLoop::current(), test_io_thread_.message_loop());
CHECK(platform_handle.is_valid());
@@ -83,8 +85,7 @@ void ChannelThread::InitChannelOnIOThread(
// receive/process messages (which it can do as soon as it's hooked up to
// the IO thread message loop, and that message loop runs) before the
// message pipe endpoint is attached.
- CHECK_EQ(channel_->AttachEndpoint(
- make_scoped_refptr(new ChannelEndpoint(message_pipe.get(), 1))),
+ CHECK_EQ(channel_->AttachEndpoint(channel_endpoint),
Channel::kBootstrapEndpointId);
CHECK(channel_->RunMessagePipeEndpoint(Channel::kBootstrapEndpointId,
Channel::kBootstrapEndpointId));
@@ -104,8 +105,8 @@ MultiprocessMessagePipeTestBase::MultiprocessMessagePipeTestBase()
MultiprocessMessagePipeTestBase::~MultiprocessMessagePipeTestBase() {
}
-void MultiprocessMessagePipeTestBase::Init(scoped_refptr<MessagePipe> mp) {
- channel_thread_.Start(helper_.server_platform_handle.Pass(), mp);
+void MultiprocessMessagePipeTestBase::Init(scoped_refptr<ChannelEndpoint> ep) {
+ channel_thread_.Start(helper_.server_platform_handle.Pass(), ep);
}
#endif