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

Unified Diff: mojo/system/message_pipe_test_utils.cc

Issue 588193004: Mojo: Have |ProxyMessagePipeEndpoint|s constructed with a |ChannelEndpoint|. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « mojo/system/message_pipe_test_utils.h ('k') | mojo/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_pipe_test_utils.cc
diff --git a/mojo/system/message_pipe_test_utils.cc b/mojo/system/message_pipe_test_utils.cc
index 40f80d2f7d32e27efec2c43fe46d16949911a285..c70f0a0c2afd54c802de64decc61f35f4f4ba6e5 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
« no previous file with comments | « mojo/system/message_pipe_test_utils.h ('k') | mojo/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698