Chromium Code Reviews| Index: chrome/common/cast_messages.h |
| diff --git a/chrome/common/cast_messages.h b/chrome/common/cast_messages.h |
| index e10717189ffb17db6e5995c88eaab3e9ced5e578..35f985433c7fa15f2231ac750508d3d739587b94 100644 |
| --- a/chrome/common/cast_messages.h |
| +++ b/chrome/common/cast_messages.h |
| @@ -3,15 +3,52 @@ |
| // found in the LICENSE file. |
| // IPC messages for the Cast transport API. |
| -// Multiply-included message file, hence no include guard. |
| #include "ipc/ipc_message_macros.h" |
| #include "media/cast/cast_sender.h" |
| +#include "media/cast/common/rtp_time.h" |
| #include "media/cast/logging/logging_defines.h" |
| #include "media/cast/net/cast_transport_sender.h" |
| #include "media/cast/net/rtcp/rtcp_defines.h" |
| #include "net/base/ip_endpoint.h" |
| +#ifndef CHROME_COMMON_CAST_MESSAGES_H_ |
| +#define CHROME_COMMON_CAST_MESSAGES_H_ |
| + |
| +namespace IPC { |
| + |
| +template<> |
| +struct ParamTraits<media::cast::RtpTimeTicks> { |
|
Mike West
2015/12/10 08:54:46
Please don't inline the definitions of these metho
miu
2015/12/11 23:00:28
Done.
|
| + using param_type = media::cast::RtpTimeTicks; |
| + |
| + static void Write(Message* m, const param_type& p) { |
| + auto serialized = p.SerializeForIPC(); |
|
Mike West
2015/12/10 08:54:46
Why `auto` and not `uint64_t`? I'd prefer clarity.
miu
2015/12/11 23:00:28
Done. I was originally flip-flopping between repr
|
| + ParamTraits<decltype(serialized)>::Write(m, serialized); |
| + } |
| + |
| + static bool Read(const Message* m, base::PickleIterator* iter, |
| + param_type* r) { |
| + decltype(r->SerializeForIPC()) serialized; |
| + if (ParamTraits<decltype(serialized)>::Read(m, iter, &serialized)) { |
| + *r = param_type::DeserializeForIPC(serialized); |
| + return true; |
| + } |
| + return false; |
| + } |
| + |
| + static void Log(const param_type& p, std::string* l) { |
| + std::ostringstream oss; |
| + oss << p; |
| + l->append(oss.str()); |
| + } |
| +}; |
| + |
| +} // namespace IPC |
| + |
| +#endif // CHROME_COMMON_CAST_MESSAGES_H_ |
| + |
| +// Multiply-included message file, hence no include guard from here. |
| + |
| #undef IPC_MESSAGE_EXPORT |
| #define IPC_MESSAGE_EXPORT |
| #define IPC_MESSAGE_START CastMsgStart |
| @@ -161,7 +198,7 @@ IPC_MESSAGE_CONTROL4( |
| int32 /* channel_id */, |
| uint32 /* ssrc */, |
| base::TimeTicks /* current_time */, |
| - uint32 /* current_time_as_rtp_timestamp */) |
| + media::cast::RtpTimeTicks /* current_time_as_rtp_timestamp */) |
| IPC_MESSAGE_CONTROL3( |
| CastHostMsg_CancelSendingFrames, |