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

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

Issue 1712143002: [mojo-edk] Add support for transferring mach ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 4 years, 9 months 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/core.h ('k') | mojo/edk/system/mach_port_relay.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::SetMachPortProvider(base::PortProvider* port_provider) {
103 #if defined(OS_MACOSX) && !defined(OS_IOS)
104 GetNodeController()->CreateMachPortRelay(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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 scoped_ptr<NodeController> node_controller) { 863 scoped_ptr<NodeController> node_controller) {
858 // It's OK to leak this reference. At this point we know the IO loop is still 864 // It's OK to leak this reference. At this point we know the IO loop is still
859 // running, and we know the NodeController will observe its eventual 865 // running, and we know the NodeController will observe its eventual
860 // destruction. This tells the NodeController to delete itself when that 866 // destruction. This tells the NodeController to delete itself when that
861 // happens. 867 // happens.
862 node_controller.release()->DestroyOnIOThreadShutdown(); 868 node_controller.release()->DestroyOnIOThreadShutdown();
863 } 869 }
864 870
865 } // namespace edk 871 } // namespace edk
866 } // namespace mojo 872 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/mach_port_relay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698