| 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_SHELL_RUNNER_HOST_MACH_BROKER_H_ | 5 #ifndef SERVICES_SHELL_RUNNER_HOST_MACH_BROKER_H_ |
| 6 #define SERVICES_SHELL_RUNNER_HOST_MACH_BROKER_H_ | 6 #define SERVICES_SHELL_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 mojo { | |
| 15 namespace shell { | 14 namespace shell { |
| 16 | 15 |
| 17 // 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 |
| 18 // Mach task ports for shell out-of-process applications. | 17 // Mach task ports for shell out-of-process applications. |
| 19 class MachBroker { | 18 class MachBroker { |
| 20 public: | 19 public: |
| 21 // 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. |
| 22 // For use in child processes. | 21 // For use in child processes. |
| 23 static void SendTaskPortToParent(); | 22 static void SendTaskPortToParent(); |
| 24 | 23 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 | 41 |
| 43 private: | 42 private: |
| 44 MachBroker(); | 43 MachBroker(); |
| 45 ~MachBroker(); | 44 ~MachBroker(); |
| 46 friend struct base::DefaultSingletonTraits<MachBroker>; | 45 friend struct base::DefaultSingletonTraits<MachBroker>; |
| 47 | 46 |
| 48 base::MachPortBroker broker_; | 47 base::MachPortBroker broker_; |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 } // namespace shell | 50 } // namespace shell |
| 52 } // namespace mojo | |
| 53 | 51 |
| 54 #endif // SERVICES_SHELL_RUNNER_HOST_MACH_BROKER_H_ | 52 #endif // SERVICES_SHELL_RUNNER_HOST_MACH_BROKER_H_ |
| OLD | NEW |