summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-05 19:08:32 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-05 19:08:32 +0000
commit94dc971dc40c6cfea33abd234e744ac314d0bc2a (patch)
tree0f2f3f0b57dfdb01c65afc6833e7ad622eb85697 /ipc
parenta14ea34921d1347ceca1c8ddaa6dc1cf6efb1ddb (diff)
downloadchromium_src-94dc971dc40c6cfea33abd234e744ac314d0bc2a.zip
chromium_src-94dc971dc40c6cfea33abd234e744ac314d0bc2a.tar.gz
chromium_src-94dc971dc40c6cfea33abd234e744ac314d0bc2a.tar.bz2
Move resource related IPCs to their own file in content. I added a IPC_STRUCT_TRAITS_PARENT macro to allow the automatic serializing macros to add a parent struct.
TBR=tsepez Review URL: http://codereview.chromium.org/6628035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_message_macros.h8
-rw-r--r--ipc/ipc_message_null_macros.h2
-rw-r--r--ipc/ipc_message_utils.h1
-rw-r--r--ipc/param_traits_log_macros.h6
-rw-r--r--ipc/param_traits_macros.h1
-rw-r--r--ipc/param_traits_read_macros.h2
-rw-r--r--ipc/param_traits_write_macros.h2
7 files changed, 19 insertions, 3 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index de1132e..b8885dc 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -130,9 +130,11 @@
//
// Externally-defined structs are registered with IPC_STRUCT_TRAITS_BEGIN(),
// IPC_STRUCT_TRAITS_MEMBER(), and IPC_STRUCT_TRAITS_END() macros. These
-// cause registration of the types with message generation only. Note that
-// IPC_STRUCT_TRAITS_MEMBER() is only permitted inside matching calls
-// to IPC_STRUCT_TRAITS_BEGIN() / IPC_STRUCT_TRAITS_END().
+// cause registration of the types with message generation only.
+// There's also IPC_STRUCT_TRAITS_PARENT, which is used to register a parent
+// class (whose own traits are already defined). Note that
+// IPC_STRUCT_TRAITS_MEMBER() and IPC_STRUCT_TRAITS_PARENT are only permitted
+// inside matching calls to IPC_STRUCT_TRAITS_BEGIN() / IPC_STRUCT_TRAITS_END().
//
// Enum types are registered with a single IPC_ENUM_TRAITS() macro. There
// is no need to enumerate each value to the IPC mechanism.
diff --git a/ipc/ipc_message_null_macros.h b/ipc/ipc_message_null_macros.h
index 2c33172..fb57df5 100644
--- a/ipc/ipc_message_null_macros.h
+++ b/ipc/ipc_message_null_macros.h
@@ -11,6 +11,7 @@
#undef IPC_STRUCT_END
#undef IPC_STRUCT_TRAITS_BEGIN
#undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
#undef IPC_STRUCT_TRAITS_END
#undef IPC_ENUM_TRAITS
#undef IPC_MESSAGE_CONTROL0
@@ -91,6 +92,7 @@
#define IPC_STRUCT_END()
#define IPC_STRUCT_TRAITS_BEGIN(struct_name)
#define IPC_STRUCT_TRAITS_MEMBER(name)
+#define IPC_STRUCT_TRAITS_PARENT(type)
#define IPC_STRUCT_TRAITS_END()
#define IPC_ENUM_TRAITS(enum_name)
#define IPC_MESSAGE_CONTROL0(msg_class)
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index f7bf49a..800daaf 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -71,6 +71,7 @@ enum IPCMessageStart {
SafeBrowsingMsgStart,
P2PMsgStart,
SocketStreamMsgStart,
+ ResourceMsgStart,
};
class DictionaryValue;
diff --git a/ipc/param_traits_log_macros.h b/ipc/param_traits_log_macros.h
index 40f8ec4..de2006c 100644
--- a/ipc/param_traits_log_macros.h
+++ b/ipc/param_traits_log_macros.h
@@ -21,6 +21,7 @@
// Set up so next include will generate log methods.
#undef IPC_STRUCT_TRAITS_BEGIN
#undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
#undef IPC_STRUCT_TRAITS_END
#define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
void ParamTraits<struct_name>::Log(const param_type& p, std::string* l) { \
@@ -31,6 +32,11 @@
l->append(", "); \
LogParam(p.name, l); \
needs_comma = true;
+#define IPC_STRUCT_TRAITS_PARENT(type) \
+ if (needs_comma) \
+ l->append(", "); \
+ ParamTraits<type>::Log(p, l); \
+ needs_comma = true;
#define IPC_STRUCT_TRAITS_END() \
l->append(")"); \
}
diff --git a/ipc/param_traits_macros.h b/ipc/param_traits_macros.h
index f22376a5..df57adf 100644
--- a/ipc/param_traits_macros.h
+++ b/ipc/param_traits_macros.h
@@ -20,6 +20,7 @@
}
#define IPC_STRUCT_TRAITS_MEMBER(name)
+#define IPC_STRUCT_TRAITS_PARENT(type)
#define IPC_STRUCT_TRAITS_END()
// Traits generation for enums.
diff --git a/ipc/param_traits_read_macros.h b/ipc/param_traits_read_macros.h
index a4fc2f9..ffcdf8e 100644
--- a/ipc/param_traits_read_macros.h
+++ b/ipc/param_traits_read_macros.h
@@ -19,12 +19,14 @@
// Set up so next include will generate read methods.
#undef IPC_STRUCT_TRAITS_BEGIN
#undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
#undef IPC_STRUCT_TRAITS_END
#define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
bool ParamTraits<struct_name>:: \
Read(const Message* m, void** iter, param_type* p) { \
return
#define IPC_STRUCT_TRAITS_MEMBER(name) ReadParam(m, iter, &p->name) &&
+#define IPC_STRUCT_TRAITS_PARENT(type) ParamTraits<type>::Read(m, iter, p) &&
#define IPC_STRUCT_TRAITS_END() 1; }
#undef IPC_ENUM_TRAITS
diff --git a/ipc/param_traits_write_macros.h b/ipc/param_traits_write_macros.h
index 84e63f7..2ac5249 100644
--- a/ipc/param_traits_write_macros.h
+++ b/ipc/param_traits_write_macros.h
@@ -19,10 +19,12 @@
// Set up so next include will generate write methods.
#undef IPC_STRUCT_TRAITS_BEGIN
#undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
#undef IPC_STRUCT_TRAITS_END
#define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
void ParamTraits<struct_name>::Write(Message* m, const param_type& p) {
#define IPC_STRUCT_TRAITS_MEMBER(name) WriteParam(m, p.name);
+#define IPC_STRUCT_TRAITS_PARENT(type) ParamTraits<type>::Write(m, p);
#define IPC_STRUCT_TRAITS_END() }
#undef IPC_ENUM_TRAITS