| 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 <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |