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

Unified Diff: ipc/ipc_message_utils.cc

Issue 1966983003: Generate param traits size methods for IPC files in content/ (and traits it depends on). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix owners Created 4 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
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ipc/mach_port_mac.h » ('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 6a8be4981530344e3589c2d8b8a06cda7058b83f..18a154fead4015aff472d0fae40a3d2c1dd7fadf 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -635,6 +635,12 @@ void ParamTraits<base::DictionaryValue>::Log(const param_type& p,
}
#if defined(OS_POSIX)
+void ParamTraits<base::FileDescriptor>::GetSize(base::PickleSizer* sizer,
+ const param_type& p) {
+ GetParamSize(sizer, p.fd >= 0);
+ sizer->AddAttachment();
+}
+
void ParamTraits<base::FileDescriptor>::Write(base::Pickle* m,
const param_type& p) {
const bool valid = p.fd >= 0;
@@ -687,6 +693,13 @@ void ParamTraits<base::FileDescriptor>::Log(const param_type& p,
#endif // defined(OS_POSIX)
#if defined(OS_MACOSX) && !defined(OS_IOS)
+void ParamTraits<base::SharedMemoryHandle>::GetSize(base::PickleSizer* sizer,
+ const param_type& p) {
+ GetParamSize(sizer, p.GetMemoryObject());
+ uint32_t dummy = 0;
+ GetParamSize(sizer, dummy);
+}
+
void ParamTraits<base::SharedMemoryHandle>::Write(base::Pickle* m,
const param_type& p) {
MachPortMac mach_port_mac(p.GetMemoryObject());
@@ -726,6 +739,16 @@ void ParamTraits<base::SharedMemoryHandle>::Log(const param_type& p,
}
#elif defined(OS_WIN)
+void ParamTraits<base::SharedMemoryHandle>::GetSize(base::PickleSizer* s,
+ const param_type& p) {
+ GetParamSize(s, p.NeedsBrokering());
+ if (p.NeedsBrokering()) {
+ GetParamSize(s, p.GetHandle());
+ } else {
+ GetParamSize(s, HandleToLong(p.GetHandle()));
+ }
+}
+
void ParamTraits<base::SharedMemoryHandle>::Write(base::Pickle* m,
const param_type& p) {
m->WriteBool(p.NeedsBrokering());
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ipc/mach_port_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698