summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_message_utils.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 01:35:30 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 01:35:30 +0000
commitdeb5740cb62d64c2e0b3746956fef66494fe49de (patch)
tree96917acb12243a0a9b3ff59f7e3425755aebe180 /chrome/common/ipc_message_utils.h
parent083b0a6ce42c67ca904b025bef0c72b70e2de7b1 (diff)
downloadchromium_src-deb5740cb62d64c2e0b3746956fef66494fe49de.zip
chromium_src-deb5740cb62d64c2e0b3746956fef66494fe49de.tar.gz
chromium_src-deb5740cb62d64c2e0b3746956fef66494fe49de.tar.bz2
Commit my changes that simplify automation message unpacking.
TBR=amit Review URL: http://codereview.chromium.org/24002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_message_utils.h')
-rw-r--r--chrome/common/ipc_message_utils.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index d76e695..64f5653 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -1123,6 +1123,54 @@ class MessageWithTuple : public Message {
if (Read(msg, &p))
LogParam(p, l);
}
+
+ // Functions used to do manual unpacking. Only used by the automation code,
+ // these should go away once that code uses SyncChannel.
+ template<typename TA, typename TB>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ return true;
+ }
+
+ template<typename TA, typename TB, typename TC>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ *c = params.c;
+ return true;
+ }
+
+ template<typename TA, typename TB, typename TC, typename TD>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ *c = params.c;
+ *d = params.d;
+ return true;
+ }
+
+ template<typename TA, typename TB, typename TC, typename TD, typename TE>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d, TE* e) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ *c = params.c;
+ *d = params.d;
+ *e = params.e;
+ return true;
+ }
};
// This class assumes that its template argument is a RefTuple (a Tuple with