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

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

Issue 1530443005: EDK: Add PlatformHandleWatcher to Channel (and ChannelManager) classes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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/remote_data_pipe_impl_unittest.cc ('k') | no next file » | 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 <stdint.h> 5 #include <stdint.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 } 116 }
117 117
118 void CreateAndInitChannel(unsigned channel_index) { 118 void CreateAndInitChannel(unsigned channel_index) {
119 CHECK(io_thread()->IsCurrentAndRunning()); 119 CHECK(io_thread()->IsCurrentAndRunning());
120 CHECK(channel_index == 0 || channel_index == 1); 120 CHECK(channel_index == 0 || channel_index == 1);
121 CHECK(!channels_[channel_index]); 121 CHECK(!channels_[channel_index]);
122 122
123 channels_[channel_index] = MakeRefCounted<Channel>(&platform_support_); 123 channels_[channel_index] = MakeRefCounted<Channel>(&platform_support_);
124 channels_[channel_index]->Init( 124 channels_[channel_index]->Init(
125 io_thread()->task_runner().Clone(),
126 io_thread()->platform_handle_watcher(),
125 RawChannel::Create(platform_handles_[channel_index].Pass())); 127 RawChannel::Create(platform_handles_[channel_index].Pass()));
126 } 128 }
127 129
128 void BootstrapChannelEndpointsOnIOThread(RefPtr<ChannelEndpoint>&& ep0, 130 void BootstrapChannelEndpointsOnIOThread(RefPtr<ChannelEndpoint>&& ep0,
129 RefPtr<ChannelEndpoint>&& ep1) { 131 RefPtr<ChannelEndpoint>&& ep1) {
130 CHECK(io_thread()->IsCurrentAndRunning()); 132 CHECK(io_thread()->IsCurrentAndRunning());
131 133
132 if (!channels_[0]) 134 if (!channels_[0])
133 CreateAndInitChannel(0); 135 CreateAndInitChannel(0);
134 if (!channels_[1]) 136 if (!channels_[1])
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 mp0->Close(0); 1350 mp0->Close(0);
1349 mp1->Close(1); 1351 mp1->Close(1);
1350 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); 1352 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close());
1351 // Note that |local_mp|'s port 0 belong to |dispatcher|, which was closed. 1353 // Note that |local_mp|'s port 0 belong to |dispatcher|, which was closed.
1352 local_mp->Close(1); 1354 local_mp->Close(1);
1353 } 1355 }
1354 1356
1355 } // namespace 1357 } // namespace
1356 } // namespace system 1358 } // namespace system
1357 } // namespace mojo 1359 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/remote_data_pipe_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698