| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_ | 5 #ifndef SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_ |
| 6 #define SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_ | 6 #define SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_ |
| 7 | 7 |
| 8 #include <mach/mach.h> | 8 #include <mach/mach.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // Called in the parent when a process has died. It cleans up the references | 77 // Called in the parent when a process has died. It cleans up the references |
| 78 // to the process. | 78 // to the process. |
| 79 void InvalidateClient(base::ProcessHandle handle); | 79 void InvalidateClient(base::ProcessHandle handle); |
| 80 | 80 |
| 81 // Looks up the policy for a given process ID. If no policy is associated | 81 // Looks up the policy for a given process ID. If no policy is associated |
| 82 // with the |pid|, this returns NULL. | 82 // with the |pid|, this returns NULL. |
| 83 const BootstrapSandboxPolicy* PolicyForProcess(pid_t pid) const; | 83 const BootstrapSandboxPolicy* PolicyForProcess(pid_t pid) const; |
| 84 | 84 |
| 85 std::string server_bootstrap_name() const { return server_bootstrap_name_; } | 85 std::string server_bootstrap_name() const { return server_bootstrap_name_; } |
| 86 mach_port_t real_bootstrap_port() const { return real_bootstrap_port_; } | 86 mach_port_t real_bootstrap_port() const { return real_bootstrap_port_.get(); } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 BootstrapSandbox(); | 89 BootstrapSandbox(); |
| 90 | 90 |
| 91 // Dispatch callout for when a client sends a message on the | 91 // Dispatch callout for when a client sends a message on the |
| 92 // |check_in_port_|. If the client message is valid, it will assign the | 92 // |check_in_port_|. If the client message is valid, it will assign the |
| 93 // client from |awaiting_processes_| to |sandboxed_processes_|. | 93 // client from |awaiting_processes_| to |sandboxed_processes_|. |
| 94 void HandleChildCheckIn(); | 94 void HandleChildCheckIn(); |
| 95 | 95 |
| 96 // The name in the system bootstrap server by which the |server_|'s port | 96 // The name in the system bootstrap server by which the |server_|'s port |
| (...skipping 24 matching lines...) Expand all Loading... |
| 121 | 121 |
| 122 // The port and dispatch source for receiving client check in messages sent | 122 // The port and dispatch source for receiving client check in messages sent |
| 123 // via ClientCheckIn(). | 123 // via ClientCheckIn(). |
| 124 base::mac::ScopedMachReceiveRight check_in_port_; | 124 base::mac::ScopedMachReceiveRight check_in_port_; |
| 125 scoped_ptr<base::DispatchSourceMach> check_in_server_; | 125 scoped_ptr<base::DispatchSourceMach> check_in_server_; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace sandbox | 128 } // namespace sandbox |
| 129 | 129 |
| 130 #endif // SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_ | 130 #endif // SANDBOX_MAC_BOOTSTRAP_SANDBOX_H_ |
| OLD | NEW |