summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 17:36:32 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 17:36:32 +0000
commit1c99edc8d48f94702ac085197779ea22b820549b (patch)
treedbcb2aa6714c5769a5a0c134011e90b104603144
parent4fd3c1a3faa42ee98f95e5f03182a597dea17196 (diff)
downloadchromium_src-1c99edc8d48f94702ac085197779ea22b820549b.zip
chromium_src-1c99edc8d48f94702ac085197779ea22b820549b.tar.gz
chromium_src-1c99edc8d48f94702ac085197779ea22b820549b.tar.bz2
Reapplies r55735, fixing some message code that was checked in that I collided with.
BUG=51411 TEST=none TBR=mpcomplete Review URL: http://codereview.chromium.org/3118009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55749 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/resource_message_filter_win.cc1
-rw-r--r--chrome/chrome_common.gypi1
-rw-r--r--chrome/common/render_messages.cc63
-rw-r--r--chrome/common/render_messages.h59
-rw-r--r--chrome/common/render_messages_unittest.cc2
-rw-r--r--chrome/common/webkit_param_traits.cc131
-rw-r--r--chrome/common/webkit_param_traits.h118
-rw-r--r--chrome/renderer/render_view.cc2
-rw-r--r--ipc/ipc_message_impl_macros.h602
-rw-r--r--ipc/ipc_message_macros.h352
-rw-r--r--ipc/ipc_message_utils.h117
-rw-r--r--ipc/ipc_message_utils_impl.h13
-rw-r--r--ipc/ipc_sync_channel_unittest.cc4
13 files changed, 945 insertions, 520 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter_win.cc b/chrome/browser/renderer_host/resource_message_filter_win.cc
index aa53422..4a8c46e 100644
--- a/chrome/browser/renderer_host/resource_message_filter_win.cc
+++ b/chrome/browser/renderer_host/resource_message_filter_win.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/render_messages.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/win/WebScreenInfoFactory.h"
using WebKit::WebScreenInfo;
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index c60359f..28135c5c3 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -286,6 +286,7 @@
'common/visitedlink_common.h',
'common/web_database_observer_impl.cc',
'common/web_database_observer_impl.h',
+ 'common/webkit_param_traits.cc',
'common/webkit_param_traits.h',
'common/webmessageportchannel_impl.cc',
'common/webmessageportchannel_impl.h',
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index 68aa81d..04a258c 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -5,8 +5,71 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/thumbnail_score.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
+#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcursor.h"
#define MESSAGES_INTERNAL_IMPL_FILE \
"chrome/common/render_messages_internal.h"
#include "ipc/ipc_message_impl_macros.h"
+
+namespace IPC {
+
+void ParamTraits<webkit_glue::WebAccessibility>::Write(Message* m,
+ const param_type& p) {
+ WriteParam(m, p.id);
+ WriteParam(m, p.name);
+ WriteParam(m, p.value);
+ WriteParam(m, static_cast<int>(p.role));
+ WriteParam(m, static_cast<int>(p.state));
+ WriteParam(m, p.location);
+ WriteParam(m, p.attributes);
+ WriteParam(m, p.children);
+}
+
+bool ParamTraits<webkit_glue::WebAccessibility>::Read(
+ const Message* m, void** iter, param_type* p) {
+ bool ret = ReadParam(m, iter, &p->id);
+ ret = ret && ReadParam(m, iter, &p->name);
+ ret = ret && ReadParam(m, iter, &p->value);
+ int role = -1;
+ ret = ret && ReadParam(m, iter, &role);
+ if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
+ role < webkit_glue::WebAccessibility::NUM_ROLES) {
+ p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
+ } else {
+ p->role = webkit_glue::WebAccessibility::ROLE_NONE;
+ }
+ int state = 0;
+ ret = ret && ReadParam(m, iter, &state);
+ p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
+ ret = ret && ReadParam(m, iter, &p->location);
+ ret = ret && ReadParam(m, iter, &p->attributes);
+ ret = ret && ReadParam(m, iter, &p->children);
+ return ret;
+}
+
+void ParamTraits<webkit_glue::WebAccessibility>::Log(const param_type& p,
+ std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.id, l);
+ l->append(L", ");
+ LogParam(p.name, l);
+ l->append(L", ");
+ LogParam(p.value, l);
+ l->append(L", ");
+ LogParam(static_cast<int>(p.role), l);
+ l->append(L", ");
+ LogParam(static_cast<int>(p.state), l);
+ l->append(L", ");
+ LogParam(p.location, l);
+ l->append(L", ");
+ LogParam(p.attributes, l);
+ l->append(L", ");
+ LogParam(p.children, l);
+ l->append(L")");
+}
+
+} // namespace IPC
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index e45d79d..00db777 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -52,7 +52,6 @@
#include "webkit/glue/plugins/webplugin.h"
#include "webkit/glue/plugins/webplugininfo.h"
#include "webkit/glue/resource_loader_bridge.h"
-#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcookie.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webmenuitem.h"
@@ -62,6 +61,10 @@ namespace base {
class Time;
}
+namespace webkit_glue {
+struct WebAccessibility;
+}
+
class SkBitmap;
// Parameters structure for ViewMsg_Navigate, which has too many data
@@ -3315,62 +3318,16 @@ struct ParamTraits<WindowContainerType> {
return true;
}
static void Log(const param_type& p, std::wstring* l) {
- LogParam(p, l);
+ ParamTraits<int>::Log(static_cast<int>(p), l);
}
};
template <>
struct ParamTraits<webkit_glue::WebAccessibility> {
typedef webkit_glue::WebAccessibility param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.id);
- WriteParam(m, p.name);
- WriteParam(m, p.value);
- WriteParam(m, static_cast<int>(p.role));
- WriteParam(m, static_cast<int>(p.state));
- WriteParam(m, p.location);
- WriteParam(m, p.attributes);
- WriteParam(m, p.children);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- bool ret = ReadParam(m, iter, &p->id);
- ret = ret && ReadParam(m, iter, &p->name);
- ret = ret && ReadParam(m, iter, &p->value);
- int role = -1;
- ret = ret && ReadParam(m, iter, &role);
- if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
- role < webkit_glue::WebAccessibility::NUM_ROLES) {
- p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
- } else {
- p->role = webkit_glue::WebAccessibility::ROLE_NONE;
- }
- int state = 0;
- ret = ret && ReadParam(m, iter, &state);
- p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
- ret = ret && ReadParam(m, iter, &p->location);
- ret = ret && ReadParam(m, iter, &p->attributes);
- ret = ret && ReadParam(m, iter, &p->children);
- return ret;
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.id, l);
- l->append(L", ");
- LogParam(p.name, l);
- l->append(L", ");
- LogParam(p.value, l);
- l->append(L", ");
- LogParam(static_cast<int>(p.role), l);
- l->append(L", ");
- LogParam(static_cast<int>(p.state), l);
- l->append(L", ");
- LogParam(p.location, l);
- l->append(L", ");
- LogParam(p.attributes, l);
- l->append(L", ");
- LogParam(p.children, l);
- l->append(L")");
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::wstring* l);
};
// Traits for ViewMsg_DeviceOrientationUpdated_Params
diff --git a/chrome/common/render_messages_unittest.cc b/chrome/common/render_messages_unittest.cc
index ccfc898..4fc0aab 100644
--- a/chrome/common/render_messages_unittest.cc
+++ b/chrome/common/render_messages_unittest.cc
@@ -7,6 +7,8 @@
#include "base/utf_string_conversions.h"
#include "chrome/common/render_messages.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/glue/webaccessibility.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
TEST(RenderMessagesUnittest, WebAccessibility) {
// Test a simple case.
diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc
new file mode 100644
index 0000000..06ee1e2
--- /dev/null
+++ b/chrome/common/webkit_param_traits.cc
@@ -0,0 +1,131 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/webkit_param_traits.h"
+
+#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
+
+namespace IPC {
+
+void ParamTraits<WebKit::WebRect>::Write(Message* m, const param_type& p) {
+ WriteParam(m, p.x);
+ WriteParam(m, p.y);
+ WriteParam(m, p.width);
+ WriteParam(m, p.height);
+ }
+
+bool ParamTraits<WebKit::WebRect>::Read(const Message* m, void** iter,
+ param_type* p) {
+ return
+ ReadParam(m, iter, &p->x) &&
+ ReadParam(m, iter, &p->y) &&
+ ReadParam(m, iter, &p->width) &&
+ ReadParam(m, iter, &p->height);
+}
+
+void ParamTraits<WebKit::WebRect>::Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.x, l);
+ l->append(L", ");
+ LogParam(p.y, l);
+ l->append(L", ");
+ LogParam(p.width, l);
+ l->append(L", ");
+ LogParam(p.height, l);
+ l->append(L")");
+}
+
+void ParamTraits<WebKit::WebScreenInfo>::Write(Message* m, const param_type& p) {
+ WriteParam(m, p.depth);
+ WriteParam(m, p.depthPerComponent);
+ WriteParam(m, p.isMonochrome);
+ WriteParam(m, p.rect);
+ WriteParam(m, p.availableRect);
+}
+
+bool ParamTraits<WebKit::WebScreenInfo>::Read(const Message* m, void** iter,
+ param_type* p) {
+ return
+ ReadParam(m, iter, &p->depth) &&
+ ReadParam(m, iter, &p->depthPerComponent) &&
+ ReadParam(m, iter, &p->isMonochrome) &&
+ ReadParam(m, iter, &p->rect) &&
+ ReadParam(m, iter, &p->availableRect);
+}
+
+void ParamTraits<WebKit::WebScreenInfo>::Log(const param_type& p,
+ std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.depth, l);
+ l->append(L", ");
+ LogParam(p.depthPerComponent, l);
+ l->append(L", ");
+ LogParam(p.isMonochrome, l);
+ l->append(L", ");
+ LogParam(p.rect, l);
+ l->append(L", ");
+ LogParam(p.availableRect, l);
+ l->append(L")");
+}
+
+void ParamTraits<WebKit::WebFindOptions>::Write(Message* m,
+ const param_type& p) {
+ WriteParam(m, p.forward);
+ WriteParam(m, p.matchCase);
+ WriteParam(m, p.findNext);
+}
+
+bool ParamTraits<WebKit::WebFindOptions>::Read(const Message* m, void** iter,
+ param_type* p) {
+ return
+ ReadParam(m, iter, &p->forward) &&
+ ReadParam(m, iter, &p->matchCase) &&
+ ReadParam(m, iter, &p->findNext);
+}
+
+void ParamTraits<WebKit::WebFindOptions>::Log(const param_type& p,
+ std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.forward, l);
+ l->append(L", ");
+ LogParam(p.matchCase, l);
+ l->append(L", ");
+ LogParam(p.findNext, l);
+ l->append(L")");
+}
+
+void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m,
+ const param_type& p) {
+ WriteParam(m, p.startOffset);
+ WriteParam(m, p.endOffset);
+ WriteParam(m, p.color);
+ WriteParam(m, p.thick);
+}
+
+bool ParamTraits<WebKit::WebCompositionUnderline>::Read(
+ const Message* m, void** iter,
+ param_type* p) {
+ return
+ ReadParam(m, iter, &p->startOffset) &&
+ ReadParam(m, iter, &p->endOffset) &&
+ ReadParam(m, iter, &p->color) &&
+ ReadParam(m, iter, &p->thick);
+}
+
+void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p,
+ std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.startOffset, l);
+ l->append(L",");
+ LogParam(p.endOffset, l);
+ l->append(L":");
+ LogParam(p.color, l);
+ l->append(L":");
+ LogParam(p.thick, l);
+ l->append(L")");
+}
+
+} // namespace IPC
diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h
index 748c26b..4b0433a 100644
--- a/chrome/common/webkit_param_traits.h
+++ b/chrome/common/webkit_param_traits.h
@@ -26,80 +26,38 @@
#include "ipc/ipc_message_utils.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h"
#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h"
+namespace WebKit {
+struct WebCompositionUnderline;
+struct WebFindOptions;
+struct WebRect;
+struct WebScreenInfo;
+}
+
namespace IPC {
template <>
struct ParamTraits<WebKit::WebRect> {
typedef WebKit::WebRect param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.x);
- WriteParam(m, p.y);
- WriteParam(m, p.width);
- WriteParam(m, p.height);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->x) &&
- ReadParam(m, iter, &p->y) &&
- ReadParam(m, iter, &p->width) &&
- ReadParam(m, iter, &p->height);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.x, l);
- l->append(L", ");
- LogParam(p.y, l);
- l->append(L", ");
- LogParam(p.width, l);
- l->append(L", ");
- LogParam(p.height, l);
- l->append(L")");
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::wstring* l);
};
template <>
struct ParamTraits<WebKit::WebScreenInfo> {
typedef WebKit::WebScreenInfo param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.depth);
- WriteParam(m, p.depthPerComponent);
- WriteParam(m, p.isMonochrome);
- WriteParam(m, p.rect);
- WriteParam(m, p.availableRect);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->depth) &&
- ReadParam(m, iter, &p->depthPerComponent) &&
- ReadParam(m, iter, &p->isMonochrome) &&
- ReadParam(m, iter, &p->rect) &&
- ReadParam(m, iter, &p->availableRect);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.depth, l);
- l->append(L", ");
- LogParam(p.depthPerComponent, l);
- l->append(L", ");
- LogParam(p.isMonochrome, l);
- l->append(L", ");
- LogParam(p.rect, l);
- l->append(L", ");
- LogParam(p.availableRect, l);
- l->append(L")");
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::wstring* l);
};
template <>
@@ -141,26 +99,9 @@ struct ParamTraits<WebKit::WebPopupType> {
template <>
struct ParamTraits<WebKit::WebFindOptions> {
typedef WebKit::WebFindOptions param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.forward);
- WriteParam(m, p.matchCase);
- WriteParam(m, p.findNext);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->forward) &&
- ReadParam(m, iter, &p->matchCase) &&
- ReadParam(m, iter, &p->findNext);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.forward, l);
- l->append(L", ");
- LogParam(p.matchCase, l);
- l->append(L", ");
- LogParam(p.findNext, l);
- l->append(L")");
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::wstring* l);
};
template <>
@@ -378,30 +319,9 @@ template <>
template <>
struct ParamTraits<WebKit::WebCompositionUnderline> {
typedef WebKit::WebCompositionUnderline param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.startOffset);
- WriteParam(m, p.endOffset);
- WriteParam(m, p.color);
- WriteParam(m, p.thick);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->startOffset) &&
- ReadParam(m, iter, &p->endOffset) &&
- ReadParam(m, iter, &p->color) &&
- ReadParam(m, iter, &p->thick);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.startOffset, l);
- l->append(L",");
- LogParam(p.endOffset, l);
- l->append(L":");
- LogParam(p.color, l);
- l->append(L":");
- LogParam(p.thick, l);
- l->append(L")");
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::wstring* l);
};
template <>
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index fbc73ed..d5b9b71 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -95,6 +95,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDragData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFileChooserParams.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
@@ -144,6 +145,7 @@
#include "webkit/glue/plugins/webplugin_impl.h"
#include "webkit/glue/plugins/webview_plugin.h"
#include "webkit/glue/site_isolation_metrics.h"
+#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webmediaplayer_impl.h"
diff --git a/ipc/ipc_message_impl_macros.h b/ipc/ipc_message_impl_macros.h
index f0adac5..1098357 100644
--- a/ipc/ipc_message_impl_macros.h
+++ b/ipc/ipc_message_impl_macros.h
@@ -7,12 +7,7 @@
// implementations of the constructors and the logging methods. (These only
// have to be generated once). It is meant to be included in a XXX_messages.cc
// file.
-//
-// Unlike ipc_message_macros.h, this file is only included once; it uses one
-// pass. But we *still* can't use normal include guards because we still need
-// to use the MESSAGES_INTERNAL_FILE dispatch system. Because that #define is
-// unset, we use the different name MESSAGES_INTERNAL_IMPL_FILE to tell this
-// file what to do.
+
#ifndef IPC_IPC_MESSAGE_IMPL_MACROS_H_
#define IPC_IPC_MESSAGE_IMPL_MACROS_H_
@@ -97,6 +92,17 @@
#define IPC_BEGIN_MESSAGES(label)
#define IPC_END_MESSAGES(label)
+// Every class must include a destructor and a log method that is keyed to the
+// specific types.
+#define IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
// This derives from IPC::Message and thus doesn't need us to keep the
// implementations in this impl file.
#define IPC_MESSAGE_CONTROL0(msg_class)
@@ -106,26 +112,14 @@
: IPC::MessageWithTuple< Tuple1<type1> >( \
MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \
msg_class::msg_class(const type1& arg1, const type2& arg2) \
: IPC::MessageWithTuple< Tuple2<type1, type2> >( \
MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \
msg_class::msg_class(const type1& arg1, const type2& arg2, \
@@ -133,13 +127,7 @@
: IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \
MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \
msg_class::msg_class(const type1& arg1, const type2& arg2, \
@@ -147,13 +135,7 @@
: IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \
MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \
msg_class::msg_class(const type1& arg1, const type2& arg2, \
@@ -163,13 +145,7 @@
MSG_ROUTING_CONTROL, ID, \
MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
// This derives from IPC::Message and thus doesn't need us to keep the
// implementations in this impl file.
@@ -180,26 +156,14 @@
: IPC::MessageWithTuple< Tuple1<type1> >( \
routing_id, ID, MakeRefTuple(arg1)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \
msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \
: IPC::MessageWithTuple< Tuple2<type1, type2> >( \
routing_id, ID, MakeRefTuple(arg1, arg2)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \
@@ -208,13 +172,7 @@
: IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \
routing_id, ID, MakeRefTuple(arg1, arg2, arg3)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \
msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \
@@ -222,13 +180,7 @@
: IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \
routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \
\
- msg_class::~msg_class() {} \
- \
- void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
- }
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
#define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \
msg_class::msg_class(int32 routing_id, const type1& arg1, \
@@ -237,57 +189,475 @@
: IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \
routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \
\
- msg_class::~msg_class() { } \
+ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+// -----------------------------------------------------------------------------
+
+// Every class must include a destructor and a log method that is keyed to the
+// specific types.
+#define IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) \
+ msg_class::~msg_class() {} \
\
void msg_class::Log(const Message* msg, std::wstring* l) { \
- Param p; \
- if (Read(msg, &p)) \
- IPC::LogParam(p, l); \
+ if (msg->is_sync()) { \
+ SendParam p; \
+ if (ReadSendParam(msg, &p)) \
+ IPC::LogParam(p, l); \
+ \
+ AddOutputParamsToLog(msg, l); \
+ } else { \
+ TupleTypes<ReplyParam>::ValueTuple p; \
+ if (ReadReplyParam(msg, &p)) \
+ IPC::LogParam(p, l); \
+ } \
}
-// TODO(erg): Fill these in as I go along.
-#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class)
-#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out)
-#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in)
-#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out)
-#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in)
-#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out)
-#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out)
-#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out)
-#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class)
-#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out)
-#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in)
-#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out)
-#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out)
-#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in)
-#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out)
-#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in)
-#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out)
-#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in)
-#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out)
-#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out)
-#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in)
-#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out)
-#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out)
-#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \
+ msg_class::msg_class() \
+ : IPC::MessageWithReply<Tuple0, Tuple0 >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeTuple(), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \
+ msg_class::msg_class(type1_out* arg1) \
+ : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeTuple(), MakeRefTuple(*arg1)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \
+ msg_class::msg_class(type1_out* arg1, type2_out* arg2) \
+ : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, \
+ type3_out) \
+ msg_class::msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \
+ : IPC::MessageWithReply<Tuple0, Tuple3<type1_out&, type2_out&, \
+ type3_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \
+ msg_class::msg_class(const type1_in& arg1) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \
+ msg_class::msg_class(const type1_in& arg1, type1_out* arg2) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \
+ msg_class::msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, \
+ Tuple2<type1_out&, type2_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, \
+ type2_out, type3_out) \
+ msg_class::msg_class(const type1_in& arg1, type1_out* arg2, \
+ type2_out* arg3, type3_out* arg4) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ type1_out* arg3) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
+ Tuple1<type1_out&> >( \
+ MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, \
+ type1_out, type2_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ type1_out* arg3, type2_out* arg4) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
+ Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, \
+ type1_out, type2_out, type3_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ type1_out* arg3, type2_out* arg4, type3_out* arg5) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \
+ ID, \
+ MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, \
+ type3_in, type1_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ const type3_in& arg3, type1_out* arg4) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
+ Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, \
+ type3_in, type1_out, type2_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ const type3_in& arg3, type1_out* arg4, type2_out* arg5) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
+ Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, \
+ type3_in, type1_out, type2_out, \
+ type3_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ const type3_in& arg3, type1_out* arg4, \
+ type2_out* arg5, type3_out* arg6) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \
+ ID, \
+ MakeRefTuple(arg1, arg2, arg3), \
+ MakeRefTuple(*arg4, *arg5, *arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type1_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ const type3_in& arg3, const type4_in& arg4, \
+ type1_out* arg6) \
+ : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
+ Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type1_out, \
+ type2_out) \
+ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \
+ const type3_in& arg3, const type4_in& arg4, \
+ type1_out* arg5, type2_out* arg6) \
+ : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, \
+ type4_in>, \
+ Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4), \
+ MakeRefTuple(*arg5, *arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \
+ msg_class::msg_class(int routing_id) \
+ : IPC::MessageWithReply<Tuple0, Tuple0>( \
+ routing_id, ID, \
+ MakeTuple(), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \
+ msg_class::msg_class(int routing_id, type1_out* arg1) \
+ : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \
+ routing_id, ID, \
+ MakeTuple(), MakeRefTuple(*arg1)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \
+ msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \
+ : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \
+ routing_id, ID, \
+ MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, \
+ type3_out) \
+ msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2, \
+ type3_out* arg3) \
+ : IPC::MessageWithReply<Tuple0, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
+ MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \
+ routing_id, ID, \
+ MakeRefTuple(arg1), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ type1_out* arg2) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \
+ routing_id, ID, \
+ MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, \
+ type2_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ type1_out* arg2, type2_out* arg3) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, \
+ Tuple2<type1_out&, type2_out&> >( \
+ routing_id, ID, \
+ MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, \
+ type2_out, type3_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ type1_out* arg2, type2_out* arg3, type3_out* arg4) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, \
+ type2_out, type3_out, type4_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ type1_out* arg2, type2_out* arg3, \
+ type3_out* arg4, type4_out* arg5) \
+ : IPC::MessageWithReply<Tuple1<type1_in>, \
+ Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >( \
+ routing_id, ID, MakeRefTuple(arg1), \
+ MakeRefTuple(*arg2, *arg3, *arg4, *arg5)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \
+ routing_id, ID, MakeRefTuple(arg1, arg2), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, \
+ type1_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, type1_out* arg3) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
+ Tuple1<type1_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, \
+ type1_out, type2_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, type1_out* arg3, \
+ type2_out* arg4) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
+ Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, \
+ type1_out, type2_out, type3_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, type1_out* arg3, \
+ type2_out* arg4, type3_out* arg5) \
+ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, \
+ type3_in) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0>( \
+ routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, \
+ type3_in, type1_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ type1_out* arg4) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
+ Tuple1<type1_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, \
+ type3_in, type1_out, type2_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ type1_out* arg4, type2_out* arg5) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
+ Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, \
+ type3_in, type1_out, type2_out, \
+ type3_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ type1_out* arg4, type2_out* arg5, type3_out* arg6) \
+ : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, \
+ *arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, \
+ type3_in, type4_in) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4) \
+ : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, \
+ type4_in>, Tuple0 >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type1_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, type1_out* arg6) \
+ : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
+ Tuple1<type1_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type1_out, \
+ type2_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, type1_out* arg5, type2_out* arg6) \
+ : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
+ Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+
+#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type1_out, \
+ type2_out, type3_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, type1_out* arg5, \
+ type2_out* arg6, type3_out* arg7) \
+ : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4), \
+ MakeRefTuple(*arg5, *arg6, *arg7)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type5_in) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, const type5_in& arg5) \
+ : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \
+ type4_in, type5_in>, Tuple0 >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeTuple()) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type5_in, type1_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, const type5_in& arg5, \
+ type1_out* arg6) \
+ : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \
+ type4_in, type5_in>, Tuple1<type1_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \
+ MakeRefTuple(*arg6)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type5_in, \
+ type1_out, type2_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, const type4_in& arg5, \
+ type1_out* arg6, type2_out* arg7) \
+ : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \
+ type4_in, type5_in>, Tuple2<type1_out&, type2_out&> >( \
+ routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \
+ MakeRefTuple(*arg6, *arg7)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
+
+#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, \
+ type3_in, type4_in, type5_in, \
+ type1_out, type2_out, type3_out) \
+ msg_class::msg_class(int routing_id, const type1_in& arg1, \
+ const type2_in& arg2, const type3_in& arg3, \
+ const type4_in& arg4, const type4_in& arg5, \
+ type1_out* arg6, type2_out* arg7, \
+ type3_out* arg8) \
+ : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \
+ type4_in, type5_in>, \
+ Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
+ MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \
+ MakeRefTuple(*arg6, *arg7, *arg8)) {} \
+ \
+ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class)
// Trigger the header guard define in ipc_message_macros.h so we don't get
// duplicate including when we include MESSAGES_INTERNAL_FILE again at the end
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index 3152871f..903d566 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -845,23 +845,20 @@ LogFunction g_log_function_mapping[LastMsgIndex];
#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \
class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \
- public: \
- enum { ID = msg_class##__ID }; \
- msg_class() \
- : IPC::MessageWithReply<Tuple0, Tuple0 >( \
- MSG_ROUTING_CONTROL, ID, \
- MakeTuple(), MakeTuple()) {} \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
-#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \
+#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \
class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \
- public: \
- enum { ID = msg_class##__ID }; \
- msg_class(type1_out* arg1) \
- : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \
- MSG_ROUTING_CONTROL, \
- ID, \
- MakeTuple(), MakeRefTuple(*arg1)) {} \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(type1_out* arg1); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \
@@ -869,11 +866,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(type1_out* arg1, type2_out* arg2) \
- : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \
- MSG_ROUTING_CONTROL, \
- ID, \
- MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \
+ msg_class(type1_out* arg1, type2_out* arg2); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \
@@ -882,33 +877,29 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> >{ \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \
- : IPC::MessageWithReply<Tuple0, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \
- ID, \
- MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \
+ msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
-#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \
- class msg_class : \
- public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \
- public: \
- enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1) \
- : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \
- MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1), MakeTuple()) {} \
+#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \
+ class msg_class : \
+ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(const type1_in& arg1); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
-#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \
- class msg_class : \
+#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \
+ class msg_class : \
public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \
- public: \
- enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, type1_out* arg2) \
- : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \
- MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(const type1_in& arg1, type1_out* arg2); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \
@@ -916,10 +907,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \
- : IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> >( \
- MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \
+ msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \
@@ -928,33 +918,29 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> >{ \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4) \
- : IPC::MessageWithReply<Tuple1<type1_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \
- ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \
+ msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
-#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \
- class msg_class : \
+#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \
+ class msg_class : \
public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \
- public: \
- enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \
- MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2), MakeTuple()) {} \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(const type1_in& arg1, const type2_in& arg2); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \
- class msg_class : \
+ class msg_class : \
public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \
- public: \
- enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> >( \
- MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \
@@ -963,10 +949,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
- Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \
@@ -975,11 +960,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \
- ID, \
- MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \
@@ -988,10 +971,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
- Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \
@@ -1000,10 +982,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
- Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \
@@ -1012,11 +993,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \
- ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, *arg6)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \
@@ -1025,10 +1004,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6) \
- : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
- Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \
@@ -1037,30 +1015,27 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6) \
- : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
- Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \
+ msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
-#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \
- class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \
+#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \
+ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, type1_out* arg1) \
- : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \
- routing_id, ID, \
- MakeTuple(), MakeRefTuple(*arg1)) {} \
+ msg_class(int routing_id); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
-#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \
- class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \
+#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \
+ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id) \
- : IPC::MessageWithReply<Tuple0, Tuple0 >( \
- routing_id, ID, \
- MakeTuple(), MakeTuple()) {} \
+ msg_class(int routing_id, type1_out* arg1); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \
@@ -1068,10 +1043,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \
- : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \
- routing_id, ID, \
- MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \
+ msg_class(int routing_id, type1_out* arg1, type2_out* arg2); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) \
@@ -1080,10 +1054,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> >{ \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3) \
- : IPC::MessageWithReply<Tuple0, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
- MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \
+ msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \
@@ -1091,10 +1064,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1) \
- : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \
- routing_id, ID, \
- MakeRefTuple(arg1), MakeTuple()) {} \
+ msg_class(int routing_id, const type1_in& arg1); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \
@@ -1102,10 +1074,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, type1_out* arg2) \
- : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \
- routing_id, ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \
+ msg_class(int routing_id, const type1_in& arg1, type1_out* arg2); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) \
@@ -1113,10 +1084,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3) \
- : IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> >( \
- routing_id, ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \
+ msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \
@@ -1125,10 +1095,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> >{ \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4) \
- : IPC::MessageWithReply<Tuple1<type1_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \
+ msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \
@@ -1137,10 +1106,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5) \
- : IPC::MessageWithReply<Tuple1<type1_in>, \
- Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >(routing_id, ID, \
- MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4, *arg5)) {} \
+ msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \
@@ -1148,10 +1116,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \
- routing_id, ID, \
- MakeRefTuple(arg1, arg2), MakeTuple()) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) \
@@ -1159,10 +1126,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> >( \
- routing_id, ID, \
- MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \
@@ -1171,10 +1137,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
- Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \
@@ -1183,10 +1148,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5) \
- : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) \
@@ -1194,11 +1158,10 @@ LogFunction g_log_function_mapping[LastMsgIndex];
public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0 > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0>( \
- routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeTuple()) {} \
- };
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
+ };
#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \
class msg_class : \
@@ -1206,10 +1169,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
- Tuple1<type1_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \
@@ -1218,10 +1180,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
- Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \
@@ -1230,10 +1191,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6) \
- : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, *arg6)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \
@@ -1242,10 +1202,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple0 > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4) \
- : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
- Tuple0 >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4), MakeTuple()) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \
@@ -1254,10 +1213,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6) \
- : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
- Tuple1<type1_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \
@@ -1266,10 +1224,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6) \
- : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
- Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \
@@ -1278,10 +1235,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7) \
- : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6, *arg7)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \
@@ -1290,10 +1246,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple0 > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5) \
- : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \
- Tuple0 >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeTuple()) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \
@@ -1302,10 +1257,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple1<type1_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6) \
- : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \
- Tuple1<type1_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeRefTuple(*arg6)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \
@@ -1314,10 +1268,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple2<type1_out&, type2_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7) \
- : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \
- Tuple2<type1_out&, type2_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeRefTuple(*arg6, *arg7)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \
@@ -1326,10 +1279,9 @@ LogFunction g_log_function_mapping[LastMsgIndex];
Tuple3<type1_out&, type2_out&, type3_out&> > { \
public: \
enum { ID = msg_class##__ID }; \
- msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8) \
- : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \
- Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \
- MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeRefTuple(*arg6, *arg7, *arg8)) {} \
+ msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8); \
+ ~msg_class(); \
+ static void Log(const Message* msg, std::wstring* l); \
};
#endif // #if defined()
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index cdad102..4882688 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -1164,8 +1164,54 @@ class MessageWithTuple : public Message {
}
};
+// defined in ipc_logging.cc
+void GenerateLogData(const std::string& channel, const Message& message,
+ LogData* data);
+
+
+#if defined(IPC_MESSAGE_LOG_ENABLED)
+inline void AddOutputParamsToLog(const Message* msg, std::wstring* l) {
+ const std::wstring& output_params = msg->output_params();
+ if (!l->empty() && !output_params.empty())
+ l->append(L", ");
+
+ l->append(output_params);
+}
+
+template <class ReplyParamType>
+inline void LogReplyParamsToMessage(const ReplyParamType& reply_params,
+ const Message* msg) {
+ if (msg->received_time() != 0) {
+ std::wstring output_params;
+ LogParam(reply_params, &output_params);
+ msg->set_output_params(output_params);
+ }
+}
+
+inline void ConnectMessageAndReply(const Message* msg, Message* reply) {
+ if (msg->sent_time()) {
+ // Don't log the sync message after dispatch, as we don't have the
+ // output parameters at that point. Instead, save its data and log it
+ // with the outgoing reply message when it's sent.
+ LogData* data = new LogData;
+ GenerateLogData("", *msg, data);
+ msg->set_dont_log();
+ reply->set_sync_log_data(data);
+ }
+}
+#else
+inline void AddOutputParamsToLog(const Message* msg, std::wstring* l) {}
+
+template <class ReplyParamType>
+inline void LogReplyParamsToMessage(const ReplyParamType& reply_params,
+ const Message* msg) {}
+
+inline void ConnectMessageAndReply(const Message* msg, Message* reply) {}
+#endif
+
// This class assumes that its template argument is a RefTuple (a Tuple with
-// reference elements).
+// reference elements). This would go into ipc_message_utils_impl.h, but it is
+// also used by chrome_frame.
template <class RefTuple>
class ParamDeserializer : public MessageReplyDeserializer {
public:
@@ -1178,10 +1224,6 @@ class ParamDeserializer : public MessageReplyDeserializer {
RefTuple out_;
};
-// defined in ipc_logging.cc
-void GenerateLogData(const std::string& channel, const Message& message,
- LogData* data);
-
// Used for synchronous messages.
template <class SendParamType, class ReplyParamType>
class MessageWithReply : public SyncMessage {
@@ -1191,54 +1233,33 @@ class MessageWithReply : public SyncMessage {
typedef ReplyParamType ReplyParam;
MessageWithReply(int32 routing_id, uint32 type,
- const RefSendParam& send, const ReplyParam& reply)
- : SyncMessage(routing_id, type, PRIORITY_NORMAL,
- new ParamDeserializer<ReplyParam>(reply)) {
- WriteParam(this, send);
- }
-
- static void Log(const Message* msg, std::wstring* l) {
- if (msg->is_sync()) {
- SendParam p;
- void* iter = SyncMessage::GetDataIterator(msg);
- if (ReadParam(msg, &iter, &p))
- LogParam(p, l);
+ const RefSendParam& send, const ReplyParam& reply);
-#if defined(IPC_MESSAGE_LOG_ENABLED)
- const std::wstring& output_params = msg->output_params();
- if (!l->empty() && !output_params.empty())
- l->append(L", ");
+ // TODO(erg): Migrate these ReadSendParam/ReadReplyParam() methods to
+ // ipc_message_utils_impl.h once I figure out how to get the linkage correct
+ // in the release builds.
+ static bool ReadSendParam(const Message* msg, SendParam* p) {
+ void* iter = SyncMessage::GetDataIterator(msg);
+ return ReadParam(msg, &iter, p);
+ }
- l->append(output_params);
-#endif
- } else {
- // This is an outgoing reply. Now that we have the output parameters, we
- // can finally log the message.
- typename TupleTypes<ReplyParam>::ValueTuple p;
- void* iter = SyncMessage::GetDataIterator(msg);
- if (ReadParam(msg, &iter, &p))
- LogParam(p, l);
- }
+ static bool ReadReplyParam(const Message* msg,
+ typename TupleTypes<ReplyParam>::ValueTuple* p) {
+ void* iter = SyncMessage::GetDataIterator(msg);
+ return ReadParam(msg, &iter, p);
}
template<class T, class Method>
static bool Dispatch(const Message* msg, T* obj, Method func) {
SendParam send_params;
- void* iter = GetDataIterator(msg);
Message* reply = GenerateReply(msg);
bool error;
- if (ReadParam(msg, &iter, &send_params)) {
+ if (ReadSendParam(msg, &send_params)) {
typename TupleTypes<ReplyParam>::ValueTuple reply_params;
DispatchToMethod(obj, func, send_params, &reply_params);
WriteParam(reply, reply_params);
error = false;
-#ifdef IPC_MESSAGE_LOG_ENABLED
- if (msg->received_time() != 0) {
- std::wstring output_params;
- LogParam(reply_params, &output_params);
- msg->set_output_params(output_params);
- }
-#endif
+ LogReplyParamsToMessage(reply_params, msg);
} else {
NOTREACHED() << "Error deserializing message " << msg->type();
reply->set_reply_error();
@@ -1252,23 +1273,11 @@ class MessageWithReply : public SyncMessage {
template<class T, class Method>
static bool DispatchDelayReply(const Message* msg, T* obj, Method func) {
SendParam send_params;
- void* iter = GetDataIterator(msg);
Message* reply = GenerateReply(msg);
bool error;
- if (ReadParam(msg, &iter, &send_params)) {
+ if (ReadSendParam(msg, &send_params)) {
Tuple1<Message&> t = MakeRefTuple(*reply);
-
-#ifdef IPC_MESSAGE_LOG_ENABLED
- if (msg->sent_time()) {
- // Don't log the sync message after dispatch, as we don't have the
- // output parameters at that point. Instead, save its data and log it
- // with the outgoing reply message when it's sent.
- LogData* data = new LogData;
- GenerateLogData("", *msg, data);
- msg->set_dont_log();
- reply->set_sync_log_data(data);
- }
-#endif
+ ConnectMessageAndReply(msg, reply);
DispatchToMethod(obj, func, send_params, &t);
error = false;
} else {
diff --git a/ipc/ipc_message_utils_impl.h b/ipc/ipc_message_utils_impl.h
index ba11990..53c7986 100644
--- a/ipc/ipc_message_utils_impl.h
+++ b/ipc/ipc_message_utils_impl.h
@@ -25,6 +25,19 @@ MessageWithTuple<ParamType>::MessageWithTuple(
// subclass needs to have Log() to call Read(), which instantiates the above
// template.
+template <class SendParamType, class ReplyParamType>
+MessageWithReply<SendParamType, ReplyParamType>::MessageWithReply(
+ int32 routing_id, uint32 type,
+ const RefSendParam& send,
+ const ReplyParam& reply)
+ : SyncMessage(routing_id, type, PRIORITY_NORMAL,
+ new ParamDeserializer<ReplyParam>(reply)) {
+ WriteParam(this, send);
+}
+
+// TODO(erg): Migrate ReadSendParam()/ReadReplyParam() here when we can force
+// the visibility/linkage.
+
} // namespace IPC
#endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_
diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc
index 87e9773..a3b757a 100644
--- a/ipc/ipc_sync_channel_unittest.cc
+++ b/ipc/ipc_sync_channel_unittest.cc
@@ -26,6 +26,10 @@
#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h"
#include "ipc/ipc_message_macros.h"
+// Definition of IPC Messages used for this test.
+#define MESSAGES_INTERNAL_IMPL_FILE "ipc/ipc_sync_message_unittest.h"
+#include "ipc/ipc_message_impl_macros.h"
+
using namespace IPC;
using base::WaitableEvent;