summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_message_utils.h
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-24 21:22:33 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-24 21:22:33 +0000
commit1e86aa6ec38166adb003fc6359c0fe85f63a71c9 (patch)
tree303c4af9f350ff1bb664db512e94f5e6a0cb2824 /chrome/common/ipc_message_utils.h
parent63c2ba2fbc2d1aa1516a6c023d111ab86f0f4acc (diff)
downloadchromium_src-1e86aa6ec38166adb003fc6359c0fe85f63a71c9.zip
chromium_src-1e86aa6ec38166adb003fc6359c0fe85f63a71c9.tar.gz
chromium_src-1e86aa6ec38166adb003fc6359c0fe85f63a71c9.tar.bz2
Add a gcc warning if we don't check the results of ReadParam. Some
of the buildbots noticed that we weren't checking the results when generating log output. AGL gets the credit for tracking this down. Review URL: http://codereview.chromium.org/93126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_message_utils.h')
-rw-r--r--chrome/common/ipc_message_utils.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index 8e4e8a5..3438e52 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -121,7 +121,8 @@ static inline void WriteParam(Message* m, const P& p) {
}
template <class P>
-static inline bool ReadParam(const Message* m, void** iter, P* p) {
+static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter,
+ P* p) {
return ParamTraits<P>::Read(m, iter, p);
}
@@ -1267,8 +1268,8 @@ class MessageWithReply : public SyncMessage {
if (msg->is_sync()) {
SendParam p;
void* iter = SyncMessage::GetDataIterator(msg);
- ReadParam(msg, &iter, &p);
- LogParam(p, l);
+ if (ReadParam(msg, &iter, &p))
+ LogParam(p, l);
#if defined(IPC_MESSAGE_LOG_ENABLED)
const std::wstring& output_params = msg->output_params();
@@ -1282,8 +1283,8 @@ class MessageWithReply : public SyncMessage {
// can finally log the message.
typename ReplyParam::ValueTuple p;
void* iter = SyncMessage::GetDataIterator(msg);
- ReadParam(msg, &iter, &p);
- LogParam(p, l);
+ if (ReadParam(msg, &iter, &p))
+ LogParam(p, l);
}
}