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

Unified Diff: ipc/ipc_message_utils.cc

Issue 2047233002: Support using a Mojo message pipe in a ChannelHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-handle-attachemnt-public-api
Patch Set: comments Created 4 years, 6 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/ipc_channel_handle.h ('k') | ipc/ipc_message_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.cc
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 302778e495eccab005e2ec54e2c5a258b25f1f17..60c12ab60f96f879259612c993acf89d0c749cd0 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -18,6 +18,7 @@
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_attachment.h"
#include "ipc/ipc_message_attachment_set.h"
+#include "ipc/ipc_mojo_param_traits.h"
#if defined(OS_POSIX)
#include "ipc/ipc_platform_file_attachment_posix.h"
@@ -638,7 +639,8 @@ void ParamTraits<base::DictionaryValue>::Log(const param_type& p,
void ParamTraits<base::FileDescriptor>::GetSize(base::PickleSizer* sizer,
const param_type& p) {
GetParamSize(sizer, p.fd >= 0);
- sizer->AddAttachment();
+ if (p.fd >= 0)
+ sizer->AddAttachment();
}
void ParamTraits<base::FileDescriptor>::Write(base::Pickle* m,
@@ -1002,6 +1004,7 @@ void ParamTraits<IPC::ChannelHandle>::GetSize(base::PickleSizer* sizer,
#if defined(OS_POSIX)
GetParamSize(sizer, p.socket);
#endif
+ GetParamSize(sizer, p.mojo_handle);
}
void ParamTraits<IPC::ChannelHandle>::Write(base::Pickle* m,
@@ -1014,6 +1017,7 @@ void ParamTraits<IPC::ChannelHandle>::Write(base::Pickle* m,
#if defined(OS_POSIX)
WriteParam(m, p.socket);
#endif
+ WriteParam(m, p.mojo_handle);
}
bool ParamTraits<IPC::ChannelHandle>::Read(const base::Pickle* m,
@@ -1023,7 +1027,7 @@ bool ParamTraits<IPC::ChannelHandle>::Read(const base::Pickle* m,
#if defined(OS_POSIX)
&& ReadParam(m, iter, &r->socket)
#endif
- ;
+ && ReadParam(m, iter, &r->mojo_handle);
}
void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p,
@@ -1033,6 +1037,8 @@ void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p,
l->append(", ");
ParamTraits<base::FileDescriptor>::Log(p.socket, l);
#endif
+ l->append(", ");
+ LogParam(p.mojo_handle, l);
l->append(")");
}
« no previous file with comments | « ipc/ipc_channel_handle.h ('k') | ipc/ipc_message_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698