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 #ifndef SERVICES_SERVICE_MANAGER_RUNNER_HOST_MACH_BROKER_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_RUNNER_HOST_MACH_BROKER_H_ |
6 #define SERVICES_SERVICE_MANAGER_RUNNER_HOST_MACH_BROKER_H_ | 6 #define SERVICES_SERVICE_MANAGER_RUNNER_HOST_MACH_BROKER_H_ |
7 | 7 |
8 #include "base/mac/mach_port_broker.h" | 8 #include "base/mac/mach_port_broker.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 template <typename T> struct DefaultSingletonTraits; | 11 template <typename T> struct DefaultSingletonTraits; |
12 } | 12 } |
13 | 13 |
14 namespace shell { | 14 namespace service_manager { |
15 | 15 |
16 // A global singleton |MachBroker| is used by the shell to provide access to | 16 // A global singleton |MachBroker| is used by the shell to provide access to |
17 // Mach task ports for shell out-of-process applications. | 17 // Mach task ports for shell out-of-process applications. |
18 class MachBroker { | 18 class MachBroker { |
19 public: | 19 public: |
20 // Sends the task port of the current process to the parent over Mach IPC. | 20 // Sends the task port of the current process to the parent over Mach IPC. |
21 // For use in child processes. | 21 // For use in child processes. |
22 static void SendTaskPortToParent(); | 22 static void SendTaskPortToParent(); |
23 | 23 |
24 // Returns the global |MachBroker|. For use in the shell. | 24 // Returns the global |MachBroker|. For use in the shell. |
(...skipping 15 matching lines...) Expand all Loading... |
40 base::PortProvider* port_provider() { return &broker_; } | 40 base::PortProvider* port_provider() { return &broker_; } |
41 | 41 |
42 private: | 42 private: |
43 MachBroker(); | 43 MachBroker(); |
44 ~MachBroker(); | 44 ~MachBroker(); |
45 friend struct base::DefaultSingletonTraits<MachBroker>; | 45 friend struct base::DefaultSingletonTraits<MachBroker>; |
46 | 46 |
47 base::MachPortBroker broker_; | 47 base::MachPortBroker broker_; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace shell | 50 } // namespace service_manager |
51 | 51 |
52 #endif // SERVICES_SERVICE_MANAGER_RUNNER_HOST_MACH_BROKER_H_ | 52 #endif // SERVICES_SERVICE_MANAGER_RUNNER_HOST_MACH_BROKER_H_ |
OLD | NEW |