summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 18:02:03 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 18:02:03 +0000
commit6edce23f84fe2b88e4dfe8e101b05e60a3646b80 (patch)
tree5a7ad67cc6f35469d5abab6090fcbd7424da91ba
parenta31c66d79a124782bbaa16870bffbc83bdb639f8 (diff)
downloadchromium_src-6edce23f84fe2b88e4dfe8e101b05e60a3646b80.zip
chromium_src-6edce23f84fe2b88e4dfe8e101b05e60a3646b80.tar.gz
chromium_src-6edce23f84fe2b88e4dfe8e101b05e60a3646b80.tar.bz2
FBTF: Reapplies r55259, the first new IPC definition patch.
This moves MessageWithTuple::Read() back into the main ipc_message_utils.h header from the private ipc_messsage_utils_impl.h header. In release mode, this was causing link failures. BUG=51411 TEST=none Review URL: http://codereview.chromium.org/3069034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55587 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/tuple.h264
-rw-r--r--chrome/browser/importer/firefox_importer_unittest_utils_mac.cc7
-rw-r--r--chrome/browser/importer/importer_messages.cc11
-rw-r--r--chrome/chrome.gyp1
-rw-r--r--chrome/chrome_browser.gypi7
-rw-r--r--chrome/chrome_common.gypi10
-rw-r--r--chrome/common/common_param_traits.h3
-rw-r--r--chrome/common/devtools_messages.cc9
-rw-r--r--chrome/common/gpu_messages.cc9
-rw-r--r--chrome/common/nacl_messages.cc9
-rw-r--r--chrome/common/nacl_messages_internal.h1
-rw-r--r--chrome/common/plugin_messages.cc9
-rw-r--r--chrome/common/render_messages.cc12
-rw-r--r--chrome/common/render_messages_internal.h5
-rw-r--r--chrome/common/service_messages.cc9
-rw-r--r--chrome/common/utility_messages.cc9
-rw-r--r--chrome/common/worker_messages.cc9
-rw-r--r--chrome/test/automation/automation_messages.cc9
-rw-r--r--ipc/ipc_fuzzing_tests.cc1
-rw-r--r--ipc/ipc_message_impl_macros.h304
-rw-r--r--ipc/ipc_message_macros.h281
-rw-r--r--ipc/ipc_message_utils.cc18
-rw-r--r--ipc/ipc_message_utils.h54
-rw-r--r--ipc/ipc_message_utils_impl.h30
-rw-r--r--ipc/sync_socket_unittest.cc1
-rw-r--r--printing/pdf_ps_metafile_cairo.cc5
-rw-r--r--printing/pdf_ps_metafile_cairo.h2
27 files changed, 863 insertions, 226 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/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/chrome.gyp b/chrome/chrome.gyp
index b450fcf..21c06da 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -1708,6 +1708,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 474482c..56b4c62 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1835,6 +1835,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',
@@ -2934,6 +2935,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 05c32be..c60359f 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,6 +262,7 @@
'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/socket_stream_dispatcher.cc',
@@ -271,6 +277,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',
@@ -284,6 +291,7 @@
'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.h b/chrome/common/common_param_traits.h
index 0ca6bed..f39c066 100644
--- a/chrome/common/common_param_traits.h
+++ b/chrome/common/common_param_traits.h
@@ -34,6 +34,7 @@ class DictionaryValue;
class ListValue;
struct ThumbnailScore;
class URLRequestStatus;
+class WebCursor;
namespace gfx {
class Point;
@@ -210,7 +211,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) {
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..598de69
--- /dev/null
+++ b/chrome/common/plugin_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/plugin_messages.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..68aa81d
--- /dev/null
+++ b/chrome/common/render_messages.cc
@@ -0,0 +1,12 @@
+// 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 "chrome/common/thumbnail_score.h"
+#include "webkit/glue/webcursor.h"
+
+#define MESSAGES_INTERNAL_IMPL_FILE \
+ "chrome/common/render_messages_internal.h"
+#include "ipc/ipc_message_impl_macros.h"
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index a9efdc8..95389c4 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -24,7 +24,6 @@
#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"
@@ -34,7 +33,6 @@
#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 +50,9 @@
// Substitution map for l10n messages.
typedef std::map<std::string, std::string> SubstitutionMap;
+struct ThumbnailScore;
+class WebCursor;
+
//-----------------------------------------------------------------------------
// RenderView messages
// These are messages sent from the browser to the renderer process.
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/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/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..f0adac5
--- /dev/null
+++ b/ipc/ipc_message_impl_macros.h
@@ -0,0 +1,304 @@
+// 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.
+//
+// Unlike ipc_message_macros.h, this file is only included once; it uses one
+// pass. But we *still* can't use normal include guards because we still need
+// to use the MESSAGES_INTERNAL_FILE dispatch system. Because that #define is
+// unset, we use the different name MESSAGES_INTERNAL_IMPL_FILE to tell this
+// file what to do.
+#ifndef IPC_IPC_MESSAGE_IMPL_MACROS_H_
+#define IPC_IPC_MESSAGE_IMPL_MACROS_H_
+
+#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)
+
+// 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)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \
+ msg_class::msg_class(const type1& arg1, const type2& arg2) \
+ : IPC::MessageWithTuple< Tuple2<type1, type2> >( \
+ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#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)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#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)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#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)) {} \
+ \
+ 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_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)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \
+ msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \
+ : IPC::MessageWithTuple< Tuple2<type1, type2> >( \
+ routing_id, ID, MakeRefTuple(arg1, arg2)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+
+#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)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#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)) {} \
+ \
+ msg_class::~msg_class() {} \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+#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)) {} \
+ \
+ msg_class::~msg_class() { } \
+ \
+ void msg_class::Log(const Message* msg, std::wstring* l) { \
+ Param p; \
+ if (Read(msg, &p)) \
+ IPC::LogParam(p, l); \
+ }
+
+// TODO(erg): Fill these in as I go along.
+#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class)
+#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out)
+#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in)
+#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out)
+#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in)
+#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out)
+#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out)
+#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out)
+#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class)
+#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out)
+#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in)
+#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out)
+#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out)
+#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in)
+#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out)
+#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in)
+#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out)
+#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in)
+#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out)
+#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out)
+#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in)
+#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out)
+#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out)
+#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out)
+
+// 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..3152871f 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,54 +791,56 @@ 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) \
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 41fbde7..7975faa 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -201,6 +201,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);
}
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 4667d4b..cdad102 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -18,7 +18,7 @@
#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
-#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "base/tuple.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
@@ -67,6 +67,13 @@ enum IPCMessageStart {
LastMsgIndex
};
+class DictionaryValue;
+class ListValue;
+
+namespace base {
+class Time;
+}
+
namespace IPC {
//-----------------------------------------------------------------------------
@@ -306,19 +313,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 +362,9 @@ struct ParamTraits<MSG> {
return result;
}
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<MSG>");
+ }
};
#endif // defined(OS_WIN)
@@ -1026,13 +1026,17 @@ 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);
+ // TODO(erg): Migrate this method into ipc_message_utils_impl.h once I figure
+ // out why just having the template in that file and the forward declaration
+ // here breaks the release build.
static bool Read(const Message* msg, Param* p) {
void* iter = NULL;
if (ReadParam(msg, &iter, p))
@@ -1111,12 +1115,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>
@@ -1189,7 +1187,7 @@ 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,
@@ -1216,7 +1214,7 @@ class MessageWithReply : public SyncMessage {
} else {
// This is an outgoing reply. Now that we have the output parameters, we
// can finally log the message.
- typename ReplyParam::ValueTuple p;
+ typename TupleTypes<ReplyParam>::ValueTuple p;
void* iter = SyncMessage::GetDataIterator(msg);
if (ReadParam(msg, &iter, &p))
LogParam(p, l);
@@ -1230,7 +1228,7 @@ class MessageWithReply : public SyncMessage {
Message* reply = GenerateReply(msg);
bool error;
if (ReadParam(msg, &iter, &send_params)) {
- typename ReplyParam::ValueTuple reply_params;
+ typename TupleTypes<ReplyParam>::ValueTuple reply_params;
DispatchToMethod(obj, func, send_params, &reply_params);
WriteParam(reply, reply_params);
error = false;
diff --git a/ipc/ipc_message_utils_impl.h b/ipc/ipc_message_utils_impl.h
new file mode 100644
index 0000000..ba11990
--- /dev/null
+++ b/ipc/ipc_message_utils_impl.h
@@ -0,0 +1,30 @@
+// 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);
+}
+
+// TODO(erg): Migrate MessageWithTuple<ParamType>::Read() here once I figure
+// out why having the definition here doesn't export the symbols.
+
+// 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.
+
+} // namespace IPC
+
+#endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_
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)