broker_channel.h 984 B

123456789101112131415161718192021222324252627282930313233
  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. #ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_CHANNEL_H_
  5. #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_CHANNEL_H_
  6. #include "base/files/scoped_file.h"
  7. #include "sandbox/sandbox_export.h"
  8. namespace sandbox {
  9. namespace syscall_broker {
  10. // A small class to create a pipe-like communication channel. It is based on a
  11. // SOCK_SEQPACKET unix socket, which is connection-based and guaranteed to
  12. // preserve message boundaries.
  13. class SANDBOX_EXPORT BrokerChannel {
  14. public:
  15. typedef base::ScopedFD EndPoint;
  16. BrokerChannel() = delete;
  17. BrokerChannel(const BrokerChannel&) = delete;
  18. BrokerChannel& operator=(const BrokerChannel&) = delete;
  19. static void CreatePair(EndPoint* reader, EndPoint* writer);
  20. };
  21. } // namespace syscall_broker
  22. } // namespace sandbox
  23. #endif // SANDBOX_LINUX_SYSCALL_BROKER_BROKER_CHANNEL_H_