| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/remote_message_pipe_bootstrap.h" | 5 #include "mojo/edk/system/remote_message_pipe_bootstrap.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ports::PortName port_name; | 25 ports::PortName port_name; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 // static | 30 // static |
| 31 void RemoteMessagePipeBootstrap::Create( | 31 void RemoteMessagePipeBootstrap::Create( |
| 32 NodeController* node_controller, | 32 NodeController* node_controller, |
| 33 ScopedPlatformHandle platform_handle, | 33 ScopedPlatformHandle platform_handle, |
| 34 const ports::PortRef& port) { | 34 const ports::PortRef& port) { |
| 35 CHECK(node_controller); |
| 36 CHECK(node_controller->io_task_runner()); |
| 35 if (node_controller->io_task_runner()->RunsTasksOnCurrentThread()) { | 37 if (node_controller->io_task_runner()->RunsTasksOnCurrentThread()) { |
| 36 // Owns itself. | 38 // Owns itself. |
| 37 new RemoteMessagePipeBootstrap( | 39 new RemoteMessagePipeBootstrap( |
| 38 node_controller, std::move(platform_handle), port); | 40 node_controller, std::move(platform_handle), port); |
| 39 } else { | 41 } else { |
| 40 node_controller->io_task_runner()->PostTask( | 42 node_controller->io_task_runner()->PostTask( |
| 41 FROM_HERE, | 43 FROM_HERE, |
| 42 base::Bind(&RemoteMessagePipeBootstrap::Create, | 44 base::Bind(&RemoteMessagePipeBootstrap::Create, |
| 43 base::Unretained(node_controller), | 45 base::Unretained(node_controller), |
| 44 base::Passed(&platform_handle), port)); | 46 base::Passed(&platform_handle), port)); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); | 140 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); |
| 139 ShutDown(); | 141 ShutDown(); |
| 140 } | 142 } |
| 141 | 143 |
| 142 void RemoteMessagePipeBootstrap::ShutDownNow() { | 144 void RemoteMessagePipeBootstrap::ShutDownNow() { |
| 143 delete this; | 145 delete this; |
| 144 } | 146 } |
| 145 | 147 |
| 146 } // namespace edk | 148 } // namespace edk |
| 147 } // namespace mojo | 149 } // namespace mojo |
| OLD | NEW |