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_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ | 5 #ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ |
6 #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ | 6 #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
10 namespace sandbox { | 10 namespace sandbox { |
11 | 11 |
12 namespace syscall_broker { | 12 namespace syscall_broker { |
13 | 13 |
14 class BrokerPolicy; | 14 class BrokerPolicy; |
15 | 15 |
16 // The BrokerHost class should be embedded in a (presumably not sandboxed) | 16 // The BrokerHost class should be embedded in a (presumably not sandboxed) |
17 // process. It will honor IPC requests from a BrokerClient sent over | 17 // process. It will honor IPC requests from a BrokerClient sent over |
18 // |ipc_channel| according to |broker_policy|. | 18 // |ipc_channel| according to |broker_policy|. |
19 class BrokerHost { | 19 class BrokerHost { |
20 public: | 20 public: |
| 21 enum class RequestStatus { LOST_CLIENT = 0, SUCCESS, FAILURE }; |
| 22 |
21 BrokerHost(const BrokerPolicy& broker_policy, int ipc_channel); | 23 BrokerHost(const BrokerPolicy& broker_policy, int ipc_channel); |
22 ~BrokerHost(); | 24 ~BrokerHost(); |
23 | 25 |
24 bool HandleRequest() const; | 26 RequestStatus HandleRequest() const; |
25 | 27 |
26 private: | 28 private: |
27 const BrokerPolicy& broker_policy_; | 29 const BrokerPolicy& broker_policy_; |
28 const int ipc_channel_; | 30 const int ipc_channel_; |
29 DISALLOW_COPY_AND_ASSIGN(BrokerHost); | 31 DISALLOW_COPY_AND_ASSIGN(BrokerHost); |
30 }; | 32 }; |
31 | 33 |
32 } // namespace syscall_broker | 34 } // namespace syscall_broker |
33 | 35 |
34 } // namespace sandbox | 36 } // namespace sandbox |
35 | 37 |
36 #endif // SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ | 38 #endif // SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_ |
OLD | NEW |