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

Unified Diff: mojo/embedder/platform_channel_utils_posix.h

Issue 297803008: Mojo: POSIX: Add a PlatformChannelSendmsgWithHandles(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 7 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
Index: mojo/embedder/platform_channel_utils_posix.h
diff --git a/mojo/embedder/platform_channel_utils_posix.h b/mojo/embedder/platform_channel_utils_posix.h
index 5146ce5df238509db0290223a7b14506053f80ca..6d0ffcd2de595c707a5e7ff243fb2f0611a16241 100644
--- a/mojo/embedder/platform_channel_utils_posix.h
+++ b/mojo/embedder/platform_channel_utils_posix.h
@@ -20,7 +20,7 @@ namespace mojo {
namespace embedder {
// The maximum number of handles that can be sent "at once" using
-// |PlatformChannelSendHandles()|.
+// |PlatformChannelSendmsgWithHandles()|.
// TODO(vtl): This number is taken from ipc/file_descriptor_set_posix.h:
// |FileDescriptorSet::kMaxDescriptorsPerMessage|. Where does it come from?
const size_t kPlatformChannelMaxNumHandles = 7;
@@ -36,6 +36,23 @@ MOJO_SYSTEM_IMPL_EXPORT ssize_t PlatformChannelWritev(PlatformHandle h,
struct iovec* iov,
size_t num_iov);
+// Writes data, and the given set of |PlatformHandle|s (i.e., file descriptors)
+// over the Unix domain socket given by |h| (e.g., created using
+// |PlatformChannelPair()|). All the handles must be valid, and there must be at
+// least one and at most |kPlatformChannelMaxNumHandles| handles. The return
+// value is as for |sendmsg()|, namely -1 on failure and otherwise the number of
+// bytes of data sent on success (note that this may not be all the data
+// specified by |iov|). (The handles are not closed, regardless of success or
+// failure.)
+MOJO_SYSTEM_IMPL_EXPORT ssize_t PlatformChannelSendmsgWithHandles(
+ PlatformHandle h,
+ struct iovec* iov,
+ size_t num_iov,
+ PlatformHandle* platform_handles,
+ size_t num_platform_handles);
+
+// TODO(vtl): Remove this once I've switched things over to
+// |PlatformChannelSendmsgWithHandles()|.
// Sends |PlatformHandle|s (i.e., file descriptors) over the Unix domain socket
// (e.g., created using PlatformChannelPair|). (These will be sent in a single
// message having one null byte of data and one control message header with all
« no previous file with comments | « mojo/embedder/platform_channel_pair_posix_unittest.cc ('k') | mojo/embedder/platform_channel_utils_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698