diff options
56 files changed, 2890 insertions, 1556 deletions
diff --git a/base/tuple.h b/base/tuple.h index bcd2ad4..b67d924 100644 --- a/base/tuple.h +++ b/base/tuple.h @@ -52,6 +52,9 @@ struct TupleTraits<P&> { typedef P& ParamType; }; +template <class P> +struct TupleTypes { }; + // Tuple ----------------------------------------------------------------------- // // This set of classes is useful for bundling 0 or more heterogeneous data types @@ -76,9 +79,6 @@ template <class A> struct Tuple1 { public: typedef A TypeA; - typedef Tuple1<typename TupleTraits<A>::ValueType> ValueTuple; - typedef Tuple1<typename TupleTraits<A>::RefType> RefTuple; - typedef Tuple1<typename TupleTraits<A>::ParamType> ParamTuple; Tuple1() {} explicit Tuple1(typename TupleTraits<A>::ParamType a) : a(a) {} @@ -91,12 +91,6 @@ struct Tuple2 { public: typedef A TypeA; typedef B TypeB; - typedef Tuple2<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType> ValueTuple; - typedef Tuple2<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType> RefTuple; - typedef Tuple2<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType> ParamTuple; Tuple2() {} Tuple2(typename TupleTraits<A>::ParamType a, @@ -114,15 +108,6 @@ struct Tuple3 { typedef A TypeA; typedef B TypeB; typedef C TypeC; - typedef Tuple3<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType, - typename TupleTraits<C>::ValueType> ValueTuple; - typedef Tuple3<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType, - typename TupleTraits<C>::RefType> RefTuple; - typedef Tuple3<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType, - typename TupleTraits<C>::ParamType> ParamTuple; Tuple3() {} Tuple3(typename TupleTraits<A>::ParamType a, @@ -143,18 +128,6 @@ struct Tuple4 { typedef B TypeB; typedef C TypeC; typedef D TypeD; - typedef Tuple4<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType, - typename TupleTraits<C>::ValueType, - typename TupleTraits<D>::ValueType> ValueTuple; - typedef Tuple4<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType, - typename TupleTraits<C>::RefType, - typename TupleTraits<D>::RefType> RefTuple; - typedef Tuple4<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType, - typename TupleTraits<C>::ParamType, - typename TupleTraits<D>::ParamType> ParamTuple; Tuple4() {} Tuple4(typename TupleTraits<A>::ParamType a, @@ -178,21 +151,6 @@ struct Tuple5 { typedef C TypeC; typedef D TypeD; typedef E TypeE; - typedef Tuple5<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType, - typename TupleTraits<C>::ValueType, - typename TupleTraits<D>::ValueType, - typename TupleTraits<E>::ValueType> ValueTuple; - typedef Tuple5<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType, - typename TupleTraits<C>::RefType, - typename TupleTraits<D>::RefType, - typename TupleTraits<E>::RefType> RefTuple; - typedef Tuple5<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType, - typename TupleTraits<C>::ParamType, - typename TupleTraits<D>::ParamType, - typename TupleTraits<E>::ParamType> ParamTuple; Tuple5() {} Tuple5(typename TupleTraits<A>::ParamType a, @@ -219,24 +177,6 @@ struct Tuple6 { typedef D TypeD; typedef E TypeE; typedef F TypeF; - typedef Tuple6<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType, - typename TupleTraits<C>::ValueType, - typename TupleTraits<D>::ValueType, - typename TupleTraits<E>::ValueType, - typename TupleTraits<F>::ValueType> ValueTuple; - typedef Tuple6<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType, - typename TupleTraits<C>::RefType, - typename TupleTraits<D>::RefType, - typename TupleTraits<E>::RefType, - typename TupleTraits<F>::RefType> RefTuple; - typedef Tuple6<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType, - typename TupleTraits<C>::ParamType, - typename TupleTraits<D>::ParamType, - typename TupleTraits<E>::ParamType, - typename TupleTraits<F>::ParamType> ParamTuple; Tuple6() {} Tuple6(typename TupleTraits<A>::ParamType a, @@ -266,27 +206,6 @@ struct Tuple7 { typedef E TypeE; typedef F TypeF; typedef G TypeG; - typedef Tuple7<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType, - typename TupleTraits<C>::ValueType, - typename TupleTraits<D>::ValueType, - typename TupleTraits<E>::ValueType, - typename TupleTraits<F>::ValueType, - typename TupleTraits<G>::ValueType> ValueTuple; - typedef Tuple7<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType, - typename TupleTraits<C>::RefType, - typename TupleTraits<D>::RefType, - typename TupleTraits<E>::RefType, - typename TupleTraits<F>::RefType, - typename TupleTraits<G>::RefType> RefTuple; - typedef Tuple7<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType, - typename TupleTraits<C>::ParamType, - typename TupleTraits<D>::ParamType, - typename TupleTraits<E>::ParamType, - typename TupleTraits<F>::ParamType, - typename TupleTraits<G>::ParamType> ParamTuple; Tuple7() {} Tuple7(typename TupleTraits<A>::ParamType a, @@ -320,30 +239,6 @@ struct Tuple8 { typedef F TypeF; typedef G TypeG; typedef H TypeH; - typedef Tuple8<typename TupleTraits<A>::ValueType, - typename TupleTraits<B>::ValueType, - typename TupleTraits<C>::ValueType, - typename TupleTraits<D>::ValueType, - typename TupleTraits<E>::ValueType, - typename TupleTraits<F>::ValueType, - typename TupleTraits<G>::ValueType, - typename TupleTraits<H>::ValueType> ValueTuple; - typedef Tuple8<typename TupleTraits<A>::RefType, - typename TupleTraits<B>::RefType, - typename TupleTraits<C>::RefType, - typename TupleTraits<D>::RefType, - typename TupleTraits<E>::RefType, - typename TupleTraits<F>::RefType, - typename TupleTraits<G>::RefType, - typename TupleTraits<H>::RefType> RefTuple; - typedef Tuple8<typename TupleTraits<A>::ParamType, - typename TupleTraits<B>::ParamType, - typename TupleTraits<C>::ParamType, - typename TupleTraits<D>::ParamType, - typename TupleTraits<E>::ParamType, - typename TupleTraits<F>::ParamType, - typename TupleTraits<G>::ParamType, - typename TupleTraits<H>::ParamType> ParamTuple; Tuple8() {} Tuple8(typename TupleTraits<A>::ParamType a, @@ -367,6 +262,159 @@ struct Tuple8 { H h; }; +// Tuple types ---------------------------------------------------------------- +// +// Allows for selection of ValueTuple/RefTuple/ParamTuple without needing the +// definitions of class types the tuple takes as parameters. + +template <> +struct TupleTypes< Tuple0 > { + typedef Tuple0 ValueTuple; + typedef Tuple0 RefTuple; + typedef Tuple0 ParamTuple; +}; + +template <class A> +struct TupleTypes< Tuple1<A> > { + typedef Tuple1<typename TupleTraits<A>::ValueType> ValueTuple; + typedef Tuple1<typename TupleTraits<A>::RefType> RefTuple; + typedef Tuple1<typename TupleTraits<A>::ParamType> ParamTuple; +}; + +template <class A, class B> +struct TupleTypes< Tuple2<A, B> > { + typedef Tuple2<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType> ValueTuple; +typedef Tuple2<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType> RefTuple; + typedef Tuple2<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType> ParamTuple; +}; + +template <class A, class B, class C> +struct TupleTypes< Tuple3<A, B, C> > { + typedef Tuple3<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType, + typename TupleTraits<C>::ValueType> ValueTuple; +typedef Tuple3<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType, + typename TupleTraits<C>::RefType> RefTuple; + typedef Tuple3<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType> ParamTuple; +}; + +template <class A, class B, class C, class D> +struct TupleTypes< Tuple4<A, B, C, D> > { + typedef Tuple4<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType, + typename TupleTraits<C>::ValueType, + typename TupleTraits<D>::ValueType> ValueTuple; +typedef Tuple4<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType, + typename TupleTraits<C>::RefType, + typename TupleTraits<D>::RefType> RefTuple; + typedef Tuple4<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType> ParamTuple; +}; + +template <class A, class B, class C, class D, class E> +struct TupleTypes< Tuple5<A, B, C, D, E> > { + typedef Tuple5<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType, + typename TupleTraits<C>::ValueType, + typename TupleTraits<D>::ValueType, + typename TupleTraits<E>::ValueType> ValueTuple; +typedef Tuple5<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType, + typename TupleTraits<C>::RefType, + typename TupleTraits<D>::RefType, + typename TupleTraits<E>::RefType> RefTuple; + typedef Tuple5<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType> ParamTuple; +}; + +template <class A, class B, class C, class D, class E, class F> +struct TupleTypes< Tuple6<A, B, C, D, E, F> > { + typedef Tuple6<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType, + typename TupleTraits<C>::ValueType, + typename TupleTraits<D>::ValueType, + typename TupleTraits<E>::ValueType, + typename TupleTraits<F>::ValueType> ValueTuple; +typedef Tuple6<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType, + typename TupleTraits<C>::RefType, + typename TupleTraits<D>::RefType, + typename TupleTraits<E>::RefType, + typename TupleTraits<F>::RefType> RefTuple; + typedef Tuple6<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType, + typename TupleTraits<F>::ParamType> ParamTuple; +}; + +template <class A, class B, class C, class D, class E, class F, class G> +struct TupleTypes< Tuple7<A, B, C, D, E, F, G> > { + typedef Tuple7<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType, + typename TupleTraits<C>::ValueType, + typename TupleTraits<D>::ValueType, + typename TupleTraits<E>::ValueType, + typename TupleTraits<F>::ValueType, + typename TupleTraits<G>::ValueType> ValueTuple; +typedef Tuple7<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType, + typename TupleTraits<C>::RefType, + typename TupleTraits<D>::RefType, + typename TupleTraits<E>::RefType, + typename TupleTraits<F>::RefType, + typename TupleTraits<G>::RefType> RefTuple; + typedef Tuple7<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType, + typename TupleTraits<F>::ParamType, + typename TupleTraits<G>::ParamType> ParamTuple; +}; + +template <class A, class B, class C, class D, class E, class F, class G, + class H> +struct TupleTypes< Tuple8<A, B, C, D, E, F, G, H> > { + typedef Tuple8<typename TupleTraits<A>::ValueType, + typename TupleTraits<B>::ValueType, + typename TupleTraits<C>::ValueType, + typename TupleTraits<D>::ValueType, + typename TupleTraits<E>::ValueType, + typename TupleTraits<F>::ValueType, + typename TupleTraits<G>::ValueType, + typename TupleTraits<H>::ValueType> ValueTuple; +typedef Tuple8<typename TupleTraits<A>::RefType, + typename TupleTraits<B>::RefType, + typename TupleTraits<C>::RefType, + typename TupleTraits<D>::RefType, + typename TupleTraits<E>::RefType, + typename TupleTraits<F>::RefType, + typename TupleTraits<G>::RefType, + typename TupleTraits<H>::RefType> RefTuple; + typedef Tuple8<typename TupleTraits<A>::ParamType, + typename TupleTraits<B>::ParamType, + typename TupleTraits<C>::ParamType, + typename TupleTraits<D>::ParamType, + typename TupleTraits<E>::ParamType, + typename TupleTraits<F>::ParamType, + typename TupleTraits<G>::ParamType, + typename TupleTraits<H>::ParamType> ParamTuple; +}; + // Tuple creators ------------------------------------------------------------- // // Helper functions for constructing tuples while inferring the template diff --git a/chrome/browser/extensions/extension_messages_unittest.cc b/chrome/browser/extensions/extension_messages_unittest.cc index b90e92f..3b3c273 100644 --- a/chrome/browser/extensions/extension_messages_unittest.cc +++ b/chrome/browser/extensions/extension_messages_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/values.h" #include "chrome/browser/extensions/extension_message_service.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/extensions/event_bindings.h" diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index c20940f4..859811e 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -16,11 +16,16 @@ #include "ipc/ipc_switches.h" #include "testing/multiprocess_func_list.h" -// Definition of IPC Messages used for this test. +// Declaration of IPC Messages used for this test. #define MESSAGES_INTERNAL_FILE \ "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" #include "ipc/ipc_message_macros.h" +// Definition of IPC Messages used for this test. +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" + namespace { // Name of IPC Channel to use for Server<-> Child Communications. diff --git a/chrome/browser/importer/importer_messages.cc b/chrome/browser/importer/importer_messages.cc new file mode 100644 index 0000000..d20452a --- /dev/null +++ b/chrome/browser/importer/importer_messages.cc @@ -0,0 +1,11 @@ +// 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/browser/importer/importer_messages.h" + +#include "base/values.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/browser/importer/importer_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index a9af09a..e2a7fba 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -18,6 +18,7 @@ #include "app/app_switches.h" #include "base/command_line.h" #include "base/field_trial.h" +#include "base/histogram.h" #include "base/logging.h" #include "base/stl_util-inl.h" #include "base/string_util.h" diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index b5bb1cb..51a0e29 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -44,6 +44,8 @@ #include "net/base/net_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" +#include "webkit/glue/context_menu.h" +#include "webkit/glue/dom_operations.h" #include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" #include "webkit/glue/password_form_dom_manager.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 93b57e2..2d2eee0 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -22,6 +22,7 @@ #include "app/x11_util.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/histogram.h" #include "base/message_loop.h" #include "base/string_number_conversions.h" #include "base/task.h" diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index 1a489de..70e75d4 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -85,8 +85,10 @@ #include "net/http/http_transaction_factory.h" #include "net/url_request/url_request_context.h" #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" +#include "webkit/glue/context_menu.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin.h" +#include "webkit/glue/webcookie.h" #include "webkit/glue/webkit_glue.h" using net::CookieStore; 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/browser/renderer_host/sync_resource_handler.cc b/chrome/browser/renderer_host/sync_resource_handler.cc index 7e88754..86bc899 100644 --- a/chrome/browser/renderer_host/sync_resource_handler.cc +++ b/chrome/browser/renderer_host/sync_resource_handler.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/renderer_host/sync_resource_handler.h" + #include "base/logging.h" #include "chrome/common/render_messages.h" #include "net/base/io_buffer.h" diff --git a/chrome/browser/visitedlink_event_listener.cc b/chrome/browser/visitedlink_event_listener.cc index 9003fcc..ad43ba0 100644 --- a/chrome/browser/visitedlink_event_listener.cc +++ b/chrome/browser/visitedlink_event_listener.cc @@ -6,7 +6,6 @@ #include "base/shared_memory.h" #include "chrome/browser/renderer_host/render_process_host.h" -#include "chrome/common/render_messages.h" using base::Time; using base::TimeDelta; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ec82bf3..81b723e 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1711,6 +1711,7 @@ 'test/automation/automation_constants.h', 'test/automation/automation_handle_tracker.cc', 'test/automation/automation_handle_tracker.h', + 'test/automation/automation_messages.cc', 'test/automation/automation_messages.h', 'test/automation/automation_messages_internal.h', 'test/automation/automation_proxy.cc', diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 8456a52..4400764 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1850,6 +1850,7 @@ 'browser/importer/importer_data_types.h', 'browser/importer/importer_list.cc', 'browser/importer/importer_list.h', + 'browser/importer/importer_messages.cc', 'browser/importer/importer_messages.h', 'browser/importer/importer_messages_internal.h', 'browser/importer/mork_reader.cc', @@ -2973,6 +2974,12 @@ 'browser/zygote_host_linux.cc', 'browser/zygote_main_linux.cc', + # TODO(erg): http://crbug.com/51409 These files are also specified as + # part of the automation project, but we need these definitions here, + # too, due to usage in our automation provider. + 'test/automation/automation_messages.cc', + 'test/automation/automation_messages.h', + # These files are generated by GRIT. '<(grit_out_dir)/grit/bookmark_manager_resources_map.cc', '<(grit_out_dir)/grit/shared_resources_map.cc', diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 68d1414..3c6eb5a 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -49,6 +49,7 @@ 'common/content_settings_types.h', 'common/debug_flags.cc', 'common/debug_flags.h', + 'common/devtools_messages.cc', 'common/devtools_messages.h', 'common/devtools_messages_internal.h', 'common/font_descriptor_mac.h', @@ -57,6 +58,7 @@ 'common/geoposition.h', 'common/gpu_info.h', 'common/gpu_info.cc', + 'common/gpu_messages.cc', 'common/gpu_messages.h', 'common/gpu_messages_internal.h', 'common/gpu_video_common.cc', @@ -72,9 +74,10 @@ 'common/metrics_helpers.h', 'common/nacl_cmd_line.cc', 'common/nacl_cmd_line.h', + 'common/nacl_messages.cc', 'common/nacl_messages.h', - 'common/nacl_types.h', 'common/nacl_messages_internal.h', + 'common/nacl_types.h', 'common/notification_details.cc', 'common/notification_details.h', 'common/notification_observer.h', @@ -248,8 +251,10 @@ 'common/pepper_plugin_registry.h', 'common/plugin_carbon_interpose_constants_mac.h', 'common/plugin_carbon_interpose_constants_mac.cc', + 'common/plugin_messages.cc', 'common/plugin_messages.h', 'common/plugin_messages_internal.h', + 'common/render_messages.cc', 'common/render_messages.h', 'common/render_messages_internal.h', 'common/renderer_preferences.h', @@ -257,11 +262,12 @@ 'common/resource_dispatcher.h', 'common/security_filter_peer.cc', 'common/security_filter_peer.h', + 'common/service_messages.cc', 'common/service_messages.h', 'common/services_messages_internal.h', - 'common/service_process_type.h', - 'common/service_process_util.cc', - 'common/service_process_util.h', + 'common/service_process_type.h', + 'common/service_process_util.cc', + 'common/service_process_util.h', 'common/socket_stream_dispatcher.cc', 'common/socket_stream_dispatcher.h', 'common/spellcheck_common.cc', @@ -274,6 +280,7 @@ 'common/thumbnail_score.h', 'common/url_constants.cc', 'common/url_constants.h', + 'common/utility_messages.cc', 'common/utility_messages.h', 'common/utility_messages_internal.h', 'common/view_types.cc', @@ -282,11 +289,13 @@ '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', 'common/window_container_type.cc', 'common/window_container_type.h', + 'common/worker_messages.cc', 'common/worker_messages.h', 'common/worker_messages_internal.h', 'common/worker_thread_ticker.cc', diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index e655435..d6eb2cc 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.cc @@ -407,6 +407,45 @@ void ParamTraits<Geoposition>::Log(const Geoposition& p, std::wstring* l) { LogParam(p.error_code, l); } +void ParamTraits<webkit_glue::PasswordForm>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.signon_realm); + WriteParam(m, p.origin); + WriteParam(m, p.action); + WriteParam(m, p.submit_element); + WriteParam(m, p.username_element); + WriteParam(m, p.username_value); + WriteParam(m, p.password_element); + WriteParam(m, p.password_value); + WriteParam(m, p.old_password_element); + WriteParam(m, p.old_password_value); + WriteParam(m, p.ssl_valid); + WriteParam(m, p.preferred); + WriteParam(m, p.blacklisted_by_user); +} + +bool ParamTraits<webkit_glue::PasswordForm>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->signon_realm) && + ReadParam(m, iter, &p->origin) && + ReadParam(m, iter, &p->action) && + ReadParam(m, iter, &p->submit_element) && + ReadParam(m, iter, &p->username_element) && + ReadParam(m, iter, &p->username_value) && + ReadParam(m, iter, &p->password_element) && + ReadParam(m, iter, &p->password_value) && + ReadParam(m, iter, &p->old_password_element) && + ReadParam(m, iter, &p->old_password_value) && + ReadParam(m, iter, &p->ssl_valid) && + ReadParam(m, iter, &p->preferred) && + ReadParam(m, iter, &p->blacklisted_by_user); +} +void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<PasswordForm>"); +} + void ParamTraits<printing::PageRange>::Write(Message* m, const param_type& p) { WriteParam(m, p.from); WriteParam(m, p.to); diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 0ca6bed..4df6536 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -23,7 +23,6 @@ #include "net/base/upload_data.h" #include "net/url_request/url_request_status.h" #include "printing/native_metafile.h" -#include "webkit/glue/password_form.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/window_open_disposition.h" @@ -34,6 +33,7 @@ class DictionaryValue; class ListValue; struct ThumbnailScore; class URLRequestStatus; +class WebCursor; namespace gfx { class Point; @@ -210,7 +210,7 @@ struct ParamTraits<WebCursor> { static void Write(Message* m, const param_type& p) { p.Serialize(m); } - static bool Read(const Message* m, void** iter, param_type* r) { + static bool Read(const Message* m, void** iter, param_type* r) { return r->Deserialize(m, iter); } static void Log(const param_type& p, std::wstring* l) { @@ -368,49 +368,16 @@ struct ParamTraits<Geoposition::ErrorCode> { template <> struct ParamTraits<webkit_glue::PasswordForm> { typedef webkit_glue::PasswordForm param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.signon_realm); - WriteParam(m, p.origin); - WriteParam(m, p.action); - WriteParam(m, p.submit_element); - WriteParam(m, p.username_element); - WriteParam(m, p.username_value); - WriteParam(m, p.password_element); - WriteParam(m, p.password_value); - WriteParam(m, p.old_password_element); - WriteParam(m, p.old_password_value); - WriteParam(m, p.ssl_valid); - WriteParam(m, p.preferred); - WriteParam(m, p.blacklisted_by_user); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->signon_realm) && - ReadParam(m, iter, &p->origin) && - ReadParam(m, iter, &p->action) && - ReadParam(m, iter, &p->submit_element) && - ReadParam(m, iter, &p->username_element) && - ReadParam(m, iter, &p->username_value) && - ReadParam(m, iter, &p->password_element) && - ReadParam(m, iter, &p->password_value) && - ReadParam(m, iter, &p->old_password_element) && - ReadParam(m, iter, &p->old_password_value) && - ReadParam(m, iter, &p->ssl_valid) && - ReadParam(m, iter, &p->preferred) && - ReadParam(m, iter, &p->blacklisted_by_user); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<PasswordForm>"); - } + 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<printing::PageRange> { typedef printing::PageRange param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* r); - static void Log(const param_type& p, std::wstring* l); }; @@ -418,9 +385,7 @@ template <> struct ParamTraits<printing::NativeMetafile> { typedef printing::NativeMetafile param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* r); - static void Log(const param_type& p, std::wstring* l); }; diff --git a/chrome/common/devtools_messages.cc b/chrome/common/devtools_messages.cc new file mode 100644 index 0000000..8ea923e --- /dev/null +++ b/chrome/common/devtools_messages.cc @@ -0,0 +1,9 @@ +// 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/devtools_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/devtools_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/gpu_messages.cc b/chrome/common/gpu_messages.cc new file mode 100644 index 0000000..4ba5776 --- /dev/null +++ b/chrome/common/gpu_messages.cc @@ -0,0 +1,9 @@ +// 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/gpu_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/gpu_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/nacl_messages.cc b/chrome/common/nacl_messages.cc new file mode 100644 index 0000000..291ed5a --- /dev/null +++ b/chrome/common/nacl_messages.cc @@ -0,0 +1,9 @@ +// 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/nacl_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/nacl_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/nacl_messages_internal.h b/chrome/common/nacl_messages_internal.h index 8d95cc7..e302118 100644 --- a/chrome/common/nacl_messages_internal.h +++ b/chrome/common/nacl_messages_internal.h @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/process.h" #include "chrome/common/nacl_types.h" #include "ipc/ipc_message_macros.h" diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc new file mode 100644 index 0000000..3079dcc --- /dev/null +++ b/chrome/common/plugin_messages.cc @@ -0,0 +1,11 @@ +// 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/plugin_messages.h" + +#include "ipc/ipc_channel_handle.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/plugin_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc new file mode 100644 index 0000000..e3aec79 --- /dev/null +++ b/chrome/common/render_messages.cc @@ -0,0 +1,923 @@ +// 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/render_messages.h" + +#include "base/values.h" +#include "chrome/common/edit_command.h" +#include "chrome/common/extensions/extension_extent.h" +#include "chrome/common/extensions/url_pattern.h" +#include "chrome/common/indexed_db_key.h" +#include "chrome/common/serialized_script_value.h" +#include "chrome/common/thumbnail_score.h" +#include "gfx/rect.h" +#include "ipc/ipc_channel_handle.h" +#include "net/http/http_response_headers.h" +#include "third_party/skia/include/core/SkBitmap.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/WebMediaPlayerAction.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" +#include "webkit/appcache/appcache_interfaces.h" +#include "webkit/glue/context_menu.h" +#include "webkit/glue/form_data.h" +#include "webkit/glue/form_field.h" +#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/glue/password_form.h" +#include "webkit/glue/webaccessibility.h" +#include "webkit/glue/webcookie.h" +#include "webkit/glue/webcursor.h" +#include "webkit/glue/webdropdata.h" +#include "webkit/glue/plugins/webplugin.h" +#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/glue/dom_operations.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/render_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" + +namespace IPC { + +void ParamTraits<ViewMsg_Navigate_Params>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.page_id); + WriteParam(m, p.pending_history_list_offset); + WriteParam(m, p.current_history_list_offset); + WriteParam(m, p.current_history_list_length); + WriteParam(m, p.url); + WriteParam(m, p.referrer); + WriteParam(m, p.transition); + WriteParam(m, p.state); + WriteParam(m, p.navigation_type); + WriteParam(m, p.request_time); +} + +bool ParamTraits<ViewMsg_Navigate_Params>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->page_id) && + ReadParam(m, iter, &p->pending_history_list_offset) && + ReadParam(m, iter, &p->current_history_list_offset) && + ReadParam(m, iter, &p->current_history_list_length) && + ReadParam(m, iter, &p->url) && + ReadParam(m, iter, &p->referrer) && + ReadParam(m, iter, &p->transition) && + ReadParam(m, iter, &p->state) && + ReadParam(m, iter, &p->navigation_type) && + ReadParam(m, iter, &p->request_time); +} + +void ParamTraits<ViewMsg_Navigate_Params>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.page_id, l); + l->append(L", "); + LogParam(p.url, l); + l->append(L", "); + LogParam(p.transition, l); + l->append(L", "); + LogParam(p.state, l); + l->append(L", "); + LogParam(p.navigation_type, l); + l->append(L", "); + LogParam(p.request_time, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::FormField>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.label()); + WriteParam(m, p.name()); + WriteParam(m, p.value()); + WriteParam(m, p.form_control_type()); + WriteParam(m, p.size()); + WriteParam(m, p.option_strings()); +} + +bool ParamTraits<webkit_glue::FormField>::Read(const Message* m, void** iter, + param_type* p) { + string16 label, name, value, form_control_type; + int size = 0; + std::vector<string16> options; + bool result = ReadParam(m, iter, &label); + result = result && ReadParam(m, iter, &name); + result = result && ReadParam(m, iter, &value); + result = result && ReadParam(m, iter, &form_control_type); + result = result && ReadParam(m, iter, &size); + result = result && ReadParam(m, iter, &options); + if (!result) + return false; + + p->set_label(label); + p->set_name(name); + p->set_value(value); + p->set_form_control_type(form_control_type); + p->set_size(size); + p->set_option_strings(options); + return true; +} + +void ParamTraits<webkit_glue::FormField>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<FormField>"); +} + +void ParamTraits<ContextMenuParams>::Write(Message* m, const param_type& p) { + WriteParam(m, p.media_type); + WriteParam(m, p.x); + WriteParam(m, p.y); + WriteParam(m, p.link_url); + WriteParam(m, p.unfiltered_link_url); + WriteParam(m, p.src_url); + WriteParam(m, p.is_image_blocked); + WriteParam(m, p.page_url); + WriteParam(m, p.frame_url); + WriteParam(m, p.media_flags); + WriteParam(m, p.selection_text); + WriteParam(m, p.misspelled_word); + WriteParam(m, p.dictionary_suggestions); + WriteParam(m, p.spellcheck_enabled); + WriteParam(m, p.is_editable); +#if defined(OS_MACOSX) + WriteParam(m, p.writing_direction_default); + WriteParam(m, p.writing_direction_left_to_right); + WriteParam(m, p.writing_direction_right_to_left); +#endif // OS_MACOSX + WriteParam(m, p.edit_flags); + WriteParam(m, p.security_info); + WriteParam(m, p.frame_charset); + WriteParam(m, p.custom_items); +} + +bool ParamTraits<ContextMenuParams>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->media_type) && + ReadParam(m, iter, &p->x) && + ReadParam(m, iter, &p->y) && + ReadParam(m, iter, &p->link_url) && + ReadParam(m, iter, &p->unfiltered_link_url) && + ReadParam(m, iter, &p->src_url) && + ReadParam(m, iter, &p->is_image_blocked) && + ReadParam(m, iter, &p->page_url) && + ReadParam(m, iter, &p->frame_url) && + ReadParam(m, iter, &p->media_flags) && + ReadParam(m, iter, &p->selection_text) && + ReadParam(m, iter, &p->misspelled_word) && + ReadParam(m, iter, &p->dictionary_suggestions) && + ReadParam(m, iter, &p->spellcheck_enabled) && + ReadParam(m, iter, &p->is_editable) && +#if defined(OS_MACOSX) + ReadParam(m, iter, &p->writing_direction_default) && + ReadParam(m, iter, &p->writing_direction_left_to_right) && + ReadParam(m, iter, &p->writing_direction_right_to_left) && +#endif // OS_MACOSX + ReadParam(m, iter, &p->edit_flags) && + ReadParam(m, iter, &p->security_info) && + ReadParam(m, iter, &p->frame_charset) && + ReadParam(m, iter, &p->custom_items); +} + +void ParamTraits<ContextMenuParams>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<ContextMenuParams>"); +} + +void ParamTraits<ViewHostMsg_UpdateRect_Params>::Write( + Message* m, const param_type& p) { + WriteParam(m, p.bitmap); + WriteParam(m, p.bitmap_rect); + WriteParam(m, p.dx); + WriteParam(m, p.dy); + WriteParam(m, p.scroll_rect); + WriteParam(m, p.copy_rects); + WriteParam(m, p.view_size); + WriteParam(m, p.plugin_window_moves); + WriteParam(m, p.flags); +} + +bool ParamTraits<ViewHostMsg_UpdateRect_Params>::Read( + const Message* m, void** iter, param_type* p) { + return + ReadParam(m, iter, &p->bitmap) && + ReadParam(m, iter, &p->bitmap_rect) && + ReadParam(m, iter, &p->dx) && + ReadParam(m, iter, &p->dy) && + ReadParam(m, iter, &p->scroll_rect) && + ReadParam(m, iter, &p->copy_rects) && + ReadParam(m, iter, &p->view_size) && + ReadParam(m, iter, &p->plugin_window_moves) && + ReadParam(m, iter, &p->flags); +} + +void ParamTraits<ViewHostMsg_UpdateRect_Params>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.bitmap, l); + l->append(L", "); + LogParam(p.bitmap_rect, l); + l->append(L", "); + LogParam(p.dx, l); + l->append(L", "); + LogParam(p.dy, l); + l->append(L", "); + LogParam(p.scroll_rect, l); + l->append(L", "); + LogParam(p.copy_rects, l); + l->append(L", "); + LogParam(p.view_size, l); + l->append(L", "); + LogParam(p.plugin_window_moves, l); + l->append(L", "); + LogParam(p.flags, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::WebPluginGeometry>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.window); + WriteParam(m, p.window_rect); + WriteParam(m, p.clip_rect); + WriteParam(m, p.cutout_rects); + WriteParam(m, p.rects_valid); + WriteParam(m, p.visible); +} + +bool ParamTraits<webkit_glue::WebPluginGeometry>::Read( + const Message* m, void** iter, param_type* p) { + return + ReadParam(m, iter, &p->window) && + ReadParam(m, iter, &p->window_rect) && + ReadParam(m, iter, &p->clip_rect) && + ReadParam(m, iter, &p->cutout_rects) && + ReadParam(m, iter, &p->rects_valid) && + ReadParam(m, iter, &p->visible); +} + +void ParamTraits<webkit_glue::WebPluginGeometry>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.window, l); + l->append(L", "); + LogParam(p.window_rect, l); + l->append(L", "); + LogParam(p.clip_rect, l); + l->append(L", "); + LogParam(p.cutout_rects, l); + l->append(L", "); + LogParam(p.rects_valid, l); + l->append(L", "); + LogParam(p.visible, l); + l->append(L")"); +} + +void ParamTraits<WebPluginMimeType>::Write(Message* m, const param_type& p) { + WriteParam(m, p.mime_type); + WriteParam(m, p.file_extensions); + WriteParam(m, p.description); +} + +bool ParamTraits<WebPluginMimeType>::Read(const Message* m, void** iter, + param_type* r) { + return + ReadParam(m, iter, &r->mime_type) && + ReadParam(m, iter, &r->file_extensions) && + ReadParam(m, iter, &r->description); +} + +void ParamTraits<WebPluginMimeType>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.mime_type, l); + l->append(L", "); + LogParam(p.file_extensions, l); + l->append(L", "); + LogParam(p.description, l); + l->append(L")"); +} + +void ParamTraits<WebPluginInfo>::Write(Message* m, const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.path); + WriteParam(m, p.version); + WriteParam(m, p.desc); + WriteParam(m, p.mime_types); + WriteParam(m, p.enabled); +} + +bool ParamTraits<WebPluginInfo>::Read(const Message* m, void** iter, + param_type* r) { + return + ReadParam(m, iter, &r->name) && + ReadParam(m, iter, &r->path) && + ReadParam(m, iter, &r->version) && + ReadParam(m, iter, &r->desc) && + ReadParam(m, iter, &r->mime_types) && + ReadParam(m, iter, &r->enabled); +} + +void ParamTraits<WebPluginInfo>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.name, l); + l->append(L", "); + l->append(L", "); + LogParam(p.path, l); + l->append(L", "); + LogParam(p.version, l); + l->append(L", "); + LogParam(p.desc, l); + l->append(L", "); + LogParam(p.mime_types, l); + l->append(L", "); + LogParam(p.enabled, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::PasswordFormFillData>::Write( + Message* m, const param_type& p) { + WriteParam(m, p.basic_data); + WriteParam(m, p.additional_logins); + WriteParam(m, p.wait_for_username); +} + +bool ParamTraits<webkit_glue::PasswordFormFillData>::Read( + const Message* m, void** iter, param_type* r) { + return + ReadParam(m, iter, &r->basic_data) && + ReadParam(m, iter, &r->additional_logins) && + ReadParam(m, iter, &r->wait_for_username); +} + +void ParamTraits<webkit_glue::PasswordFormFillData>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<PasswordFormFillData>"); +} + +void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write( + Message* m, const param_type& p) { + WriteParam(m, p.get() != NULL); + if (p) { + // Do not disclose Set-Cookie headers over IPC. + p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); + } +} + +bool ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Read( + const Message* m, void** iter, param_type* r) { + bool has_object; + if (!ReadParam(m, iter, &has_object)) + return false; + if (has_object) + *r = new net::HttpResponseHeaders(*m, iter); + return true; +} + +void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Log( + const param_type& p, std::wstring* l) { + l->append(L"<HttpResponseHeaders>"); +} + +void ParamTraits<SerializedScriptValue>::Write(Message* m, const param_type& p) { + WriteParam(m, p.is_null()); + WriteParam(m, p.is_invalid()); + WriteParam(m, p.data()); +} + +bool ParamTraits<SerializedScriptValue>::Read(const Message* m, void** iter, + param_type* r) { + bool is_null; + bool is_invalid; + string16 data; + bool ok = + ReadParam(m, iter, &is_null) && + ReadParam(m, iter, &is_invalid) && + ReadParam(m, iter, &data); + if (!ok) + return false; + r->set_is_null(is_null); + r->set_is_invalid(is_invalid); + r->set_data(data); + return true; +} + +void ParamTraits<SerializedScriptValue>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<SerializedScriptValue>("); + LogParam(p.is_null(), l); + l->append(L", "); + LogParam(p.is_invalid(), l); + l->append(L", "); + LogParam(p.data(), l); + l->append(L")"); +} + +void ParamTraits<IndexedDBKey>::Write(Message* m, const param_type& p) { + WriteParam(m, int(p.type())); + // TODO(jorlow): Technically, we only need to pack the type being used. + WriteParam(m, p.string()); + WriteParam(m, p.number()); +} + +bool ParamTraits<IndexedDBKey>::Read(const Message* m, void** iter, + param_type* r) { + int type; + string16 string; + int32 number; + bool ok = + ReadParam(m, iter, &type) && + ReadParam(m, iter, &string) && + ReadParam(m, iter, &number); + if (!ok) + return false; + switch (type) { + case WebKit::WebIDBKey::NullType: + r->SetNull(); + return true; + case WebKit::WebIDBKey::StringType: + r->Set(string); + return true; + case WebKit::WebIDBKey::NumberType: + r->Set(number); + return true; + case WebKit::WebIDBKey::InvalidType: + r->SetInvalid(); + return true; + } + NOTREACHED(); + return false; +} + +void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::wstring* l) { + l->append(L"<IndexedDBKey>("); + LogParam(int(p.type()), l); + l->append(L", "); + LogParam(p.string(), l); + l->append(L", "); + LogParam(p.number(), l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::FormData>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.method); + WriteParam(m, p.origin); + WriteParam(m, p.action); + WriteParam(m, p.user_submitted); + WriteParam(m, p.fields); +} + +bool ParamTraits<webkit_glue::FormData>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->method) && + ReadParam(m, iter, &p->origin) && + ReadParam(m, iter, &p->action) && + ReadParam(m, iter, &p->user_submitted) && + ReadParam(m, iter, &p->fields); +} + +void ParamTraits<webkit_glue::FormData>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<FormData>"); +} + +void ParamTraits<RendererPreferences>::Write(Message* m, const param_type& p) { + WriteParam(m, p.can_accept_load_drops); + WriteParam(m, p.should_antialias_text); + WriteParam(m, static_cast<int>(p.hinting)); + WriteParam(m, static_cast<int>(p.subpixel_rendering)); + WriteParam(m, p.focus_ring_color); + WriteParam(m, p.thumb_active_color); + WriteParam(m, p.thumb_inactive_color); + WriteParam(m, p.track_color); + WriteParam(m, p.active_selection_bg_color); + WriteParam(m, p.active_selection_fg_color); + WriteParam(m, p.inactive_selection_bg_color); + WriteParam(m, p.inactive_selection_fg_color); + WriteParam(m, p.browser_handles_top_level_requests); + WriteParam(m, p.caret_blink_interval); +} + +bool ParamTraits<RendererPreferences>::Read(const Message* m, void** iter, + param_type* p) { + if (!ReadParam(m, iter, &p->can_accept_load_drops)) + return false; + if (!ReadParam(m, iter, &p->should_antialias_text)) + return false; + + int hinting = 0; + if (!ReadParam(m, iter, &hinting)) + return false; + p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting); + + int subpixel_rendering = 0; + if (!ReadParam(m, iter, &subpixel_rendering)) + return false; + p->subpixel_rendering = + static_cast<RendererPreferencesSubpixelRenderingEnum>( + subpixel_rendering); + + int focus_ring_color; + if (!ReadParam(m, iter, &focus_ring_color)) + return false; + p->focus_ring_color = focus_ring_color; + + int thumb_active_color, thumb_inactive_color, track_color; + int active_selection_bg_color, active_selection_fg_color; + int inactive_selection_bg_color, inactive_selection_fg_color; + if (!ReadParam(m, iter, &thumb_active_color) || + !ReadParam(m, iter, &thumb_inactive_color) || + !ReadParam(m, iter, &track_color) || + !ReadParam(m, iter, &active_selection_bg_color) || + !ReadParam(m, iter, &active_selection_fg_color) || + !ReadParam(m, iter, &inactive_selection_bg_color) || + !ReadParam(m, iter, &inactive_selection_fg_color)) + return false; + p->thumb_active_color = thumb_active_color; + p->thumb_inactive_color = thumb_inactive_color; + p->track_color = track_color; + p->active_selection_bg_color = active_selection_bg_color; + p->active_selection_fg_color = active_selection_fg_color; + p->inactive_selection_bg_color = inactive_selection_bg_color; + p->inactive_selection_fg_color = inactive_selection_fg_color; + + if (!ReadParam(m, iter, &p->browser_handles_top_level_requests)) + return false; + + if (!ReadParam(m, iter, &p->caret_blink_interval)) + return false; + + return true; +} + +void ParamTraits<RendererPreferences>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<RendererPreferences>"); +} + +void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) { + WriteParam(m, p.standard_font_family); + WriteParam(m, p.fixed_font_family); + WriteParam(m, p.serif_font_family); + WriteParam(m, p.sans_serif_font_family); + WriteParam(m, p.cursive_font_family); + WriteParam(m, p.fantasy_font_family); + WriteParam(m, p.default_font_size); + WriteParam(m, p.default_fixed_font_size); + WriteParam(m, p.minimum_font_size); + WriteParam(m, p.minimum_logical_font_size); + WriteParam(m, p.default_encoding); + WriteParam(m, p.javascript_enabled); + WriteParam(m, p.web_security_enabled); + WriteParam(m, p.javascript_can_open_windows_automatically); + WriteParam(m, p.loads_images_automatically); + WriteParam(m, p.plugins_enabled); + WriteParam(m, p.dom_paste_enabled); + WriteParam(m, p.developer_extras_enabled); + WriteParam(m, p.inspector_settings); + WriteParam(m, p.site_specific_quirks_enabled); + WriteParam(m, p.shrinks_standalone_images_to_fit); + WriteParam(m, p.uses_universal_detector); + WriteParam(m, p.text_areas_are_resizable); + WriteParam(m, p.java_enabled); + WriteParam(m, p.allow_scripts_to_close_windows); + WriteParam(m, p.uses_page_cache); + WriteParam(m, p.remote_fonts_enabled); + WriteParam(m, p.javascript_can_access_clipboard); + WriteParam(m, p.xss_auditor_enabled); + WriteParam(m, p.local_storage_enabled); + WriteParam(m, p.databases_enabled); + WriteParam(m, p.application_cache_enabled); + WriteParam(m, p.tabs_to_links); + WriteParam(m, p.user_style_sheet_enabled); + WriteParam(m, p.user_style_sheet_location); + WriteParam(m, p.author_and_user_styles_enabled); + WriteParam(m, p.allow_universal_access_from_file_urls); + WriteParam(m, p.allow_file_access_from_file_urls); + WriteParam(m, p.experimental_webgl_enabled); + WriteParam(m, p.show_composited_layer_borders); + WriteParam(m, p.accelerated_compositing_enabled); + WriteParam(m, p.accelerated_2d_canvas_enabled); + WriteParam(m, p.memory_info_enabled); +} + +bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->standard_font_family) && + ReadParam(m, iter, &p->fixed_font_family) && + ReadParam(m, iter, &p->serif_font_family) && + ReadParam(m, iter, &p->sans_serif_font_family) && + ReadParam(m, iter, &p->cursive_font_family) && + ReadParam(m, iter, &p->fantasy_font_family) && + ReadParam(m, iter, &p->default_font_size) && + ReadParam(m, iter, &p->default_fixed_font_size) && + ReadParam(m, iter, &p->minimum_font_size) && + ReadParam(m, iter, &p->minimum_logical_font_size) && + ReadParam(m, iter, &p->default_encoding) && + ReadParam(m, iter, &p->javascript_enabled) && + ReadParam(m, iter, &p->web_security_enabled) && + ReadParam(m, iter, &p->javascript_can_open_windows_automatically) && + ReadParam(m, iter, &p->loads_images_automatically) && + ReadParam(m, iter, &p->plugins_enabled) && + ReadParam(m, iter, &p->dom_paste_enabled) && + ReadParam(m, iter, &p->developer_extras_enabled) && + ReadParam(m, iter, &p->inspector_settings) && + ReadParam(m, iter, &p->site_specific_quirks_enabled) && + ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) && + ReadParam(m, iter, &p->uses_universal_detector) && + ReadParam(m, iter, &p->text_areas_are_resizable) && + ReadParam(m, iter, &p->java_enabled) && + ReadParam(m, iter, &p->allow_scripts_to_close_windows) && + ReadParam(m, iter, &p->uses_page_cache) && + ReadParam(m, iter, &p->remote_fonts_enabled) && + ReadParam(m, iter, &p->javascript_can_access_clipboard) && + ReadParam(m, iter, &p->xss_auditor_enabled) && + ReadParam(m, iter, &p->local_storage_enabled) && + ReadParam(m, iter, &p->databases_enabled) && + ReadParam(m, iter, &p->application_cache_enabled) && + ReadParam(m, iter, &p->tabs_to_links) && + ReadParam(m, iter, &p->user_style_sheet_enabled) && + ReadParam(m, iter, &p->user_style_sheet_location) && + ReadParam(m, iter, &p->author_and_user_styles_enabled) && + ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && + ReadParam(m, iter, &p->allow_file_access_from_file_urls) && + ReadParam(m, iter, &p->experimental_webgl_enabled) && + ReadParam(m, iter, &p->show_composited_layer_borders) && + ReadParam(m, iter, &p->accelerated_compositing_enabled) && + ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) && + ReadParam(m, iter, &p->memory_info_enabled); +} + +void ParamTraits<WebPreferences>::Log(const param_type& p, std::wstring* l) { + l->append(L"<WebPreferences>"); +} + +void ParamTraits<WebDropData>::Write(Message* m, const param_type& p) { + WriteParam(m, p.identity); + WriteParam(m, p.url); + WriteParam(m, p.url_title); + WriteParam(m, p.download_metadata); + WriteParam(m, p.file_extension); + WriteParam(m, p.filenames); + WriteParam(m, p.plain_text); + WriteParam(m, p.text_html); + WriteParam(m, p.html_base_url); + WriteParam(m, p.file_description_filename); + WriteParam(m, p.file_contents); +} + +bool ParamTraits<WebDropData>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->identity) && + ReadParam(m, iter, &p->url) && + ReadParam(m, iter, &p->url_title) && + ReadParam(m, iter, &p->download_metadata) && + ReadParam(m, iter, &p->file_extension) && + ReadParam(m, iter, &p->filenames) && + ReadParam(m, iter, &p->plain_text) && + ReadParam(m, iter, &p->text_html) && + ReadParam(m, iter, &p->html_base_url) && + ReadParam(m, iter, &p->file_description_filename) && + ReadParam(m, iter, &p->file_contents); +} + +void ParamTraits<WebDropData>::Log(const param_type& p, std::wstring* l) { + l->append(L"<WebDropData>"); +} + +void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) { + WriteParam(m, p.valid_schemes()); + WriteParam(m, p.GetAsString()); +} + +bool ParamTraits<URLPattern>::Read(const Message* m, void** iter, + param_type* p) { + int valid_schemes; + std::string spec; + if (!ReadParam(m, iter, &valid_schemes) || + !ReadParam(m, iter, &spec)) + return false; + + p->set_valid_schemes(valid_schemes); + return p->Parse(spec); +} + +void ParamTraits<URLPattern>::Log(const param_type& p, std::wstring* l) { + LogParam(p.GetAsString(), l); +} + +void ParamTraits<EditCommand>::Write(Message* m, const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.value); +} + +bool ParamTraits<EditCommand>::Read(const Message* m, void** iter, + param_type* p) { + return ReadParam(m, iter, &p->name) && ReadParam(m, iter, &p->value); +} + +void ParamTraits<EditCommand>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.name, l); + l->append(L":"); + LogParam(p.value, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::WebCookie>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.value); + WriteParam(m, p.domain); + WriteParam(m, p.path); + WriteParam(m, p.expires); + WriteParam(m, p.http_only); + WriteParam(m, p.secure); + WriteParam(m, p.session); +} + +bool ParamTraits<webkit_glue::WebCookie>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->value) && + ReadParam(m, iter, &p->domain) && + ReadParam(m, iter, &p->path) && + ReadParam(m, iter, &p->expires) && + ReadParam(m, iter, &p->http_only) && + ReadParam(m, iter, &p->secure) && + ReadParam(m, iter, &p->session); +} + +void ParamTraits<webkit_glue::WebCookie>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<WebCookie>"); +} + +void ParamTraits<ExtensionExtent>::Write(Message* m, const param_type& p) { + WriteParam(m, p.patterns()); +} + +bool ParamTraits<ExtensionExtent>::Read(const Message* m, void** iter, + param_type* p) { + std::vector<URLPattern> patterns; + bool success = + ReadParam(m, iter, &patterns); + if (!success) + return false; + + for (size_t i = 0; i < patterns.size(); ++i) + p->AddPattern(patterns[i]); + return true; +} + +void ParamTraits<ExtensionExtent>::Log(const param_type& p, std::wstring* l) { + LogParam(p.patterns(), l); +} + +void ParamTraits<appcache::AppCacheResourceInfo>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.url); + WriteParam(m, p.size); + WriteParam(m, p.is_manifest); + WriteParam(m, p.is_master); + WriteParam(m, p.is_fallback); + WriteParam(m, p.is_foreign); + WriteParam(m, p.is_explicit); +} + +bool ParamTraits<appcache::AppCacheResourceInfo>::Read( + const Message* m, void** iter, param_type* p) { + return ReadParam(m, iter, &p->url) && + ReadParam(m, iter, &p->size) && + ReadParam(m, iter, &p->is_manifest) && + ReadParam(m, iter, &p->is_master) && + ReadParam(m, iter, &p->is_fallback) && + ReadParam(m, iter, &p->is_foreign) && + ReadParam(m, iter, &p->is_explicit); +} + +void ParamTraits<appcache::AppCacheResourceInfo>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.url, l); + l->append(L", "); + LogParam(p.size, l); + l->append(L", "); + LogParam(p.is_manifest, l); + l->append(L", "); + LogParam(p.is_master, l); + l->append(L", "); + LogParam(p.is_fallback, l); + l->append(L", "); + LogParam(p.is_foreign, l); + l->append(L", "); + LogParam(p.is_explicit, l); + l->append(L")"); +} + +void ParamTraits<appcache::AppCacheInfo>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.manifest_url); + WriteParam(m, p.creation_time); + WriteParam(m, p.last_update_time); + WriteParam(m, p.last_access_time); + WriteParam(m, p.cache_id); + WriteParam(m, p.status); + WriteParam(m, p.size); + WriteParam(m, p.is_complete); +} + +bool ParamTraits<appcache::AppCacheInfo>::Read(const Message* m, void** iter, + param_type* p) { + return ReadParam(m, iter, &p->manifest_url) && + ReadParam(m, iter, &p->creation_time) && + ReadParam(m, iter, &p->last_update_time) && + ReadParam(m, iter, &p->last_access_time) && + ReadParam(m, iter, &p->cache_id) && + ReadParam(m, iter, &p->status) && + ReadParam(m, iter, &p->size) && + ReadParam(m, iter, &p->is_complete); +} + +void ParamTraits<appcache::AppCacheInfo>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.manifest_url, l); + l->append(L", "); + LogParam(p.creation_time, l); + l->append(L", "); + LogParam(p.last_update_time, l); + l->append(L", "); + LogParam(p.last_access_time, l); + l->append(L", "); + LogParam(p.cache_id, l); + l->append(L", "); + LogParam(p.status, l); + l->append(L", "); + LogParam(p.size, l); + l->append(L")"); + LogParam(p.is_complete, l); + l->append(L", "); +} + +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 0bea305..2a516ed 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -9,6 +9,8 @@ #include <string> #include <vector> +// TODO(erg): This list has been temporarily annotated by erg while doing work +// on which headers to pull out. #include "app/clipboard/clipboard.h" #include "app/surface/transport_dib.h" #include "base/basictypes.h" @@ -19,43 +21,37 @@ #include "chrome/common/common_param_traits.h" #include "chrome/common/css_colors.h" #include "chrome/common/dom_storage_common.h" -#include "chrome/common/edit_command.h" -#include "chrome/common/extensions/extension_extent.h" -#include "chrome/common/extensions/url_pattern.h" +#include "chrome/common/extensions/extension_extent.h" // used in struct #include "chrome/common/font_descriptor_mac.h" -#include "chrome/common/indexed_db_key.h" +#include "chrome/common/indexed_db_key.h" // used in struct #include "chrome/common/navigation_gesture.h" #include "chrome/common/page_transition_types.h" -#include "chrome/common/renderer_preferences.h" +#include "chrome/common/renderer_preferences.h" // used in struct #include "chrome/common/resource_response.h" #include "chrome/common/translate_errors.h" #include "chrome/common/view_types.h" -#include "chrome/common/serialized_script_value.h" #include "chrome/common/webkit_param_traits.h" #include "chrome/common/window_container_type.h" #include "gfx/native_widget_types.h" +#include "gfx/rect.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message_utils.h" #include "ipc/ipc_platform_file.h" #include "media/audio/audio_io.h" #include "net/base/upload_data.h" -#include "net/http/http_response_headers.h" #include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h" #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" -#include "webkit/appcache/appcache_interfaces.h" -#include "webkit/glue/context_menu.h" -#include "webkit/glue/form_data.h" -#include "webkit/glue/form_field.h" -#include "webkit/glue/password_form.h" -#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/appcache/appcache_interfaces.h" // enum appcache::Status +#include "webkit/glue/password_form.h" // used in struct #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" -#include "webkit/glue/webpreferences.h" +#include "webkit/glue/webpreferences.h" // used in struct + +namespace appcache { +struct AppCacheInfo; +struct AppCacheResourceInfo; +} namespace base { class Time; @@ -83,6 +79,11 @@ class IndexedDBKey; class SerializedScriptValue; class SkBitmap; +class URLPattern; +struct ContextMenuParams; +struct WebDropData; +struct WebPluginInfo; +struct WebPluginMimeType; // Parameters structure for ViewMsg_Navigate, which has too many data // parameters to be reasonably put in a predefined IPC message. @@ -914,46 +915,9 @@ struct ParamTraits<ResourceType::Type> { template <> struct ParamTraits<ViewMsg_Navigate_Params> { typedef ViewMsg_Navigate_Params param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.page_id); - WriteParam(m, p.pending_history_list_offset); - WriteParam(m, p.current_history_list_offset); - WriteParam(m, p.current_history_list_length); - WriteParam(m, p.url); - WriteParam(m, p.referrer); - WriteParam(m, p.transition); - WriteParam(m, p.state); - WriteParam(m, p.navigation_type); - WriteParam(m, p.request_time); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->page_id) && - ReadParam(m, iter, &p->pending_history_list_offset) && - ReadParam(m, iter, &p->current_history_list_offset) && - ReadParam(m, iter, &p->current_history_list_length) && - ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->referrer) && - ReadParam(m, iter, &p->transition) && - ReadParam(m, iter, &p->state) && - ReadParam(m, iter, &p->navigation_type) && - ReadParam(m, iter, &p->request_time); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.page_id, l); - l->append(L", "); - LogParam(p.url, l); - l->append(L", "); - LogParam(p.transition, l); - l->append(L", "); - LogParam(p.state, l); - l->append(L", "); - LogParam(p.navigation_type, l); - l->append(L", "); - LogParam(p.request_time, 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<> @@ -976,7 +940,7 @@ struct ParamTraits<ViewMsg_Navigate_Params::NavigationType> { event = L"NavigationType_RELOAD"; break; - case ViewMsg_Navigate_Params::RELOAD_IGNORING_CACHE: + case ViewMsg_Navigate_Params::RELOAD_IGNORING_CACHE: event = L"NavigationType_RELOAD_IGNORING_CACHE"; break; @@ -1000,38 +964,9 @@ struct ParamTraits<ViewMsg_Navigate_Params::NavigationType> { template <> struct ParamTraits<webkit_glue::FormField> { typedef webkit_glue::FormField param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.label()); - WriteParam(m, p.name()); - WriteParam(m, p.value()); - WriteParam(m, p.form_control_type()); - WriteParam(m, p.size()); - WriteParam(m, p.option_strings()); - } - static bool Read(const Message* m, void** iter, param_type* p) { - string16 label, name, value, form_control_type; - int size = 0; - std::vector<string16> options; - bool result = ReadParam(m, iter, &label); - result = result && ReadParam(m, iter, &name); - result = result && ReadParam(m, iter, &value); - result = result && ReadParam(m, iter, &form_control_type); - result = result && ReadParam(m, iter, &size); - result = result && ReadParam(m, iter, &options); - if (!result) - return false; - - p->set_label(label); - p->set_name(name); - p->set_value(value); - p->set_form_control_type(form_control_type); - p->set_size(size); - p->set_option_strings(options); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<FormField>"); - } + 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 FontDescriptor structure to pack/unpack. @@ -1172,234 +1107,52 @@ struct ParamTraits<ViewHostMsg_FrameNavigate_Params> { template <> struct ParamTraits<ContextMenuParams> { typedef ContextMenuParams param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.media_type); - WriteParam(m, p.x); - WriteParam(m, p.y); - WriteParam(m, p.link_url); - WriteParam(m, p.unfiltered_link_url); - WriteParam(m, p.src_url); - WriteParam(m, p.is_image_blocked); - WriteParam(m, p.page_url); - WriteParam(m, p.frame_url); - WriteParam(m, p.media_flags); - WriteParam(m, p.selection_text); - WriteParam(m, p.misspelled_word); - WriteParam(m, p.dictionary_suggestions); - WriteParam(m, p.spellcheck_enabled); - WriteParam(m, p.is_editable); -#if defined(OS_MACOSX) - WriteParam(m, p.writing_direction_default); - WriteParam(m, p.writing_direction_left_to_right); - WriteParam(m, p.writing_direction_right_to_left); -#endif // OS_MACOSX - WriteParam(m, p.edit_flags); - WriteParam(m, p.security_info); - WriteParam(m, p.frame_charset); - WriteParam(m, p.custom_items); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->media_type) && - ReadParam(m, iter, &p->x) && - ReadParam(m, iter, &p->y) && - ReadParam(m, iter, &p->link_url) && - ReadParam(m, iter, &p->unfiltered_link_url) && - ReadParam(m, iter, &p->src_url) && - ReadParam(m, iter, &p->is_image_blocked) && - ReadParam(m, iter, &p->page_url) && - ReadParam(m, iter, &p->frame_url) && - ReadParam(m, iter, &p->media_flags) && - ReadParam(m, iter, &p->selection_text) && - ReadParam(m, iter, &p->misspelled_word) && - ReadParam(m, iter, &p->dictionary_suggestions) && - ReadParam(m, iter, &p->spellcheck_enabled) && - ReadParam(m, iter, &p->is_editable) && -#if defined(OS_MACOSX) - ReadParam(m, iter, &p->writing_direction_default) && - ReadParam(m, iter, &p->writing_direction_left_to_right) && - ReadParam(m, iter, &p->writing_direction_right_to_left) && -#endif // OS_MACOSX - ReadParam(m, iter, &p->edit_flags) && - ReadParam(m, iter, &p->security_info) && - ReadParam(m, iter, &p->frame_charset) && - ReadParam(m, iter, &p->custom_items); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<ContextMenuParams>"); - } + 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 ViewHostMsg_UpdateRect_Params structure to pack/unpack. template <> struct ParamTraits<ViewHostMsg_UpdateRect_Params> { typedef ViewHostMsg_UpdateRect_Params param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.bitmap); - WriteParam(m, p.bitmap_rect); - WriteParam(m, p.dx); - WriteParam(m, p.dy); - WriteParam(m, p.scroll_rect); - WriteParam(m, p.copy_rects); - WriteParam(m, p.view_size); - WriteParam(m, p.plugin_window_moves); - WriteParam(m, p.flags); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->bitmap) && - ReadParam(m, iter, &p->bitmap_rect) && - ReadParam(m, iter, &p->dx) && - ReadParam(m, iter, &p->dy) && - ReadParam(m, iter, &p->scroll_rect) && - ReadParam(m, iter, &p->copy_rects) && - ReadParam(m, iter, &p->view_size) && - ReadParam(m, iter, &p->plugin_window_moves) && - ReadParam(m, iter, &p->flags); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.bitmap, l); - l->append(L", "); - LogParam(p.bitmap_rect, l); - l->append(L", "); - LogParam(p.dx, l); - l->append(L", "); - LogParam(p.dy, l); - l->append(L", "); - LogParam(p.scroll_rect, l); - l->append(L", "); - LogParam(p.copy_rects, l); - l->append(L", "); - LogParam(p.view_size, l); - l->append(L", "); - LogParam(p.plugin_window_moves, l); - l->append(L", "); - LogParam(p.flags, 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_glue::WebPluginGeometry> { typedef webkit_glue::WebPluginGeometry param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.window); - WriteParam(m, p.window_rect); - WriteParam(m, p.clip_rect); - WriteParam(m, p.cutout_rects); - WriteParam(m, p.rects_valid); - WriteParam(m, p.visible); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->window) && - ReadParam(m, iter, &p->window_rect) && - ReadParam(m, iter, &p->clip_rect) && - ReadParam(m, iter, &p->cutout_rects) && - ReadParam(m, iter, &p->rects_valid) && - ReadParam(m, iter, &p->visible); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.window, l); - l->append(L", "); - LogParam(p.window_rect, l); - l->append(L", "); - LogParam(p.clip_rect, l); - l->append(L", "); - LogParam(p.cutout_rects, l); - l->append(L", "); - LogParam(p.rects_valid, l); - l->append(L", "); - LogParam(p.visible, 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_GetPlugins_Reply structure to pack/unpack. template <> struct ParamTraits<WebPluginMimeType> { typedef WebPluginMimeType param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.mime_type); - WriteParam(m, p.file_extensions); - WriteParam(m, p.description); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->mime_type) && - ReadParam(m, iter, &r->file_extensions) && - ReadParam(m, iter, &r->description); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.mime_type, l); - l->append(L", "); - LogParam(p.file_extensions, l); - l->append(L", "); - LogParam(p.description, l); - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; - template <> struct ParamTraits<WebPluginInfo> { typedef WebPluginInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.path); - WriteParam(m, p.version); - WriteParam(m, p.desc); - WriteParam(m, p.mime_types); - WriteParam(m, p.enabled); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->name) && - ReadParam(m, iter, &r->path) && - ReadParam(m, iter, &r->version) && - ReadParam(m, iter, &r->desc) && - ReadParam(m, iter, &r->mime_types) && - ReadParam(m, iter, &r->enabled); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.name, l); - l->append(L", "); - l->append(L", "); - LogParam(p.path, l); - l->append(L", "); - LogParam(p.version, l); - l->append(L", "); - LogParam(p.desc, l); - l->append(L", "); - LogParam(p.mime_types, l); - l->append(L", "); - LogParam(p.enabled, l); - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; // Traits for webkit_glue::PasswordFormDomManager::FillData. template <> struct ParamTraits<webkit_glue::PasswordFormFillData> { typedef webkit_glue::PasswordFormFillData param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.basic_data); - WriteParam(m, p.additional_logins); - WriteParam(m, p.wait_for_username); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->basic_data) && - ReadParam(m, iter, &r->additional_logins) && - ReadParam(m, iter, &r->wait_for_username); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<PasswordFormFillData>"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; template<> @@ -1542,24 +1295,9 @@ struct ParamTraits<ViewHostMsg_Resource_Request> { template <> struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { typedef scoped_refptr<net::HttpResponseHeaders> param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.get() != NULL); - if (p) { - // Do not disclose Set-Cookie headers over IPC. - p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); - } - } - static bool Read(const Message* m, void** iter, param_type* r) { - bool has_object; - if (!ReadParam(m, iter, &has_object)) - return false; - if (has_object) - *r = new net::HttpResponseHeaders(*m, iter); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<HttpResponseHeaders>"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; // Traits for webkit_glue::ResourceLoaderBridge::LoadTimingInfo @@ -1762,108 +1500,26 @@ struct ParamTraits<SyncLoadResult> { template <> struct ParamTraits<SerializedScriptValue> { typedef SerializedScriptValue param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.is_null()); - WriteParam(m, p.is_invalid()); - WriteParam(m, p.data()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - bool is_null; - bool is_invalid; - string16 data; - bool ok = - ReadParam(m, iter, &is_null) && - ReadParam(m, iter, &is_invalid) && - ReadParam(m, iter, &data); - if (!ok) - return false; - r->set_is_null(is_null); - r->set_is_invalid(is_invalid); - r->set_data(data); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<SerializedScriptValue>("); - LogParam(p.is_null(), l); - l->append(L", "); - LogParam(p.is_invalid(), l); - l->append(L", "); - LogParam(p.data(), l); - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; template <> struct ParamTraits<IndexedDBKey> { typedef IndexedDBKey param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, int(p.type())); - // TODO(jorlow): Technically, we only need to pack the type being used. - WriteParam(m, p.string()); - WriteParam(m, p.number()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int type; - string16 string; - int32 number; - bool ok = - ReadParam(m, iter, &type) && - ReadParam(m, iter, &string) && - ReadParam(m, iter, &number); - if (!ok) - return false; - switch (type) { - case WebKit::WebIDBKey::NullType: - r->SetNull(); - return true; - case WebKit::WebIDBKey::StringType: - r->Set(string); - return true; - case WebKit::WebIDBKey::NumberType: - r->Set(number); - return true; - case WebKit::WebIDBKey::InvalidType: - r->SetInvalid(); - return true; - } - NOTREACHED(); - return false; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<IndexedDBKey>("); - LogParam(int(p.type()), l); - l->append(L", "); - LogParam(p.string(), l); - l->append(L", "); - LogParam(p.number(), l); - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; // Traits for FormData structure to pack/unpack. template <> struct ParamTraits<webkit_glue::FormData> { typedef webkit_glue::FormData param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.method); - WriteParam(m, p.origin); - WriteParam(m, p.action); - WriteParam(m, p.user_submitted); - WriteParam(m, p.fields); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->name) && - ReadParam(m, iter, &p->method) && - ReadParam(m, iter, &p->origin) && - ReadParam(m, iter, &p->action) && - ReadParam(m, iter, &p->user_submitted) && - ReadParam(m, iter, &p->fields); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<FormData>"); - } + 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_Print_Params @@ -1982,211 +1638,27 @@ struct ParamTraits<CSSColors::CSSColorName> { template <> struct ParamTraits<RendererPreferences> { typedef RendererPreferences param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.can_accept_load_drops); - WriteParam(m, p.should_antialias_text); - WriteParam(m, static_cast<int>(p.hinting)); - WriteParam(m, static_cast<int>(p.subpixel_rendering)); - WriteParam(m, p.focus_ring_color); - WriteParam(m, p.thumb_active_color); - WriteParam(m, p.thumb_inactive_color); - WriteParam(m, p.track_color); - WriteParam(m, p.active_selection_bg_color); - WriteParam(m, p.active_selection_fg_color); - WriteParam(m, p.inactive_selection_bg_color); - WriteParam(m, p.inactive_selection_fg_color); - WriteParam(m, p.browser_handles_top_level_requests); - WriteParam(m, p.caret_blink_interval); - } - static bool Read(const Message* m, void** iter, param_type* p) { - if (!ReadParam(m, iter, &p->can_accept_load_drops)) - return false; - if (!ReadParam(m, iter, &p->should_antialias_text)) - return false; - - int hinting = 0; - if (!ReadParam(m, iter, &hinting)) - return false; - p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting); - - int subpixel_rendering = 0; - if (!ReadParam(m, iter, &subpixel_rendering)) - return false; - p->subpixel_rendering = - static_cast<RendererPreferencesSubpixelRenderingEnum>( - subpixel_rendering); - - int focus_ring_color; - if (!ReadParam(m, iter, &focus_ring_color)) - return false; - p->focus_ring_color = focus_ring_color; - - int thumb_active_color, thumb_inactive_color, track_color; - int active_selection_bg_color, active_selection_fg_color; - int inactive_selection_bg_color, inactive_selection_fg_color; - if (!ReadParam(m, iter, &thumb_active_color) || - !ReadParam(m, iter, &thumb_inactive_color) || - !ReadParam(m, iter, &track_color) || - !ReadParam(m, iter, &active_selection_bg_color) || - !ReadParam(m, iter, &active_selection_fg_color) || - !ReadParam(m, iter, &inactive_selection_bg_color) || - !ReadParam(m, iter, &inactive_selection_fg_color)) - return false; - p->thumb_active_color = thumb_active_color; - p->thumb_inactive_color = thumb_inactive_color; - p->track_color = track_color; - p->active_selection_bg_color = active_selection_bg_color; - p->active_selection_fg_color = active_selection_fg_color; - p->inactive_selection_bg_color = inactive_selection_bg_color; - p->inactive_selection_fg_color = inactive_selection_fg_color; - - if (!ReadParam(m, iter, &p->browser_handles_top_level_requests)) - return false; - - if (!ReadParam(m, iter, &p->caret_blink_interval)) - return false; - - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<RendererPreferences>"); - } + 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 WebPreferences structure to pack/unpack. template <> struct ParamTraits<WebPreferences> { typedef WebPreferences param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.standard_font_family); - WriteParam(m, p.fixed_font_family); - WriteParam(m, p.serif_font_family); - WriteParam(m, p.sans_serif_font_family); - WriteParam(m, p.cursive_font_family); - WriteParam(m, p.fantasy_font_family); - WriteParam(m, p.default_font_size); - WriteParam(m, p.default_fixed_font_size); - WriteParam(m, p.minimum_font_size); - WriteParam(m, p.minimum_logical_font_size); - WriteParam(m, p.default_encoding); - WriteParam(m, p.javascript_enabled); - WriteParam(m, p.web_security_enabled); - WriteParam(m, p.javascript_can_open_windows_automatically); - WriteParam(m, p.loads_images_automatically); - WriteParam(m, p.plugins_enabled); - WriteParam(m, p.dom_paste_enabled); - WriteParam(m, p.developer_extras_enabled); - WriteParam(m, p.inspector_settings); - WriteParam(m, p.site_specific_quirks_enabled); - WriteParam(m, p.shrinks_standalone_images_to_fit); - WriteParam(m, p.uses_universal_detector); - WriteParam(m, p.text_areas_are_resizable); - WriteParam(m, p.java_enabled); - WriteParam(m, p.allow_scripts_to_close_windows); - WriteParam(m, p.uses_page_cache); - WriteParam(m, p.remote_fonts_enabled); - WriteParam(m, p.javascript_can_access_clipboard); - WriteParam(m, p.xss_auditor_enabled); - WriteParam(m, p.local_storage_enabled); - WriteParam(m, p.databases_enabled); - WriteParam(m, p.application_cache_enabled); - WriteParam(m, p.tabs_to_links); - WriteParam(m, p.user_style_sheet_enabled); - WriteParam(m, p.user_style_sheet_location); - WriteParam(m, p.author_and_user_styles_enabled); - WriteParam(m, p.allow_universal_access_from_file_urls); - WriteParam(m, p.allow_file_access_from_file_urls); - WriteParam(m, p.experimental_webgl_enabled); - WriteParam(m, p.show_composited_layer_borders); - WriteParam(m, p.accelerated_compositing_enabled); - WriteParam(m, p.accelerated_2d_canvas_enabled); - WriteParam(m, p.memory_info_enabled); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->standard_font_family) && - ReadParam(m, iter, &p->fixed_font_family) && - ReadParam(m, iter, &p->serif_font_family) && - ReadParam(m, iter, &p->sans_serif_font_family) && - ReadParam(m, iter, &p->cursive_font_family) && - ReadParam(m, iter, &p->fantasy_font_family) && - ReadParam(m, iter, &p->default_font_size) && - ReadParam(m, iter, &p->default_fixed_font_size) && - ReadParam(m, iter, &p->minimum_font_size) && - ReadParam(m, iter, &p->minimum_logical_font_size) && - ReadParam(m, iter, &p->default_encoding) && - ReadParam(m, iter, &p->javascript_enabled) && - ReadParam(m, iter, &p->web_security_enabled) && - ReadParam(m, iter, &p->javascript_can_open_windows_automatically) && - ReadParam(m, iter, &p->loads_images_automatically) && - ReadParam(m, iter, &p->plugins_enabled) && - ReadParam(m, iter, &p->dom_paste_enabled) && - ReadParam(m, iter, &p->developer_extras_enabled) && - ReadParam(m, iter, &p->inspector_settings) && - ReadParam(m, iter, &p->site_specific_quirks_enabled) && - ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) && - ReadParam(m, iter, &p->uses_universal_detector) && - ReadParam(m, iter, &p->text_areas_are_resizable) && - ReadParam(m, iter, &p->java_enabled) && - ReadParam(m, iter, &p->allow_scripts_to_close_windows) && - ReadParam(m, iter, &p->uses_page_cache) && - ReadParam(m, iter, &p->remote_fonts_enabled) && - ReadParam(m, iter, &p->javascript_can_access_clipboard) && - ReadParam(m, iter, &p->xss_auditor_enabled) && - ReadParam(m, iter, &p->local_storage_enabled) && - ReadParam(m, iter, &p->databases_enabled) && - ReadParam(m, iter, &p->application_cache_enabled) && - ReadParam(m, iter, &p->tabs_to_links) && - ReadParam(m, iter, &p->user_style_sheet_enabled) && - ReadParam(m, iter, &p->user_style_sheet_location) && - ReadParam(m, iter, &p->author_and_user_styles_enabled) && - ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && - ReadParam(m, iter, &p->allow_file_access_from_file_urls) && - ReadParam(m, iter, &p->experimental_webgl_enabled) && - ReadParam(m, iter, &p->show_composited_layer_borders) && - ReadParam(m, iter, &p->accelerated_compositing_enabled) && - ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) && - ReadParam(m, iter, &p->memory_info_enabled); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebPreferences>"); - } + 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 WebDropData template <> struct ParamTraits<WebDropData> { typedef WebDropData param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.identity); - WriteParam(m, p.url); - WriteParam(m, p.url_title); - WriteParam(m, p.download_metadata); - WriteParam(m, p.file_extension); - WriteParam(m, p.filenames); - WriteParam(m, p.plain_text); - WriteParam(m, p.text_html); - WriteParam(m, p.html_base_url); - WriteParam(m, p.file_description_filename); - WriteParam(m, p.file_contents); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->identity) && - ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->url_title) && - ReadParam(m, iter, &p->download_metadata) && - ReadParam(m, iter, &p->file_extension) && - ReadParam(m, iter, &p->filenames) && - ReadParam(m, iter, &p->plain_text) && - ReadParam(m, iter, &p->text_html) && - ReadParam(m, iter, &p->html_base_url) && - ReadParam(m, iter, &p->file_description_filename) && - ReadParam(m, iter, &p->file_contents); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebDropData>"); - } + 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 AudioManager::Format. @@ -2592,23 +2064,9 @@ struct SimilarTypeTraits<ViewType::Type> { template <> struct ParamTraits<URLPattern> { typedef URLPattern param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.valid_schemes()); - WriteParam(m, p.GetAsString()); - } - static bool Read(const Message* m, void** iter, param_type* p) { - int valid_schemes; - std::string spec; - if (!ReadParam(m, iter, &valid_schemes) || - !ReadParam(m, iter, &spec)) - return false; - - p->set_valid_schemes(valid_schemes); - return p->Parse(spec); - } - static void Log(const param_type& p, std::wstring* l) { - LogParam(p.GetAsString(), 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 <> @@ -2651,20 +2109,9 @@ struct ParamTraits<Clipboard::Buffer> { template <> struct ParamTraits<EditCommand> { typedef EditCommand param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.value); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, &p->name) && ReadParam(m, iter, &p->value); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.name, l); - l->append(L":"); - LogParam(p.value, 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 DOMStorageType enum. @@ -3012,30 +2459,9 @@ struct ParamTraits<ViewHostMsg_ShowNotification_Params> { template <> struct ParamTraits<webkit_glue::WebCookie> { typedef webkit_glue::WebCookie param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.value); - WriteParam(m, p.domain); - WriteParam(m, p.path); - WriteParam(m, p.expires); - WriteParam(m, p.http_only); - WriteParam(m, p.secure); - WriteParam(m, p.session); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->name) && - ReadParam(m, iter, &p->value) && - ReadParam(m, iter, &p->domain) && - ReadParam(m, iter, &p->path) && - ReadParam(m, iter, &p->expires) && - ReadParam(m, iter, &p->http_only) && - ReadParam(m, iter, &p->secure) && - ReadParam(m, iter, &p->session); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebCookie>"); - } + 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<> @@ -3183,23 +2609,9 @@ struct ParamTraits<ViewHostMsg_CreateWindow_Params> { template <> struct ParamTraits<ExtensionExtent> { typedef ExtensionExtent param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.patterns()); - } - static bool Read(const Message* m, void** iter, param_type* p) { - std::vector<URLPattern> patterns; - bool success = - ReadParam(m, iter, &patterns); - if (!success) - return false; - - for (size_t i = 0; i < patterns.size(); ++i) - p->AddPattern(patterns[i]); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - LogParam(p.patterns(), 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 <> @@ -3237,86 +2649,18 @@ struct ParamTraits<ViewMsg_ExtensionExtentsUpdated_Params> { template<> struct ParamTraits<appcache::AppCacheResourceInfo> { typedef appcache::AppCacheResourceInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.url); - WriteParam(m, p.size); - WriteParam(m, p.is_manifest); - WriteParam(m, p.is_master); - WriteParam(m, p.is_fallback); - WriteParam(m, p.is_foreign); - WriteParam(m, p.is_explicit); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->size) && - ReadParam(m, iter, &p->is_manifest) && - ReadParam(m, iter, &p->is_master) && - ReadParam(m, iter, &p->is_fallback) && - ReadParam(m, iter, &p->is_foreign) && - ReadParam(m, iter, &p->is_explicit); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.url, l); - l->append(L", "); - LogParam(p.size, l); - l->append(L", "); - LogParam(p.is_manifest, l); - l->append(L", "); - LogParam(p.is_master, l); - l->append(L", "); - LogParam(p.is_fallback, l); - l->append(L", "); - LogParam(p.is_foreign, l); - l->append(L", "); - LogParam(p.is_explicit, 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<appcache::AppCacheInfo> { - typedef appcache::AppCacheInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.manifest_url); - WriteParam(m, p.creation_time); - WriteParam(m, p.last_update_time); - WriteParam(m, p.last_access_time); - WriteParam(m, p.cache_id); - WriteParam(m, p.status); - WriteParam(m, p.size); - WriteParam(m, p.is_complete); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, &p->manifest_url) && - ReadParam(m, iter, &p->creation_time) && - ReadParam(m, iter, &p->last_update_time) && - ReadParam(m, iter, &p->last_access_time) && - ReadParam(m, iter, &p->cache_id) && - ReadParam(m, iter, &p->status) && - ReadParam(m, iter, &p->size) && - ReadParam(m, iter, &p->is_complete); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.manifest_url, l); - l->append(L", "); - LogParam(p.creation_time, l); - l->append(L", "); - LogParam(p.last_update_time, l); - l->append(L", "); - LogParam(p.last_access_time, l); - l->append(L", "); - LogParam(p.cache_id, l); - l->append(L", "); - LogParam(p.status, l); - l->append(L", "); - LogParam(p.size, l); - l->append(L")"); - LogParam(p.is_complete, l); - l->append(L", "); - } - }; +struct ParamTraits<appcache::AppCacheInfo> { + typedef appcache::AppCacheInfo param_type; + 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<WindowContainerType> { @@ -3335,62 +2679,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_internal.h b/chrome/common/render_messages_internal.h index 2838579..4aeb137 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -16,25 +16,14 @@ #include "base/nullable_string16.h" #include "base/platform_file.h" #include "base/sync_socket.h" -#include "base/time.h" -#include "base/values.h" #include "chrome/common/content_settings.h" -#include "chrome/common/extensions/update_manifest.h" #include "chrome/common/geoposition.h" #include "chrome/common/nacl_types.h" #include "chrome/common/notification_type.h" #include "chrome/common/page_zoom.h" -#include "chrome/common/thumbnail_score.h" #include "chrome/common/translate_errors.h" #include "chrome/common/window_container_type.h" -#include "gfx/rect.h" -#include "ipc/ipc_channel_handle.h" -#include "ipc/ipc_message.h" #include "ipc/ipc_message_macros.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "webkit/glue/dom_operations.h" -#include "webkit/glue/form_field.h" -#include "webkit/glue/webcursor.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" @@ -52,6 +41,15 @@ // Substitution map for l10n messages. typedef std::map<std::string, std::string> SubstitutionMap; +class SkBitmap; +struct ThumbnailScore; +class WebCursor; + +namespace IPC { +struct ChannelHandle; +class Message; +} + //----------------------------------------------------------------------------- // RenderView messages // These are messages sent from the browser to the renderer process. @@ -190,7 +188,7 @@ IPC_BEGIN_MESSAGES(View) // // This message must be sent just before sending a key event. IPC_MESSAGE_ROUTED1(ViewMsg_SetEditCommandsForNextKeyEvent, - EditCommands /* edit_commands */) + std::vector<EditCommand> /* edit_commands */) // Message payload is the name/value of a WebCore edit command to execute. IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteEditCommand, 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/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index f97f4ef..6e672dd 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.cc @@ -17,6 +17,7 @@ #include "chrome/common/security_filter_peer.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" +#include "net/http/http_response_headers.h" #include "webkit/glue/resource_type.h" #include "webkit/glue/webkit_glue.h" diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc index 3e76678..177fea9 100644 --- a/chrome/common/resource_dispatcher_unittest.cc +++ b/chrome/common/resource_dispatcher_unittest.cc @@ -11,6 +11,7 @@ #include "base/scoped_ptr.h" #include "chrome/common/render_messages.h" #include "chrome/common/resource_dispatcher.h" +#include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/appcache/appcache_interfaces.h" diff --git a/chrome/common/service_messages.cc b/chrome/common/service_messages.cc new file mode 100644 index 0000000..97a10fd --- /dev/null +++ b/chrome/common/service_messages.cc @@ -0,0 +1,9 @@ +// 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/service_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/service_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/utility_messages.cc b/chrome/common/utility_messages.cc new file mode 100644 index 0000000..4c8e567 --- /dev/null +++ b/chrome/common/utility_messages.cc @@ -0,0 +1,9 @@ +// 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/utility_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/utility_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc new file mode 100644 index 0000000..4a81d46 --- /dev/null +++ b/chrome/common/webkit_param_traits.cc @@ -0,0 +1,170 @@ +// 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/WebMediaPlayerAction.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::WebMediaPlayerAction>::Write(Message* m, + const param_type& p) { + WriteParam(m, static_cast<int>(p.type)); + WriteParam(m, p.enable); +} + +bool ParamTraits<WebKit::WebMediaPlayerAction>::Read(const Message* m, + void** iter, + param_type* r) { + int temp; + if (!ReadParam(m, iter, &temp)) + return false; + r->type = static_cast<param_type::Type>(temp); + return ReadParam(m, iter, &r->enable); +} + +void ParamTraits<WebKit::WebMediaPlayerAction>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + switch (p.type) { + case WebKit::WebMediaPlayerAction::Play: + l->append(L"Play"); + break; + case WebKit::WebMediaPlayerAction::Mute: + l->append(L"Mute"); + break; + case WebKit::WebMediaPlayerAction::Loop: + l->append(L"Loop"); + break; + default: + l->append(L"Unknown"); + break; + } + l->append(L", "); + LogParam(p.enable, 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..63cb10b 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 WebMediaPlayerAction; +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 <> @@ -328,37 +269,9 @@ struct ParamTraits<WebKit::WebDragOperation> { template <> struct ParamTraits<WebKit::WebMediaPlayerAction> { typedef WebKit::WebMediaPlayerAction param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, static_cast<int>(p.type)); - WriteParam(m, p.enable); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int temp; - if (!ReadParam(m, iter, &temp)) - return false; - r->type = static_cast<param_type::Type>(temp); - return ReadParam(m, iter, &r->enable); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - switch (p.type) { - case WebKit::WebMediaPlayerAction::Play: - l->append(L"Play"); - break; - case WebKit::WebMediaPlayerAction::Mute: - l->append(L"Mute"); - break; - case WebKit::WebMediaPlayerAction::Loop: - l->append(L"Loop"); - break; - default: - l->append(L"Unknown"); - break; - } - l->append(L", "); - LogParam(p.enable, l); - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; template <> @@ -378,30 +291,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/common/worker_messages.cc b/chrome/common/worker_messages.cc new file mode 100644 index 0000000..437e030 --- /dev/null +++ b/chrome/common/worker_messages.cc @@ -0,0 +1,9 @@ +// 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/worker_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/worker_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 1ae410e..1bd9903 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -27,6 +27,7 @@ #include "chrome/plugin/chrome_plugin_host.h" #include "chrome/plugin/npobject_util.h" #include "chrome/renderer/render_thread.h" +#include "ipc/ipc_channel_handle.h" #include "net/base/net_errors.h" #include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/webkit_glue.h" diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index b2b9aee..6383612 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -8,6 +8,7 @@ #include "app/resource_bundle.h" #include "base/file_path.h" #include "base/string_piece.h" +#include "base/values.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/notification_service.h" #include "chrome/common/plugin_group.h" diff --git a/chrome/renderer/indexed_db_dispatcher.cc b/chrome/renderer/indexed_db_dispatcher.cc index 83f7f49..1087eec 100644 --- a/chrome/renderer/indexed_db_dispatcher.cc +++ b/chrome/renderer/indexed_db_dispatcher.cc @@ -4,6 +4,7 @@ #include "chrome/renderer/indexed_db_dispatcher.h" +#include "chrome/common/indexed_db_key.h" #include "chrome/common/render_messages.h" #include "chrome/common/serialized_script_value.h" #include "chrome/renderer/render_thread.h" diff --git a/chrome/renderer/pepper_devices.cc b/chrome/renderer/pepper_devices.cc index e140727..8d0e403 100644 --- a/chrome/renderer/pepper_devices.cc +++ b/chrome/renderer/pepper_devices.cc @@ -6,9 +6,9 @@ #include "chrome/renderer/render_thread.h" #include "chrome/renderer/webplugin_delegate_pepper.h" #include "skia/ext/platform_canvas.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/plugins/plugin_instance.h" #include "webkit/glue/plugins/webplugin.h" -#include "third_party/skia/include/core/SkBitmap.h" namespace { diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 3b72e6a..631e5b4 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -22,6 +22,7 @@ #include "base/thread_local.h" #include "base/trace_event.h" #include "base/utf_string_conversions.h" +#include "base/values.h" #include "chrome/common/appcache/appcache_dispatcher.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index de74c88..22aef07 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" @@ -126,6 +127,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "third_party/WebKit/WebKit/chromium/public/WebWindowFeatures.h" #include "webkit/appcache/web_application_cache_host_impl.h" +#include "webkit/glue/context_menu.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" @@ -144,6 +146,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/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 0ca11f1..e91efe1 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -7,6 +7,7 @@ #include "app/surface/transport_dib.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/histogram.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "build/build_config.h" @@ -24,6 +25,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" +#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_POSIX) diff --git a/chrome/renderer/renderer_webcookiejar_impl.cc b/chrome/renderer/renderer_webcookiejar_impl.cc index 53a7794..711338b 100644 --- a/chrome/renderer/renderer_webcookiejar_impl.cc +++ b/chrome/renderer/renderer_webcookiejar_impl.cc @@ -7,6 +7,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "third_party/WebKit/WebKit/chromium/public/WebCookie.h" +#include "webkit/glue/webcookie.h" using WebKit::WebCookie; using WebKit::WebString; diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc index a841963..c90af60 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc @@ -24,6 +24,7 @@ #include "chrome/renderer/safe_browsing/features.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" +#include "net/http/http_response_headers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 645473d..a5053e4 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -15,6 +15,7 @@ #include "base/file_path.h" #include "base/file_util.h" +#include "base/histogram.h" #if defined(OS_MACOSX) #include "base/mac_util.h" #endif diff --git a/chrome/renderer/webplugin_delegate_pepper.h b/chrome/renderer/webplugin_delegate_pepper.h index 6f53f1c..f85d2a9d0 100644 --- a/chrome/renderer/webplugin_delegate_pepper.h +++ b/chrome/renderer/webplugin_delegate_pepper.h @@ -19,6 +19,7 @@ #include "gfx/native_widget_types.h" #include "gfx/rect.h" #include "third_party/npapi/bindings/npapi.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserCompletion.h" #include "webkit/glue/plugins/webplugin_delegate.h" diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 04103a1..f1019cb 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -36,6 +36,7 @@ #include "gfx/size.h" #include "grit/generated_resources.h" #include "grit/renderer_resources.h" +#include "ipc/ipc_channel_handle.h" #include "net/base/mime_util.h" #include "printing/native_metafile.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/test/automation/automation_messages.cc b/chrome/test/automation/automation_messages.cc new file mode 100644 index 0000000..8c26327 --- /dev/null +++ b/chrome/test/automation/automation_messages.cc @@ -0,0 +1,9 @@ +// 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/test/automation/automation_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/test/automation/automation_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc index f9340e6..9817ade 100644 --- a/ipc/ipc_fuzzing_tests.cc +++ b/ipc/ipc_fuzzing_tests.cc @@ -12,6 +12,7 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_message_utils.h" +#include "ipc/ipc_message_utils_impl.h" #include "ipc/ipc_tests.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" diff --git a/ipc/ipc_message_impl_macros.h b/ipc/ipc_message_impl_macros.h new file mode 100644 index 0000000..f9eede9 --- /dev/null +++ b/ipc/ipc_message_impl_macros.h @@ -0,0 +1,674 @@ +// 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. + +// The file ipc_messsage_macros.h defines the classes for individual +// messages. This file works similarly, except that it defines the +// 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. + +#ifndef IPC_IPC_MESSAGE_IMPL_MACROS_H_ +#define IPC_IPC_MESSAGE_IMPL_MACROS_H_ + +#include "ipc/ipc_message_utils.h" +#include "ipc/ipc_message_utils_impl.h" + +#ifndef MESSAGES_INTERNAL_IMPL_FILE +#error This file should only be included by X_messages.cc, which needs to define MESSAGES_INTERNAL_IMPL_FILE first. +#endif + +// Trick scons and xcode into seeing the possible real dependencies since they +// don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828 +#if 0 +#include "ipc/ipc_sync_message_unittest.h" +#include "chrome/common/plugin_messages_internal.h" +#include "chrome/common/render_messages_internal.h" +#include "chrome/common/devtools_messages_internal.h" +#include "chrome/test/automation/automation_messages_internal.h" +#include "chrome/common/worker_messages_internal.h" +#endif + +// These are probalby still defined because of ipc_message_macros.h should be +// included before us for the class/method declarations. +#undef IPC_BEGIN_MESSAGES +#undef IPC_END_MESSAGES +#undef IPC_MESSAGE_CONTROL0 +#undef IPC_MESSAGE_CONTROL1 +#undef IPC_MESSAGE_CONTROL2 +#undef IPC_MESSAGE_CONTROL3 +#undef IPC_MESSAGE_CONTROL4 +#undef IPC_MESSAGE_CONTROL5 +#undef IPC_MESSAGE_ROUTED0 +#undef IPC_MESSAGE_ROUTED1 +#undef IPC_MESSAGE_ROUTED2 +#undef IPC_MESSAGE_ROUTED3 +#undef IPC_MESSAGE_ROUTED4 +#undef IPC_MESSAGE_ROUTED5 +#undef IPC_SYNC_MESSAGE_CONTROL0_0 +#undef IPC_SYNC_MESSAGE_CONTROL0_1 +#undef IPC_SYNC_MESSAGE_CONTROL0_2 +#undef IPC_SYNC_MESSAGE_CONTROL0_3 +#undef IPC_SYNC_MESSAGE_CONTROL1_0 +#undef IPC_SYNC_MESSAGE_CONTROL1_1 +#undef IPC_SYNC_MESSAGE_CONTROL1_2 +#undef IPC_SYNC_MESSAGE_CONTROL1_3 +#undef IPC_SYNC_MESSAGE_CONTROL2_0 +#undef IPC_SYNC_MESSAGE_CONTROL2_1 +#undef IPC_SYNC_MESSAGE_CONTROL2_2 +#undef IPC_SYNC_MESSAGE_CONTROL2_3 +#undef IPC_SYNC_MESSAGE_CONTROL3_1 +#undef IPC_SYNC_MESSAGE_CONTROL3_2 +#undef IPC_SYNC_MESSAGE_CONTROL3_3 +#undef IPC_SYNC_MESSAGE_CONTROL4_1 +#undef IPC_SYNC_MESSAGE_CONTROL4_2 +#undef IPC_SYNC_MESSAGE_ROUTED0_0 +#undef IPC_SYNC_MESSAGE_ROUTED0_1 +#undef IPC_SYNC_MESSAGE_ROUTED0_2 +#undef IPC_SYNC_MESSAGE_ROUTED0_3 +#undef IPC_SYNC_MESSAGE_ROUTED1_0 +#undef IPC_SYNC_MESSAGE_ROUTED1_1 +#undef IPC_SYNC_MESSAGE_ROUTED1_2 +#undef IPC_SYNC_MESSAGE_ROUTED1_3 +#undef IPC_SYNC_MESSAGE_ROUTED1_4 +#undef IPC_SYNC_MESSAGE_ROUTED2_0 +#undef IPC_SYNC_MESSAGE_ROUTED2_1 +#undef IPC_SYNC_MESSAGE_ROUTED2_2 +#undef IPC_SYNC_MESSAGE_ROUTED2_3 +#undef IPC_SYNC_MESSAGE_ROUTED3_0 +#undef IPC_SYNC_MESSAGE_ROUTED3_1 +#undef IPC_SYNC_MESSAGE_ROUTED3_2 +#undef IPC_SYNC_MESSAGE_ROUTED3_3 +#undef IPC_SYNC_MESSAGE_ROUTED4_0 +#undef IPC_SYNC_MESSAGE_ROUTED4_1 +#undef IPC_SYNC_MESSAGE_ROUTED4_2 +#undef IPC_SYNC_MESSAGE_ROUTED4_3 +#undef IPC_SYNC_MESSAGE_ROUTED5_0 +#undef IPC_SYNC_MESSAGE_ROUTED5_1 +#undef IPC_SYNC_MESSAGE_ROUTED5_2 +#undef IPC_SYNC_MESSAGE_ROUTED5_3 + +// These don't do anything during this pass. +#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) + +#define IPC_MESSAGE_CONTROL1(msg_class, type1) \ + msg_class::msg_class(const type1& arg1) \ + : IPC::MessageWithTuple< Tuple1<type1> >( \ + MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {} \ + \ + 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)) {} \ + \ + 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, \ + const type3& arg3) \ + : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ + MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ + \ + 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, \ + const type3& arg3, const type4& arg4) \ + : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ + MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ + \ + 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, \ + const type3& arg3, const type4& arg4, \ + const type5& arg5) \ + : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ + \ + 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. +#define IPC_MESSAGE_ROUTED0(msg_class) + +#define IPC_MESSAGE_ROUTED1(msg_class, type1) \ + msg_class::msg_class(int32 routing_id, const type1& arg1) \ + : IPC::MessageWithTuple< Tuple1<type1> >( \ + routing_id, ID, MakeRefTuple(arg1)) {} \ + \ + 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)) {} \ + \ + IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + + +#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ + msg_class::msg_class(int32 routing_id, const type1& arg1, \ + const type2& arg2, const type3& arg3) \ + : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ + \ + 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, \ + const type3& arg3, const type4& arg4) \ + : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ + \ + 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, \ + const type2& arg2, const type3& arg3, \ + const type4& arg4, const type5& arg5) \ + : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ + \ + 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) { \ + if (msg->is_sync()) { \ + TupleTypes<SendParam>::ValueTuple 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); \ + } \ + } + +#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 +// of this file. +#define IPC_MESSAGE_MACROS_INCLUDE_BLOCK + +// Redefine MESSAGES_INTERNAL_FILE just for the header check in +// ipc_messages_macros.h that happens before it breaks on the header guard. +#define MESSAGES_INTERNAL_FILE MESSAGES_INTERNAL_IMPL_FILE + +// Include our INTERNAL file first to get the normal expansion. +#include MESSAGES_INTERNAL_IMPL_FILE + +#endif // IPC_IPC_MESSAGE_IMPL_MACROS_H_ diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index d14f545..903d566 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -79,6 +79,9 @@ #endif +#if defined(IPC_MESSAGE_MACROS_ENUMS) +#undef IPC_MESSAGE_MACROS_ENUMS + // Undefine the macros from the previous pass (if any). #undef IPC_BEGIN_MESSAGES @@ -138,9 +141,6 @@ #undef IPC_SYNC_MESSAGE_ROUTED5_2 #undef IPC_SYNC_MESSAGE_ROUTED5_3 -#if defined(IPC_MESSAGE_MACROS_ENUMS) -#undef IPC_MESSAGE_MACROS_ENUMS - // We're using the lowest 16 bits of type for the message id, and the highest // 16 bits for the channel type. // @@ -399,6 +399,65 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \ #elif defined(IPC_MESSAGE_MACROS_LOG) #undef IPC_MESSAGE_MACROS_LOG + +// Undefine the macros from the previous pass (if any). +#undef IPC_BEGIN_MESSAGES +#undef IPC_END_MESSAGES +#undef IPC_MESSAGE_CONTROL0 +#undef IPC_MESSAGE_CONTROL1 +#undef IPC_MESSAGE_CONTROL2 +#undef IPC_MESSAGE_CONTROL3 +#undef IPC_MESSAGE_CONTROL4 +#undef IPC_MESSAGE_CONTROL5 +#undef IPC_MESSAGE_ROUTED0 +#undef IPC_MESSAGE_ROUTED1 +#undef IPC_MESSAGE_ROUTED2 +#undef IPC_MESSAGE_ROUTED3 +#undef IPC_MESSAGE_ROUTED4 +#undef IPC_MESSAGE_ROUTED5 +#undef IPC_SYNC_MESSAGE_CONTROL0_0 +#undef IPC_SYNC_MESSAGE_CONTROL0_1 +#undef IPC_SYNC_MESSAGE_CONTROL0_2 +#undef IPC_SYNC_MESSAGE_CONTROL0_3 +#undef IPC_SYNC_MESSAGE_CONTROL1_0 +#undef IPC_SYNC_MESSAGE_CONTROL1_1 +#undef IPC_SYNC_MESSAGE_CONTROL1_2 +#undef IPC_SYNC_MESSAGE_CONTROL1_3 +#undef IPC_SYNC_MESSAGE_CONTROL2_0 +#undef IPC_SYNC_MESSAGE_CONTROL2_1 +#undef IPC_SYNC_MESSAGE_CONTROL2_2 +#undef IPC_SYNC_MESSAGE_CONTROL2_3 +#undef IPC_SYNC_MESSAGE_CONTROL3_1 +#undef IPC_SYNC_MESSAGE_CONTROL3_2 +#undef IPC_SYNC_MESSAGE_CONTROL3_3 +#undef IPC_SYNC_MESSAGE_CONTROL4_1 +#undef IPC_SYNC_MESSAGE_CONTROL4_2 +#undef IPC_SYNC_MESSAGE_ROUTED0_0 +#undef IPC_SYNC_MESSAGE_ROUTED0_1 +#undef IPC_SYNC_MESSAGE_ROUTED0_2 +#undef IPC_SYNC_MESSAGE_ROUTED0_3 +#undef IPC_SYNC_MESSAGE_ROUTED1_0 +#undef IPC_SYNC_MESSAGE_ROUTED1_1 +#undef IPC_SYNC_MESSAGE_ROUTED1_2 +#undef IPC_SYNC_MESSAGE_ROUTED1_3 +#undef IPC_SYNC_MESSAGE_ROUTED1_4 +#undef IPC_SYNC_MESSAGE_ROUTED2_0 +#undef IPC_SYNC_MESSAGE_ROUTED2_1 +#undef IPC_SYNC_MESSAGE_ROUTED2_2 +#undef IPC_SYNC_MESSAGE_ROUTED2_3 +#undef IPC_SYNC_MESSAGE_ROUTED3_0 +#undef IPC_SYNC_MESSAGE_ROUTED3_1 +#undef IPC_SYNC_MESSAGE_ROUTED3_2 +#undef IPC_SYNC_MESSAGE_ROUTED3_3 +#undef IPC_SYNC_MESSAGE_ROUTED4_0 +#undef IPC_SYNC_MESSAGE_ROUTED4_1 +#undef IPC_SYNC_MESSAGE_ROUTED4_2 +#undef IPC_SYNC_MESSAGE_ROUTED4_3 +#undef IPC_SYNC_MESSAGE_ROUTED5_0 +#undef IPC_SYNC_MESSAGE_ROUTED5_1 +#undef IPC_SYNC_MESSAGE_ROUTED5_2 +#undef IPC_SYNC_MESSAGE_ROUTED5_3 + #ifndef IPC_LOG_TABLE_CREATED #define IPC_LOG_TABLE_CREATED typedef void (*LogFunction)(uint32 type, @@ -601,6 +660,65 @@ LogFunction g_log_function_mapping[LastMsgIndex]; #elif defined(IPC_MESSAGE_MACROS_CLASSES) #undef IPC_MESSAGE_MACROS_CLASSES + +// Undefine the macros from the previous pass (if any). +#undef IPC_BEGIN_MESSAGES +#undef IPC_END_MESSAGES +#undef IPC_MESSAGE_CONTROL0 +#undef IPC_MESSAGE_CONTROL1 +#undef IPC_MESSAGE_CONTROL2 +#undef IPC_MESSAGE_CONTROL3 +#undef IPC_MESSAGE_CONTROL4 +#undef IPC_MESSAGE_CONTROL5 +#undef IPC_MESSAGE_ROUTED0 +#undef IPC_MESSAGE_ROUTED1 +#undef IPC_MESSAGE_ROUTED2 +#undef IPC_MESSAGE_ROUTED3 +#undef IPC_MESSAGE_ROUTED4 +#undef IPC_MESSAGE_ROUTED5 +#undef IPC_SYNC_MESSAGE_CONTROL0_0 +#undef IPC_SYNC_MESSAGE_CONTROL0_1 +#undef IPC_SYNC_MESSAGE_CONTROL0_2 +#undef IPC_SYNC_MESSAGE_CONTROL0_3 +#undef IPC_SYNC_MESSAGE_CONTROL1_0 +#undef IPC_SYNC_MESSAGE_CONTROL1_1 +#undef IPC_SYNC_MESSAGE_CONTROL1_2 +#undef IPC_SYNC_MESSAGE_CONTROL1_3 +#undef IPC_SYNC_MESSAGE_CONTROL2_0 +#undef IPC_SYNC_MESSAGE_CONTROL2_1 +#undef IPC_SYNC_MESSAGE_CONTROL2_2 +#undef IPC_SYNC_MESSAGE_CONTROL2_3 +#undef IPC_SYNC_MESSAGE_CONTROL3_1 +#undef IPC_SYNC_MESSAGE_CONTROL3_2 +#undef IPC_SYNC_MESSAGE_CONTROL3_3 +#undef IPC_SYNC_MESSAGE_CONTROL4_1 +#undef IPC_SYNC_MESSAGE_CONTROL4_2 +#undef IPC_SYNC_MESSAGE_ROUTED0_0 +#undef IPC_SYNC_MESSAGE_ROUTED0_1 +#undef IPC_SYNC_MESSAGE_ROUTED0_2 +#undef IPC_SYNC_MESSAGE_ROUTED0_3 +#undef IPC_SYNC_MESSAGE_ROUTED1_0 +#undef IPC_SYNC_MESSAGE_ROUTED1_1 +#undef IPC_SYNC_MESSAGE_ROUTED1_2 +#undef IPC_SYNC_MESSAGE_ROUTED1_3 +#undef IPC_SYNC_MESSAGE_ROUTED1_4 +#undef IPC_SYNC_MESSAGE_ROUTED2_0 +#undef IPC_SYNC_MESSAGE_ROUTED2_1 +#undef IPC_SYNC_MESSAGE_ROUTED2_2 +#undef IPC_SYNC_MESSAGE_ROUTED2_3 +#undef IPC_SYNC_MESSAGE_ROUTED3_0 +#undef IPC_SYNC_MESSAGE_ROUTED3_1 +#undef IPC_SYNC_MESSAGE_ROUTED3_2 +#undef IPC_SYNC_MESSAGE_ROUTED3_3 +#undef IPC_SYNC_MESSAGE_ROUTED4_0 +#undef IPC_SYNC_MESSAGE_ROUTED4_1 +#undef IPC_SYNC_MESSAGE_ROUTED4_2 +#undef IPC_SYNC_MESSAGE_ROUTED4_3 +#undef IPC_SYNC_MESSAGE_ROUTED5_0 +#undef IPC_SYNC_MESSAGE_ROUTED5_1 +#undef IPC_SYNC_MESSAGE_ROUTED5_2 +#undef IPC_SYNC_MESSAGE_ROUTED5_3 + #define IPC_BEGIN_MESSAGES(label) #define IPC_END_MESSAGES(label) @@ -616,61 +734,52 @@ LogFunction g_log_function_mapping[LastMsgIndex]; #define IPC_MESSAGE_CONTROL1(msg_class, type1) \ class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1) \ - : IPC::MessageWithTuple< Tuple1<type1> >(MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1)) {} \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; -#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ +#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ class msg_class : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2) \ - : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ - MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1, arg2)) {} \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; -#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3) \ - : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ - MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1, arg2, arg3)) {} \ +#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ + class msg_class : \ + public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2, const type3& arg3); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; -#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ - class msg_class : \ +#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ + class msg_class : \ public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ - const type4& arg4) \ - : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ - MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ + const type4& arg4); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ - class msg_class : \ + class msg_class : \ public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5) \ - : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ - MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4, const type5& arg5); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; #define IPC_MESSAGE_ROUTED0(msg_class) \ @@ -682,75 +791,74 @@ LogFunction g_log_function_mapping[LastMsgIndex]; }; #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ - class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1) \ - : IPC::MessageWithTuple< Tuple1<type1> >(routing_id, ID, \ - MakeRefTuple(arg1)) {} \ + class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; -#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ - class msg_class : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \ - : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ - routing_id, ID, MakeRefTuple(arg1, arg2)) {} \ +#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ + class msg_class \ + : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; -#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3) \ - : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ - routing_id, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ +#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ + class msg_class \ + : public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; -#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4) \ - : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ - routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ +#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ + class msg_class \ + : public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5) \ - : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ - routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ + class msg_class \ + : public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, \ + type5> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4, const type5& arg5); \ + ~msg_class(); \ + static void Log(const Message* msg, std::wstring* l); \ }; #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) \ @@ -758,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) \ @@ -771,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) \ @@ -805,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) \ @@ -817,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) \ @@ -852,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) \ @@ -864,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) \ @@ -877,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) \ @@ -889,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) \ @@ -901,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) \ @@ -914,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) \ @@ -926,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) \ @@ -957,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) \ @@ -969,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) \ @@ -980,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) \ @@ -991,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) \ @@ -1002,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) \ @@ -1014,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) \ @@ -1026,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) \ @@ -1037,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) \ @@ -1048,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) \ @@ -1060,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) \ @@ -1072,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) \ @@ -1083,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 : \ @@ -1095,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) \ @@ -1107,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) \ @@ -1119,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) \ @@ -1131,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) \ @@ -1143,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) \ @@ -1155,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) \ @@ -1167,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) \ @@ -1179,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) \ @@ -1191,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) \ @@ -1203,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) \ @@ -1215,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.cc b/ipc/ipc_message_utils.cc index 41fbde7..93f192ed 100644 --- a/ipc/ipc_message_utils.cc +++ b/ipc/ipc_message_utils.cc @@ -4,10 +4,16 @@ #include "ipc/ipc_message_utils.h" +#include "base/file_path.h" #include "base/json/json_writer.h" +#include "base/nullable_string16.h" #include "base/scoped_ptr.h" #include "base/time.h" #include "base/values.h" +#if defined(OS_POSIX) +#include "ipc/file_descriptor_set_posix.h" +#endif +#include "ipc/ipc_channel_handle.h" namespace IPC { @@ -201,6 +207,24 @@ static bool ReadValue(const Message* m, void** iter, Value** value, return true; } + +void ParamTraits<base::Time>::Write(Message* m, const param_type& p) { + ParamTraits<int64>::Write(m, p.ToInternalValue()); +} + +bool ParamTraits<base::Time>::Read(const Message* m, void** iter, + param_type* r) { + int64 value; + if (!ParamTraits<int64>::Read(m, iter, &value)) + return false; + *r = base::Time::FromInternalValue(value); + return true; +} + +void ParamTraits<base::Time>::Log(const param_type& p, std::wstring* l) { + ParamTraits<int64>::Log(p.ToInternalValue(), l); +} + void ParamTraits<DictionaryValue>::Write(Message* m, const param_type& p) { WriteValue(m, &p, 0); } @@ -238,4 +262,107 @@ void ParamTraits<ListValue>::Log(const param_type& p, std::wstring* l) { base::JSONWriter::Write(&p, false, &json); l->append(UTF8ToWide(json)); } + +void ParamTraits<NullableString16>::Write(Message* m, const param_type& p) { + WriteParam(m, p.string()); + WriteParam(m, p.is_null()); +} + +bool ParamTraits<NullableString16>::Read(const Message* m, void** iter, + param_type* r) { + string16 string; + if (!ReadParam(m, iter, &string)) + return false; + bool is_null; + if (!ReadParam(m, iter, &is_null)) + return false; + *r = NullableString16(string, is_null); + return true; +} + +void ParamTraits<NullableString16>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.string(), l); + l->append(L", "); + LogParam(p.is_null(), l); + l->append(L")"); +} + +void ParamTraits<FilePath>::Write(Message* m, const param_type& p) { + ParamTraits<FilePath::StringType>::Write(m, p.value()); +} + +bool ParamTraits<FilePath>::Read(const Message* m, void** iter, param_type* r) { + FilePath::StringType value; + if (!ParamTraits<FilePath::StringType>::Read(m, iter, &value)) + return false; + *r = FilePath(value); + return true; +} + +void ParamTraits<FilePath>::Log(const param_type& p, std::wstring* l) { + ParamTraits<FilePath::StringType>::Log(p.value(), l); +} + +#if defined(OS_POSIX) +void ParamTraits<base::FileDescriptor>::Write(Message* m, const param_type& p) { + const bool valid = p.fd >= 0; + WriteParam(m, valid); + + if (valid) { + if (!m->WriteFileDescriptor(p)) + NOTREACHED(); + } +} + +bool ParamTraits<base::FileDescriptor>::Read(const Message* m, void** iter, + param_type* r) { + bool valid; + if (!ReadParam(m, iter, &valid)) + return false; + + if (!valid) { + r->fd = -1; + r->auto_close = false; + return true; + } + + return m->ReadFileDescriptor(iter, r); +} + +void ParamTraits<base::FileDescriptor>::Log(const param_type& p, + std::wstring* l) { + if (p.auto_close) { + l->append(StringPrintf(L"FD(%d auto-close)", p.fd)); + } else { + l->append(StringPrintf(L"FD(%d)", p.fd)); + } +} +#endif // defined(OS_POSIX) + +void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) { + WriteParam(m, p.name); +#if defined(OS_POSIX) + WriteParam(m, p.socket); +#endif +} + +bool ParamTraits<IPC::ChannelHandle>::Read(const Message* m, void** iter, + param_type* r) { + return ReadParam(m, iter, &r->name) +#if defined(OS_POSIX) + && ReadParam(m, iter, &r->socket) +#endif + ; +} + +void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p, + std::wstring* l) { + l->append(ASCIIToWide(StringPrintf("ChannelHandle(%s", p.name.c_str()))); +#if defined(OS_POSIX) + ParamTraits<base::FileDescriptor>::Log(p.socket, l); +#endif + l->append(L")"); +} + } // namespace IPC diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 4667d4b..05d3916 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -12,22 +12,29 @@ #include <map> #include <set> -#include "base/file_path.h" #include "base/format_macros.h" -#include "base/nullable_string16.h" #include "base/string16.h" #include "base/string_number_conversions.h" #include "base/string_util.h" -#include "base/time.h" #include "base/tuple.h" #include "base/utf_string_conversions.h" -#include "base/values.h" -#if defined(OS_POSIX) -#include "ipc/file_descriptor_set_posix.h" -#endif -#include "ipc/ipc_channel_handle.h" #include "ipc/ipc_sync_message.h" +#if defined(COMPILER_GCC) +// GCC "helpfully" tries to inline template methods in release mode. Except we +// want the majority of the template junk being expanded once in the +// implementation file (and only provide the definitions in +// ipc_message_utils_impl.h in those files) and exported, instead of expanded +// at every call site. Special note: GCC happily accepts the attribute before +// the method declaration, but only acts on it if it is after. +#define IPC_MSG_NOINLINE __attribute__((noinline)); +#elif defined(COMPILER_MSVC) +// MSVC++ doesn't do this. +#define IPC_MSG_NOINLINE +#else +#error "Please add the noinline property for your new compiler here." +#endif + // Used by IPC_BEGIN_MESSAGES so that each message class starts from a unique // base. Messages have unique IDs across channels in order for the IPC logging // code to figure out the message class from its ID. @@ -67,8 +74,20 @@ enum IPCMessageStart { LastMsgIndex }; +class DictionaryValue; +class FilePath; +class ListValue; +class NullableString16; + +namespace base { +class Time; +struct FileDescriptor; +} + namespace IPC { +struct ChannelHandle; + //----------------------------------------------------------------------------- // An iterator class for reading the fields contained within a Message. @@ -306,19 +325,9 @@ struct ParamTraits<wchar_t> { template <> struct ParamTraits<base::Time> { typedef base::Time param_type; - static void Write(Message* m, const param_type& p) { - ParamTraits<int64>::Write(m, p.ToInternalValue()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int64 value; - if (!ParamTraits<int64>::Read(m, iter, &value)) - return false; - *r = base::Time::FromInternalValue(value); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - ParamTraits<int64>::Log(p.ToInternalValue(), l); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; #if defined(OS_WIN) @@ -365,6 +374,9 @@ struct ParamTraits<MSG> { return result; } + static void Log(const param_type& p, std::wstring* l) { + l->append(L"<MSG>"); + } }; #endif // defined(OS_WIN) @@ -598,27 +610,9 @@ struct ParamTraits<std::pair<A, B> > { template <> struct ParamTraits<NullableString16> { typedef NullableString16 param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.string()); - WriteParam(m, p.is_null()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - string16 string; - if (!ReadParam(m, iter, &string)) - return false; - bool is_null; - if (!ReadParam(m, iter, &is_null)) - return false; - *r = NullableString16(string, is_null); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.string(), l); - l->append(L", "); - LogParam(p.is_null(), l); - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; // If WCHAR_T_IS_UTF16 is defined, then string16 is a std::wstring so we don't @@ -709,19 +703,9 @@ struct ParamTraits<POINT> { template <> struct ParamTraits<FilePath> { typedef FilePath param_type; - static void Write(Message* m, const param_type& p) { - ParamTraits<FilePath::StringType>::Write(m, p.value()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - FilePath::StringType value; - if (!ParamTraits<FilePath::StringType>::Read(m, iter, &value)) - return false; - *r = FilePath(value); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - ParamTraits<FilePath::StringType>::Log(p.value(), l); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; #if defined(OS_POSIX) @@ -743,35 +727,9 @@ struct ParamTraits<FilePath> { template<> struct ParamTraits<base::FileDescriptor> { typedef base::FileDescriptor param_type; - static void Write(Message* m, const param_type& p) { - const bool valid = p.fd >= 0; - WriteParam(m, valid); - - if (valid) { - if (!m->WriteFileDescriptor(p)) - NOTREACHED(); - } - } - static bool Read(const Message* m, void** iter, param_type* r) { - bool valid; - if (!ReadParam(m, iter, &valid)) - return false; - - if (!valid) { - r->fd = -1; - r->auto_close = false; - return true; - } - - return m->ReadFileDescriptor(iter, r); - } - static void Log(const param_type& p, std::wstring* l) { - if (p.auto_close) { - l->append(StringPrintf(L"FD(%d auto-close)", p.fd)); - } else { - l->append(StringPrintf(L"FD(%d)", p.fd)); - } - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; #endif // defined(OS_POSIX) @@ -781,26 +739,9 @@ struct ParamTraits<base::FileDescriptor> { template<> struct ParamTraits<IPC::ChannelHandle> { typedef ChannelHandle param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); -#if defined(OS_POSIX) - WriteParam(m, p.socket); -#endif - } - static bool Read(const Message* m, void** iter, param_type* r) { - return ReadParam(m, iter, &r->name) -#if defined(OS_POSIX) - && ReadParam(m, iter, &r->socket) -#endif - ; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(ASCIIToWide(StringPrintf("ChannelHandle(%s", p.name.c_str()))); -#if defined(OS_POSIX) - ParamTraits<base::FileDescriptor>::Log(p.socket, l); -#endif - l->append(L")"); - } + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); }; #if defined(OS_WIN) @@ -1026,20 +967,15 @@ template <class ParamType> class MessageWithTuple : public Message { public: typedef ParamType Param; - typedef typename ParamType::ParamTuple RefParam; + typedef typename TupleTypes<ParamType>::ParamTuple RefParam; - MessageWithTuple(int32 routing_id, uint32 type, const RefParam& p) - : Message(routing_id, type, PRIORITY_NORMAL) { - WriteParam(this, p); - } + // The constructor and the Read() method's templated implementations are in + // ipc_message_utils_impl.h. The subclass constructor and Log() methods call + // the templated versions of these and make sure there are instantiations in + // those translation units. + MessageWithTuple(int32 routing_id, uint32 type, const RefParam& p); - static bool Read(const Message* msg, Param* p) { - void* iter = NULL; - if (ReadParam(msg, &iter, p)) - return true; - NOTREACHED() << "Error deserializing message " << msg->type(); - return false; - } + static bool Read(const Message* msg, Param* p) IPC_MSG_NOINLINE; // Generic dispatcher. Should cover most cases. template<class T, class Method> @@ -1111,12 +1047,6 @@ class MessageWithTuple : public Message { return false; } - static void Log(const Message* msg, std::wstring* l) { - Param p; - if (Read(msg, &p)) - LogParam(p, l); - } - // Functions used to do manual unpacking. Only used by the automation code, // these should go away once that code uses SyncChannel. template<typename TA, typename TB> @@ -1166,8 +1096,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: @@ -1180,67 +1156,32 @@ 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 { public: typedef SendParamType SendParam; - typedef typename SendParam::ParamTuple RefSendParam; + typedef typename TupleTypes<SendParam>::ParamTuple RefSendParam; 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); - -#if defined(IPC_MESSAGE_LOG_ENABLED) - const std::wstring& output_params = msg->output_params(); - if (!l->empty() && !output_params.empty()) - l->append(L", "); - - 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 ReplyParam::ValueTuple p; - void* iter = SyncMessage::GetDataIterator(msg); - if (ReadParam(msg, &iter, &p)) - LogParam(p, l); - } - } + const RefSendParam& send, const ReplyParam& reply); + static bool ReadSendParam(const Message* msg, SendParam* p) IPC_MSG_NOINLINE; + static bool ReadReplyParam( + const Message* msg, + typename TupleTypes<ReplyParam>::ValueTuple* p) IPC_MSG_NOINLINE; 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)) { - typename ReplyParam::ValueTuple reply_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(); @@ -1254,23 +1195,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 new file mode 100644 index 0000000..715df8f --- /dev/null +++ b/ipc/ipc_message_utils_impl.h @@ -0,0 +1,60 @@ +// 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. +// +// This file contains templates forward declared (but not defined) in +// ipc_message_utils.h so that they are only instantiated in certain files, +// notably ipc_message_impl_macros.h and a few IPC unit tests. + +#ifndef IPC_IPC_MESSAGE_UTILS_IMPL_H_ +#define IPC_IPC_MESSAGE_UTILS_IMPL_H_ + +namespace IPC { + +template <class ParamType> +MessageWithTuple<ParamType>::MessageWithTuple( + int32 routing_id, uint32 type, const RefParam& p) + : Message(routing_id, type, PRIORITY_NORMAL) { + WriteParam(this, p); +} + +template <class ParamType> +bool MessageWithTuple<ParamType>::Read(const Message* msg, Param* p) { + void* iter = NULL; + if (ReadParam(msg, &iter, p)) + return true; + NOTREACHED() << "Error deserializing message " << msg->type(); + return false; +} + +// We can't migrate the template for Log() to MessageWithTuple, because each +// 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); +} + +template <class SendParamType, class ReplyParamType> +bool MessageWithReply<SendParamType, ReplyParamType>::ReadSendParam( + const Message* msg, SendParam* p) { + void* iter = SyncMessage::GetDataIterator(msg); + return ReadParam(msg, &iter, p); +} + +template <class SendParamType, class ReplyParamType> +bool MessageWithReply<SendParamType, ReplyParamType>::ReadReplyParam( + const Message* msg, typename TupleTypes<ReplyParam>::ValueTuple* p) { + void* iter = SyncMessage::GetDataIterator(msg); + return ReadParam(msg, &iter, p); +} + +} // namespace IPC + +#endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_ diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc index 5f399da..f6d315f 100644 --- a/ipc/ipc_send_fds_test.cc +++ b/ipc/ipc_send_fds_test.cc @@ -20,6 +20,7 @@ extern "C" { #include "ipc/ipc_message_utils.h" #if defined(OS_POSIX) +#include "base/file_descriptor_posix.h" namespace { 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; diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc index d37247d..5775d9b 100644 --- a/ipc/sync_socket_unittest.cc +++ b/ipc/sync_socket_unittest.cc @@ -16,6 +16,7 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_message_utils.h" +#include "ipc/ipc_message_utils_impl.h" #include "ipc/ipc_tests.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" diff --git a/printing/pdf_ps_metafile_cairo.cc b/printing/pdf_ps_metafile_cairo.cc index 47f4c14..798ee16 100644 --- a/printing/pdf_ps_metafile_cairo.cc +++ b/printing/pdf_ps_metafile_cairo.cc @@ -70,6 +70,11 @@ void DestroyContextData(void* data) { namespace printing { +PdfPsMetafile::PdfPsMetafile() + : format_(PDF), + surface_(NULL), context_(NULL) { +} + PdfPsMetafile::PdfPsMetafile(const FileFormat& format) : format_(format), surface_(NULL), context_(NULL) { diff --git a/printing/pdf_ps_metafile_cairo.h b/printing/pdf_ps_metafile_cairo.h index 7a7b470..e56b64c 100644 --- a/printing/pdf_ps_metafile_cairo.h +++ b/printing/pdf_ps_metafile_cairo.h @@ -29,6 +29,8 @@ class PdfPsMetafile { PS, }; + PdfPsMetafile(); + // In the renderer process, callers should also call Init(void) to see if the // metafile can obtain all necessary rendering resources. // In the browser process, callers should also call Init(const void*, uint32) |