summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_nacl.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 19:57:22 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 19:57:22 +0000
commit456b0eae088adc8f03ebcae2025a2af1cdc7a9e9 (patch)
treeb81eb9371d0213e61cf8d9e5dd2a0e06273991a8 /ipc/ipc_channel_nacl.h
parent590e2e2ed0c97ab2e0860c49b0c51c3bfe5fc450 (diff)
downloadchromium_src-456b0eae088adc8f03ebcae2025a2af1cdc7a9e9.zip
chromium_src-456b0eae088adc8f03ebcae2025a2af1cdc7a9e9.tar.gz
chromium_src-456b0eae088adc8f03ebcae2025a2af1cdc7a9e9.tar.bz2
Add a stub version of IPC::Channel for Native Client code.
This isn't used yet, but will be necessary to get us linking when the build system is in better shape. Once that works we can start implementing this for real. Review URL: https://chromiumcodereview.appspot.com/9876003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_nacl.h')
-rw-r--r--ipc/ipc_channel_nacl.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/ipc/ipc_channel_nacl.h b/ipc/ipc_channel_nacl.h
new file mode 100644
index 0000000..cffa34a
--- /dev/null
+++ b/ipc/ipc_channel_nacl.h
@@ -0,0 +1,42 @@
+// 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"
+
+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);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl);
+};
+
+} // namespace IPC
+
+#endif // IPC_IPC_CHANNEL_NACL_H_