Move media/audio files into media namespace (relanding)
[chromium-blink-merge.git] / ipc / ipc_channel_nacl.h
blobcffa34a9b6963ededcdf345e5b480bf8e41d7d14
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
3 // found in the LICENSE file.
5 #ifndef IPC_IPC_CHANNEL_NACL_H_
6 #define IPC_IPC_CHANNEL_NACL_H_
7 #pragma once
9 #include "ipc/ipc_channel.h"
11 namespace IPC {
13 // Similar to the Posix version of ChannelImpl but for Native Client code.
14 // This is somewhat different because NaCl's send/recvmsg is slightly different
15 // and we don't need to worry about complicated set up and READWRITE mode for
16 // sharing handles.
17 class Channel::ChannelImpl : public internal::ChannelReader {
18 public:
19 ChannelImpl(const IPC::ChannelHandle& channel_handle,
20 Mode mode,
21 Listener* listener);
22 virtual ~ChannelImpl();
24 // Channel implementation.
25 bool Connect();
26 void Close();
27 bool Send(Message* message);
28 int GetClientFileDescriptor() const;
29 int TakeClientFileDescriptor();
30 bool AcceptsConnections() const;
31 bool HasAcceptedConnection() const;
32 bool GetClientEuid(uid_t* client_euid) const;
33 void ResetToAcceptingConnectionState();
34 static bool IsNamedServerInitialized(const std::string& channel_id);
36 private:
37 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl);
40 } // namespace IPC
42 #endif // IPC_IPC_CHANNEL_NACL_H_