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

Side by Side Diff: mojo/edk/system/message_pipe_test_utils.cc

Issue 852113002: Remove RawChannel::Init() and Channel::Init() failure cases. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/system/channel_unittest.cc ('k') | mojo/edk/system/raw_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/edk/system/message_pipe_test_utils.h" 5 #include "mojo/edk/system/message_pipe_test_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/platform_thread.h" // For |Sleep()|. 8 #include "base/threading/platform_thread.h" // For |Sleep()|.
9 #include "mojo/edk/system/channel.h" 9 #include "mojo/edk/system/channel.h"
10 #include "mojo/edk/system/channel_endpoint.h" 10 #include "mojo/edk/system/channel_endpoint.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 void ChannelThread::InitChannelOnIOThread( 69 void ChannelThread::InitChannelOnIOThread(
70 embedder::ScopedPlatformHandle platform_handle, 70 embedder::ScopedPlatformHandle platform_handle,
71 scoped_refptr<ChannelEndpoint> channel_endpoint) { 71 scoped_refptr<ChannelEndpoint> channel_endpoint) {
72 CHECK_EQ(base::MessageLoop::current(), test_io_thread_.message_loop()); 72 CHECK_EQ(base::MessageLoop::current(), test_io_thread_.message_loop());
73 CHECK(platform_handle.is_valid()); 73 CHECK(platform_handle.is_valid());
74 74
75 // Create and initialize |Channel|. 75 // Create and initialize |Channel|.
76 channel_ = new Channel(platform_support_); 76 channel_ = new Channel(platform_support_);
77 CHECK(channel_->Init(RawChannel::Create(platform_handle.Pass()))); 77 channel_->Init(RawChannel::Create(platform_handle.Pass()));
78 78
79 // Start the bootstrap endpoint. 79 // Start the bootstrap endpoint.
80 // Note: On the "server" (parent process) side, we need not attach/run the 80 // Note: On the "server" (parent process) side, we need not attach/run the
81 // endpoint immediately. However, on the "client" (child process) side, this 81 // endpoint immediately. However, on the "client" (child process) side, this
82 // *must* be done here -- otherwise, the |Channel| may receive/process 82 // *must* be done here -- otherwise, the |Channel| may receive/process
83 // messages (which it can do as soon as it's hooked up to the IO thread 83 // messages (which it can do as soon as it's hooked up to the IO thread
84 // message loop, and that message loop runs) before the endpoint is attached. 84 // message loop, and that message loop runs) before the endpoint is attached.
85 channel_->SetBootstrapEndpoint(channel_endpoint); 85 channel_->SetBootstrapEndpoint(channel_endpoint);
86 } 86 }
87 87
(...skipping 12 matching lines...) Expand all
100 } 100 }
101 101
102 void MultiprocessMessagePipeTestBase::Init(scoped_refptr<ChannelEndpoint> ep) { 102 void MultiprocessMessagePipeTestBase::Init(scoped_refptr<ChannelEndpoint> ep) {
103 channel_thread_.Start(helper_.server_platform_handle.Pass(), ep); 103 channel_thread_.Start(helper_.server_platform_handle.Pass(), ep);
104 } 104 }
105 #endif 105 #endif
106 106
107 } // namespace test 107 } // namespace test
108 } // namespace system 108 } // namespace system
109 } // namespace mojo 109 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/channel_unittest.cc ('k') | mojo/edk/system/raw_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698