Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / sandbox / linux / syscall_broker / broker_host.h
blob9866507d1c6f4312ff37a25a4b28811eba8975c0
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.
5 #ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_
6 #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_
8 #include "base/macros.h"
9 #include "sandbox/linux/syscall_broker/broker_channel.h"
11 namespace sandbox {
13 namespace syscall_broker {
15 class BrokerPolicy;
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 };
24 BrokerHost(const BrokerPolicy& broker_policy,
25 BrokerChannel::EndPoint ipc_channel);
26 ~BrokerHost();
28 RequestStatus HandleRequest() const;
30 private:
31 const BrokerPolicy& broker_policy_;
32 const BrokerChannel::EndPoint ipc_channel_;
34 DISALLOW_COPY_AND_ASSIGN(BrokerHost);
37 } // namespace syscall_broker
39 } // namespace sandbox
41 #endif // SANDBOX_LINUX_SYSCALL_BROKER_BROKER_HOST_H_