Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: ipc/ipc_channel.h

Issue 25325002: workaround for mac kernel bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor bugfix Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/file_descriptor_set_posix.cc ('k') | ipc/ipc_channel_nacl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel.h
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index f65a62b9cc9ee4fda212d66b513f76c60737ba9c..7e09a806f7a17bc111cce025081c253e7f37ebb3 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -75,15 +75,22 @@ class IPC_EXPORT Channel : public Sender {
#endif
};
- // The Hello message is internal to the Channel class. It is sent
- // by the peer when the channel is connected. The message contains
- // just the process id (pid). The message has a special routing_id
- // (MSG_ROUTING_NONE) and type (HELLO_MESSAGE_TYPE).
+ // Messages internal to the IPC implementation are defined here.
+ // Uses Maximum value of message type (uint16), to avoid conflicting
+ // with normal message types, which are enumeration constants starting from 0.
enum {
- HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16),
- // to avoid conflicting with normal
- // message types, which are enumeration
- // constants starting from 0.
+ // The Hello message is sent by the peer when the channel is connected.
+ // The message contains just the process id (pid).
+ // The message has a special routing_id (MSG_ROUTING_NONE)
+ // and type (HELLO_MESSAGE_TYPE).
+ HELLO_MESSAGE_TYPE = kuint16max,
+ // The CLOSE_FD_MESSAGE_TYPE is used in the IPC class to
+ // work around a bug in sendmsg() on Mac. When an FD is sent
+ // over the socket, a CLOSE_FD_MESSAGE is sent with hops = 2.
+ // The client will return the message with hops = 1, *after* it
+ // has received the message that contains the FD. When we
+ // receive it again on the sender side, we close the FD.
+ CLOSE_FD_MESSAGE_TYPE = HELLO_MESSAGE_TYPE - 1
};
// The maximum message size in bytes. Attempting to receive a message of this
« no previous file with comments | « ipc/file_descriptor_set_posix.cc ('k') | ipc/ipc_channel_nacl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698