From 55b4e21b1acd4b82feb69017dfb65b5b74b070ba Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Fri, 13 Aug 2010 20:43:58 +0000 Subject: FBTF: Mark the Read methods in the IPC subsystem as noinline. This forces all the ReadParam template junk to expand once in the *_messages.cc file, instead of at every Read() call site. Without the compiler-specific annotation, this builds and links in debug mode, but doesn't link in release mode because the individual Read() methods generated were inlined into the subclass Log() methods, causing disaster on the release builders, but not on the trybots or locally. BUG=51411 TEST=none Review URL: http://codereview.chromium.org/3160008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56081 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc_message_utils_impl.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'ipc/ipc_message_utils_impl.h') diff --git a/ipc/ipc_message_utils_impl.h b/ipc/ipc_message_utils_impl.h index 53c7986..715df8f 100644 --- a/ipc/ipc_message_utils_impl.h +++ b/ipc/ipc_message_utils_impl.h @@ -18,8 +18,14 @@ MessageWithTuple::MessageWithTuple( WriteParam(this, p); } -// TODO(erg): Migrate MessageWithTuple::Read() here once I figure -// out why having the definition here doesn't export the symbols. +template +bool MessageWithTuple::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 @@ -35,8 +41,19 @@ MessageWithReply::MessageWithReply( WriteParam(this, send); } -// TODO(erg): Migrate ReadSendParam()/ReadReplyParam() here when we can force -// the visibility/linkage. +template +bool MessageWithReply::ReadSendParam( + const Message* msg, SendParam* p) { + void* iter = SyncMessage::GetDataIterator(msg); + return ReadParam(msg, &iter, p); +} + +template +bool MessageWithReply::ReadReplyParam( + const Message* msg, typename TupleTypes::ValueTuple* p) { + void* iter = SyncMessage::GetDataIterator(msg); + return ReadParam(msg, &iter, p); +} } // namespace IPC -- cgit v1.1