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_
9 #include "ipc/ipc_channel.h"
10 #include "ipc/ipc_channel_reader.h"
14 // Similar to the Posix version of ChannelImpl but for Native Client code.
15 // This is somewhat different because NaCl's send/recvmsg is slightly different
16 // and we don't need to worry about complicated set up and READWRITE mode for
18 class Channel::ChannelImpl
: public internal::ChannelReader
{
20 ChannelImpl(const IPC::ChannelHandle
& channel_handle
,
23 virtual ~ChannelImpl();
25 // Channel implementation.
28 bool Send(Message
* message
);
29 int GetClientFileDescriptor() const;
30 int TakeClientFileDescriptor();
31 bool AcceptsConnections() const;
32 bool HasAcceptedConnection() const;
33 bool GetClientEuid(uid_t
* client_euid
) const;
34 void ResetToAcceptingConnectionState();
35 static bool IsNamedServerInitialized(const std::string
& channel_id
);
37 virtual ReadState
ReadData(char* buffer
,
39 int* bytes_read
) OVERRIDE
;
40 virtual bool WillDispatchInputMessage(Message
* msg
) OVERRIDE
;
41 virtual bool DidEmptyInputBuffers() OVERRIDE
;
42 virtual void HandleHelloMessage(const Message
& msg
) OVERRIDE
;
45 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl
);
50 #endif // IPC_IPC_CHANNEL_NACL_H_