| OLD | NEW |
| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 channels_[1] = nullptr; | 120 channels_[1] = nullptr; |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 void CreateAndInitChannel(unsigned channel_index) { | 124 void CreateAndInitChannel(unsigned channel_index) { |
| 125 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); | 125 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); |
| 126 CHECK(channel_index == 0 || channel_index == 1); | 126 CHECK(channel_index == 0 || channel_index == 1); |
| 127 CHECK(!channels_[channel_index]); | 127 CHECK(!channels_[channel_index]); |
| 128 | 128 |
| 129 channels_[channel_index] = new Channel(&platform_support_); | 129 channels_[channel_index] = new Channel(&platform_support_); |
| 130 CHECK(channels_[channel_index]->Init( | 130 channels_[channel_index]->Init( |
| 131 RawChannel::Create(platform_handles_[channel_index].Pass()))); | 131 RawChannel::Create(platform_handles_[channel_index].Pass())); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void BootstrapChannelEndpointsOnIOThread(scoped_refptr<ChannelEndpoint> ep0, | 134 void BootstrapChannelEndpointsOnIOThread(scoped_refptr<ChannelEndpoint> ep0, |
| 135 scoped_refptr<ChannelEndpoint> ep1) { | 135 scoped_refptr<ChannelEndpoint> ep1) { |
| 136 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); | 136 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); |
| 137 | 137 |
| 138 if (!channels_[0]) | 138 if (!channels_[0]) |
| 139 CreateAndInitChannel(0); | 139 CreateAndInitChannel(0); |
| 140 if (!channels_[1]) | 140 if (!channels_[1]) |
| 141 CreateAndInitChannel(1); | 141 CreateAndInitChannel(1); |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 mp0->Close(0); | 1367 mp0->Close(0); |
| 1368 mp1->Close(1); | 1368 mp1->Close(1); |
| 1369 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 1369 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); |
| 1370 // Note that |local_mp|'s port 0 belong to |dispatcher|, which was closed. | 1370 // Note that |local_mp|'s port 0 belong to |dispatcher|, which was closed. |
| 1371 local_mp->Close(1); | 1371 local_mp->Close(1); |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 } // namespace | 1374 } // namespace |
| 1375 } // namespace system | 1375 } // namespace system |
| 1376 } // namespace mojo | 1376 } // namespace mojo |
| OLD | NEW |