From 1c99edc8d48f94702ac085197779ea22b820549b Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Wed, 11 Aug 2010 17:36:32 +0000 Subject: 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 --- .../renderer_host/resource_message_filter_win.cc | 1 + chrome/chrome_common.gypi | 1 + chrome/common/render_messages.cc | 63 +++ chrome/common/render_messages.h | 59 +- chrome/common/render_messages_unittest.cc | 2 + chrome/common/webkit_param_traits.cc | 131 +++++ chrome/common/webkit_param_traits.h | 118 +--- chrome/renderer/render_view.cc | 2 + ipc/ipc_message_impl_macros.h | 602 +++++++++++++++++---- ipc/ipc_message_macros.h | 352 ++++++------ ipc/ipc_message_utils.h | 117 ++-- ipc/ipc_message_utils_impl.h | 13 + ipc/ipc_sync_channel_unittest.cc | 4 + 13 files changed, 945 insertions(+), 520 deletions(-) create mode 100644 chrome/common/webkit_param_traits.cc 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::Write(Message* m, + const param_type& p) { + WriteParam(m, p.id); + WriteParam(m, p.name); + WriteParam(m, p.value); + WriteParam(m, static_cast(p.role)); + WriteParam(m, static_cast(p.state)); + WriteParam(m, p.location); + WriteParam(m, p.attributes); + WriteParam(m, p.children); +} + +bool ParamTraits::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(role); + } else { + p->role = webkit_glue::WebAccessibility::ROLE_NONE; + } + int state = 0; + ret = ret && ReadParam(m, iter, &state); + p->state = static_cast(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::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(p.role), l); + l->append(L", "); + LogParam(static_cast(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 { return true; } static void Log(const param_type& p, std::wstring* l) { - LogParam(p, l); + ParamTraits::Log(static_cast(p), l); } }; template <> struct ParamTraits { 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(p.role)); - WriteParam(m, static_cast(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(role); - } else { - p->role = webkit_glue::WebAccessibility::ROLE_NONE; - } - int state = 0; - ret = ret && ReadParam(m, iter, &state); - p->state = static_cast(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(p.role), l); - l->append(L", "); - LogParam(static_cast(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::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::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::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::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::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::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::Write(Message* m, + const param_type& p) { + WriteParam(m, p.forward); + WriteParam(m, p.matchCase); + WriteParam(m, p.findNext); +} + +bool ParamTraits::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::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::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::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::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 { 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 { 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 { template <> struct ParamTraits { 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 { 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 >( \ 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 >( \ 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 >( \ 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 >( \ 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 >( \ 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 >( \ 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 >( \ 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 >( \ 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 >( \ 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::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( \ + 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 >( \ + 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 >( \ + 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 >( \ + 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, 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 >( \ + 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, \ + Tuple2 >( \ + 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, \ + Tuple3 >( \ + 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, 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, \ + Tuple1 >( \ + 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 >(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, \ + Tuple3 >(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, \ + Tuple1 >(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, \ + Tuple2 >(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 >(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, \ + Tuple1 >(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, \ + Tuple2 >(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( \ + 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 >( \ + 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 >( \ + 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 >(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, 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 >( \ + 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, \ + Tuple2 >( \ + 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, \ + Tuple3 >(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, \ + Tuple4 >( \ + 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, 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, \ + Tuple1 >(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 >(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, \ + Tuple3 >(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, 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, \ + Tuple1 >(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, \ + Tuple2 >(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 >(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, 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, \ + Tuple1 >(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, \ + Tuple2 >(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, \ + Tuple3 >(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, 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, Tuple1 >(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, Tuple2 >( \ + 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, \ + Tuple3 >(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 { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class() \ - : IPC::MessageWithReply( \ - 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 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1) \ - : IPC::MessageWithReply >( \ - 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 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1, type2_out* arg2) \ - : IPC::MessageWithReply >( \ - 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 >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \ - : IPC::MessageWithReply >(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, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1) \ - : IPC::MessageWithReply, Tuple0 >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1), MakeTuple()) {} \ +#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ + class msg_class : \ + public IPC::MessageWithReply, 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 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2) \ - : IPC::MessageWithReply, Tuple1 >( \ - 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, Tuple2 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ - : IPC::MessageWithReply, Tuple2 >( \ - 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 >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4) \ - : IPC::MessageWithReply, \ - Tuple3 >(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, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2) \ - : IPC::MessageWithReply, 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, Tuple1 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3) \ - : IPC::MessageWithReply, Tuple1 >( \ - 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 > { \ 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 >(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 > { \ 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, \ - Tuple3 >(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 > { \ 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, \ - Tuple1 >(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 > { \ 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, \ - Tuple2 >(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 > { \ 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 >(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 > { \ 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, \ - Tuple1 >(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 > { \ 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, \ - Tuple2 >(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 > { \ +#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ + class msg_class : public IPC::MessageWithReply { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1) \ - : IPC::MessageWithReply >( \ - 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 { \ +#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ + class msg_class : public IPC::MessageWithReply > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id) \ - : IPC::MessageWithReply( \ - 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 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \ - : IPC::MessageWithReply >( \ - 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 >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3) \ - : IPC::MessageWithReply >(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, Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1) \ - : IPC::MessageWithReply, 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 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2) \ - : IPC::MessageWithReply, Tuple1 >( \ - 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, Tuple2 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ - : IPC::MessageWithReply, Tuple2 >( \ - 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 >{ \ 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, \ - Tuple3 >(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 >{ \ 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, \ - Tuple4 >(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, Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2) \ - : IPC::MessageWithReply, 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, Tuple1 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3) \ - : IPC::MessageWithReply, Tuple1 >( \ - 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 > { \ 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 >(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 > { \ 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, \ - Tuple3 >(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, 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, 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 > { \ 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, \ - Tuple1 >(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 > { \ 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, \ - Tuple2 >(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 > { \ 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 >(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, \ - 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 > { \ 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, \ - Tuple1 >(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 > { \ 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, \ - Tuple2 >(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 > { \ 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, \ - Tuple3 >(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, \ - 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 > { \ 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, \ - Tuple1 >(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 > { \ 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, \ - Tuple2 >(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 > { \ 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, \ - Tuple3 >(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 +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 +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 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 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(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::ValueTuple p; - void* iter = SyncMessage::GetDataIterator(msg); - if (ReadParam(msg, &iter, &p)) - LogParam(p, l); - } + static bool ReadReplyParam(const Message* msg, + typename TupleTypes::ValueTuple* p) { + void* iter = SyncMessage::GetDataIterator(msg); + return ReadParam(msg, &iter, p); } template 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::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 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 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::MessageWithTuple( // subclass needs to have Log() to call Read(), which instantiates the above // template. +template +MessageWithReply::MessageWithReply( + int32 routing_id, uint32 type, + const RefSendParam& send, + const ReplyParam& reply) + : SyncMessage(routing_id, type, PRIORITY_NORMAL, + new ParamDeserializer(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; -- cgit v1.1