| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LINUX_SERVICES_BROKER_PROCESS_H_ | 5 #ifndef SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ |
| 6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ | 6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/pickle.h" | 14 #include "base/pickle.h" |
| 15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
| 16 #include "sandbox/linux/syscall_broker/broker_policy.h" | 16 #include "sandbox/linux/syscall_broker/broker_policy.h" |
| 17 #include "sandbox/sandbox_export.h" | 17 #include "sandbox/sandbox_export.h" |
| 18 | 18 |
| 19 namespace sandbox { | 19 namespace sandbox { |
| 20 | 20 |
| 21 namespace syscall_broker { | 21 namespace syscall_broker { |
| 22 |
| 22 class BrokerClient; | 23 class BrokerClient; |
| 23 } | |
| 24 | 24 |
| 25 // Create a new "broker" process to which we can send requests via an IPC | 25 // Create a new "broker" process to which we can send requests via an IPC |
| 26 // channel by forking the current process. | 26 // channel by forking the current process. |
| 27 // This is a low level IPC mechanism that is suitable to be called from a | 27 // This is a low level IPC mechanism that is suitable to be called from a |
| 28 // signal handler. | 28 // signal handler. |
| 29 // A process would typically create a broker process before entering | 29 // A process would typically create a broker process before entering |
| 30 // sandboxing. | 30 // sandboxing. |
| 31 // 1. BrokerProcess open_broker(read_whitelist, write_whitelist); | 31 // 1. BrokerProcess open_broker(read_whitelist, write_whitelist); |
| 32 // 2. CHECK(open_broker.Init(NULL)); | 32 // 2. CHECK(open_broker.Init(NULL)); |
| 33 // 3. Enable sandbox. | 33 // 3. Enable sandbox. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 syscall_broker::BrokerPolicy policy_; // The sandboxing policy. | 76 syscall_broker::BrokerPolicy policy_; // The sandboxing policy. |
| 77 scoped_ptr<syscall_broker::BrokerClient> | 77 scoped_ptr<syscall_broker::BrokerClient> |
| 78 broker_client_; // Can only exist if is_child_ is true. | 78 broker_client_; // Can only exist if is_child_ is true. |
| 79 | 79 |
| 80 int ipc_socketpair_; // Our communication channel to parent or child. | 80 int ipc_socketpair_; // Our communication channel to parent or child. |
| 81 DISALLOW_COPY_AND_ASSIGN(BrokerProcess); | 81 DISALLOW_COPY_AND_ASSIGN(BrokerProcess); |
| 82 | 82 |
| 83 friend class BrokerProcessTestHelper; | 83 friend class BrokerProcessTestHelper; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace syscall_broker |
| 87 |
| 86 } // namespace sandbox | 88 } // namespace sandbox |
| 87 | 89 |
| 88 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ | 90 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ |
| OLD | NEW |