blob: 274726393e5b7be88c4a31eec4343d39154fcefd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IPC_IPC_CHANNEL_NACL_H_
#define IPC_IPC_CHANNEL_NACL_H_
#pragma once
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_reader.h"
namespace IPC {
// Similar to the Posix version of ChannelImpl but for Native Client code.
// This is somewhat different because NaCl's send/recvmsg is slightly different
// and we don't need to worry about complicated set up and READWRITE mode for
// sharing handles.
class Channel::ChannelImpl : public internal::ChannelReader {
public:
ChannelImpl(const IPC::ChannelHandle& channel_handle,
Mode mode,
Listener* listener);
virtual ~ChannelImpl();
// Channel implementation.
bool Connect();
void Close();
bool Send(Message* message);
int GetClientFileDescriptor() const;
int TakeClientFileDescriptor();
bool AcceptsConnections() const;
bool HasAcceptedConnection() const;
bool GetClientEuid(uid_t* client_euid) const;
void ResetToAcceptingConnectionState();
static bool IsNamedServerInitialized(const std::string& channel_id);
virtual ReadState ReadData(char* buffer,
int buffer_len,
int* bytes_read) OVERRIDE;
virtual bool WillDispatchInputMessage(Message* msg) OVERRIDE;
virtual bool DidEmptyInputBuffers() OVERRIDE;
virtual void HandleHelloMessage(const Message& msg) OVERRIDE;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl);
};
} // namespace IPC
#endif // IPC_IPC_CHANNEL_NACL_H_
|