| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/core.h" | 5 #include "mojo/edk/system/core.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void Core::AddChild(base::ProcessHandle process_handle, | 92 void Core::AddChild(base::ProcessHandle process_handle, |
| 93 ScopedPlatformHandle platform_handle) { | 93 ScopedPlatformHandle platform_handle) { |
| 94 GetNodeController()->ConnectToChild(process_handle, | 94 GetNodeController()->ConnectToChild(process_handle, |
| 95 std::move(platform_handle)); | 95 std::move(platform_handle)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void Core::InitChild(ScopedPlatformHandle platform_handle) { | 98 void Core::InitChild(ScopedPlatformHandle platform_handle) { |
| 99 GetNodeController()->ConnectToParent(std::move(platform_handle)); | 99 GetNodeController()->ConnectToParent(std::move(platform_handle)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void Core::SetMachPortProviderIfNeeded(base::PortProvider* port_provider) { |
| 103 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 104 GetNodeController()->CreateMachPortRelayIfNeeded(port_provider); |
| 105 #endif |
| 106 } |
| 107 |
| 102 MojoHandle Core::AddDispatcher(scoped_refptr<Dispatcher> dispatcher) { | 108 MojoHandle Core::AddDispatcher(scoped_refptr<Dispatcher> dispatcher) { |
| 103 base::AutoLock lock(handles_lock_); | 109 base::AutoLock lock(handles_lock_); |
| 104 return handles_.AddDispatcher(dispatcher); | 110 return handles_.AddDispatcher(dispatcher); |
| 105 } | 111 } |
| 106 | 112 |
| 107 bool Core::AddDispatchersFromTransit( | 113 bool Core::AddDispatchersFromTransit( |
| 108 const std::vector<Dispatcher::DispatcherInTransit>& dispatchers, | 114 const std::vector<Dispatcher::DispatcherInTransit>& dispatchers, |
| 109 MojoHandle* handles) { | 115 MojoHandle* handles) { |
| 110 bool failed = false; | 116 bool failed = false; |
| 111 { | 117 { |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 scoped_ptr<NodeController> node_controller) { | 825 scoped_ptr<NodeController> node_controller) { |
| 820 // It's OK to leak this reference. At this point we know the IO loop is still | 826 // It's OK to leak this reference. At this point we know the IO loop is still |
| 821 // running, and we know the NodeController will observe its eventual | 827 // running, and we know the NodeController will observe its eventual |
| 822 // destruction. This tells the NodeController to delete itself when that | 828 // destruction. This tells the NodeController to delete itself when that |
| 823 // happens. | 829 // happens. |
| 824 node_controller.release()->DestroyOnIOThreadShutdown(); | 830 node_controller.release()->DestroyOnIOThreadShutdown(); |
| 825 } | 831 } |
| 826 | 832 |
| 827 } // namespace edk | 833 } // namespace edk |
| 828 } // namespace mojo | 834 } // namespace mojo |
| OLD | NEW |