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