summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 22:35:27 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 22:35:27 +0000
commit73d96dc3c451af3e4347d96471d8bdd02ab02853 (patch)
treef983e222b916a204bb4928e797b1061ee4185321 /ipc/ipc_message.h
parentc3f757f314b7a473e1b76bd2a3401d5599bebd7d (diff)
downloadchromium_src-73d96dc3c451af3e4347d96471d8bdd02ab02853.zip
chromium_src-73d96dc3c451af3e4347d96471d8bdd02ab02853.tar.gz
chromium_src-73d96dc3c451af3e4347d96471d8bdd02ab02853.tar.bz2
Initial implementation of an IPC adapter to expose Chrome IPC to Native Client.
This provides an implementation of sendmsg and recvmsg approxinately to what we think NaCl will expose to Chrome. Since NaCl isn't ready yet in this regard, it's still a bit speculative. And there is no support for sending handles across which will be the tricky part. TEST=included unit test BUG=none Review URL: https://chromiumcodereview.appspot.com/9863005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message.h')
-rw-r--r--ipc/ipc_message.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h
index 2598c8c..2c85e42 100644
--- a/ipc/ipc_message.h
+++ b/ipc/ipc_message.h
@@ -57,6 +57,17 @@ class IPC_EXPORT Message : public Pickle {
PRIORITY_HIGH
};
+ // Bit values used in the flags field.
+ enum {
+ PRIORITY_MASK = 0x0003, // Low 2 bits of store the priority value.
+ SYNC_BIT = 0x0004,
+ REPLY_BIT = 0x0008,
+ REPLY_ERROR_BIT = 0x0010,
+ UNBLOCK_BIT = 0x0020,
+ PUMPING_MSGS_BIT = 0x0040,
+ HAS_SENT_TIME_BIT = 0x0080,
+ };
+
virtual ~Message();
Message();
@@ -78,6 +89,9 @@ class IPC_EXPORT Message : public Pickle {
}
// True if this is a synchronous message.
+ void set_sync() {
+ header()->flags |= SYNC_BIT;
+ }
bool is_sync() const {
return (header()->flags & SYNC_BIT) != 0;
}
@@ -134,6 +148,10 @@ class IPC_EXPORT Message : public Pickle {
header()->routing = new_id;
}
+ uint32 flags() const {
+ return header()->flags;
+ }
+
template<class T, class S>
static bool Dispatch(const Message* msg, T* obj, S* sender,
void (T::*func)()) {
@@ -209,21 +227,6 @@ class IPC_EXPORT Message : public Pickle {
friend class MessageReplyDeserializer;
friend class SyncMessage;
- void set_sync() {
- header()->flags |= SYNC_BIT;
- }
-
- // flags
- enum {
- PRIORITY_MASK = 0x0003,
- SYNC_BIT = 0x0004,
- REPLY_BIT = 0x0008,
- REPLY_ERROR_BIT = 0x0010,
- UNBLOCK_BIT = 0x0020,
- PUMPING_MSGS_BIT= 0x0040,
- HAS_SENT_TIME_BIT = 0x0080,
- };
-
#pragma pack(push, 4)
struct Header : Pickle::Header {
int32 routing; // ID of the view that this message is destined for