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

Unified Diff: mojo/system/multiprocess_message_pipe_unittest.cc

Issue 137273003: Mojo: Rename PlatformChannelHandle to PlatformHandle, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 11 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/channel.cc ('k') | mojo/system/platform_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/multiprocess_message_pipe_unittest.cc
diff --git a/mojo/system/multiprocess_message_pipe_unittest.cc b/mojo/system/multiprocess_message_pipe_unittest.cc
index 85318266f417cf181970440f0e0304a94f90b695..406596552e99e84cc0e7b76ff9795cd9377164a4 100644
--- a/mojo/system/multiprocess_message_pipe_unittest.cc
+++ b/mojo/system/multiprocess_message_pipe_unittest.cc
@@ -21,8 +21,8 @@
#include "mojo/system/channel.h"
#include "mojo/system/local_message_pipe_endpoint.h"
#include "mojo/system/message_pipe.h"
-#include "mojo/system/platform_channel.h"
#include "mojo/system/proxy_message_pipe_endpoint.h"
+#include "mojo/system/scoped_platform_handle.h"
#include "mojo/system/test_utils.h"
#include "mojo/system/waiter.h"
@@ -48,13 +48,14 @@ class IOThreadWrapper {
test::PostTaskAndWait(task_runner(), from_here, task);
}
- void Init(PlatformChannel* platform_channel, scoped_refptr<MessagePipe> mp) {
+ void Init(ScopedPlatformHandle platform_handle,
+ scoped_refptr<MessagePipe> mp) {
io_thread_.StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
PostTask(FROM_HERE,
base::Bind(&IOThreadWrapper::InitOnIOThread,
base::Unretained(this),
- platform_channel, mp));
+ base::Passed(&platform_handle), mp));
}
void Shutdown() {
@@ -75,15 +76,14 @@ class IOThreadWrapper {
}
private:
- void InitOnIOThread(PlatformChannel* platform_channel,
+ void InitOnIOThread(ScopedPlatformHandle platform_handle,
scoped_refptr<MessagePipe> mp) {
CHECK_EQ(base::MessageLoop::current(), message_loop());
- CHECK(platform_channel);
- CHECK(platform_channel->is_valid());
+ CHECK(platform_handle.is_valid());
// Create and initialize |Channel|.
channel_ = new Channel();
- CHECK(channel_->Init(platform_channel->PassHandle()));
+ CHECK(channel_->Init(platform_handle.Pass()));
// Attach the message pipe endpoint.
// Note: On the "server" (parent process) side, we need not attach the
@@ -122,7 +122,7 @@ class MultiprocessMessagePipeTest : public mojo::test::MultiprocessTestBase {
}
void Init(scoped_refptr<MessagePipe> mp) {
- io_thread_wrapper_.Init(server_platform_channel.get(), mp);
+ io_thread_wrapper_.Init(server_platform_handle.Pass(), mp);
}
private:
@@ -152,14 +152,13 @@ MojoResult WaitIfNecessary(scoped_refptr<MessagePipe> mp, MojoWaitFlags flags) {
// not including any "quitquitquit" message, modulo 100.
MOJO_MULTIPROCESS_TEST_CHILD_MAIN(EchoEcho) {
IOThreadWrapper io_thread_wrapper;
- PlatformChannel* const client_platform_channel =
- MultiprocessMessagePipeTest::client_platform_channel.get();
- CHECK(client_platform_channel);
- CHECK(client_platform_channel->is_valid());
+ ScopedPlatformHandle client_platform_handle =
+ MultiprocessMessagePipeTest::client_platform_handle.Pass();
+ CHECK(client_platform_handle.is_valid());
scoped_refptr<MessagePipe> mp(new MessagePipe(
scoped_ptr<MessagePipeEndpoint>(new LocalMessagePipeEndpoint()),
scoped_ptr<MessagePipeEndpoint>(new ProxyMessagePipeEndpoint())));
- io_thread_wrapper.Init(client_platform_channel, mp);
+ io_thread_wrapper.Init(client_platform_handle.Pass(), mp);
const std::string quitquitquit("quitquitquit");
int rv = 0;
« no previous file with comments | « mojo/system/channel.cc ('k') | mojo/system/platform_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698