Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: chrome/common/cast_messages.h

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes for cast_messages.h for chromeos cross-compiles. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // IPC messages for the Cast transport API. 5 // IPC messages for the Cast transport API.
6 // Multiply-included message file, hence no include guard.
7 6
8 #include "ipc/ipc_message_macros.h" 7 #include "ipc/ipc_message_macros.h"
9 #include "media/cast/cast_sender.h" 8 #include "media/cast/cast_sender.h"
9 #include "media/cast/common/rtp_time.h"
10 #include "media/cast/logging/logging_defines.h" 10 #include "media/cast/logging/logging_defines.h"
11 #include "media/cast/net/cast_transport_sender.h" 11 #include "media/cast/net/cast_transport_sender.h"
12 #include "media/cast/net/rtcp/rtcp_defines.h" 12 #include "media/cast/net/rtcp/rtcp_defines.h"
13 #include "net/base/ip_endpoint.h" 13 #include "net/base/ip_endpoint.h"
14 14
15 #ifndef CHROME_COMMON_CAST_MESSAGES_H_
16 #define CHROME_COMMON_CAST_MESSAGES_H_
17
18 namespace IPC {
19
20 template<>
21 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.
22 using param_type = media::cast::RtpTimeTicks;
23
24 static void Write(Message* m, const param_type& p) {
25 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
26 ParamTraits<decltype(serialized)>::Write(m, serialized);
27 }
28
29 static bool Read(const Message* m, base::PickleIterator* iter,
30 param_type* r) {
31 decltype(r->SerializeForIPC()) serialized;
32 if (ParamTraits<decltype(serialized)>::Read(m, iter, &serialized)) {
33 *r = param_type::DeserializeForIPC(serialized);
34 return true;
35 }
36 return false;
37 }
38
39 static void Log(const param_type& p, std::string* l) {
40 std::ostringstream oss;
41 oss << p;
42 l->append(oss.str());
43 }
44 };
45
46 } // namespace IPC
47
48 #endif // CHROME_COMMON_CAST_MESSAGES_H_
49
50 // Multiply-included message file, hence no include guard from here.
51
15 #undef IPC_MESSAGE_EXPORT 52 #undef IPC_MESSAGE_EXPORT
16 #define IPC_MESSAGE_EXPORT 53 #define IPC_MESSAGE_EXPORT
17 #define IPC_MESSAGE_START CastMsgStart 54 #define IPC_MESSAGE_START CastMsgStart
18 55
19 IPC_ENUM_TRAITS_MAX_VALUE( 56 IPC_ENUM_TRAITS_MAX_VALUE(
20 media::cast::EncodedFrame::Dependency, 57 media::cast::EncodedFrame::Dependency,
21 media::cast::EncodedFrame::DEPENDENCY_LAST) 58 media::cast::EncodedFrame::DEPENDENCY_LAST)
22 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::Codec, 59 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::Codec,
23 media::cast::CODEC_LAST) 60 media::cast::CODEC_LAST)
24 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::CastTransportStatus, 61 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::CastTransportStatus,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 CastHostMsg_InsertFrame, 191 CastHostMsg_InsertFrame,
155 int32 /* channel_id */, 192 int32 /* channel_id */,
156 uint32 /* ssrc */, 193 uint32 /* ssrc */,
157 media::cast::EncodedFrame /* audio/video frame */) 194 media::cast::EncodedFrame /* audio/video frame */)
158 195
159 IPC_MESSAGE_CONTROL4( 196 IPC_MESSAGE_CONTROL4(
160 CastHostMsg_SendSenderReport, 197 CastHostMsg_SendSenderReport,
161 int32 /* channel_id */, 198 int32 /* channel_id */,
162 uint32 /* ssrc */, 199 uint32 /* ssrc */,
163 base::TimeTicks /* current_time */, 200 base::TimeTicks /* current_time */,
164 uint32 /* current_time_as_rtp_timestamp */) 201 media::cast::RtpTimeTicks /* current_time_as_rtp_timestamp */)
165 202
166 IPC_MESSAGE_CONTROL3( 203 IPC_MESSAGE_CONTROL3(
167 CastHostMsg_CancelSendingFrames, 204 CastHostMsg_CancelSendingFrames,
168 int32 /* channel_id */, 205 int32 /* channel_id */,
169 uint32 /* ssrc */, 206 uint32 /* ssrc */,
170 std::vector<uint32> /* frame_ids */) 207 std::vector<uint32> /* frame_ids */)
171 208
172 IPC_MESSAGE_CONTROL3( 209 IPC_MESSAGE_CONTROL3(
173 CastHostMsg_ResendFrameForKickstart, 210 CastHostMsg_ResendFrameForKickstart,
174 int32 /* channel_id */, 211 int32 /* channel_id */,
(...skipping 13 matching lines...) Expand all
188 IPC_MESSAGE_CONTROL4( 225 IPC_MESSAGE_CONTROL4(
189 CastHostMsg_New, 226 CastHostMsg_New,
190 int32 /* channel_id */, 227 int32 /* channel_id */,
191 net::IPEndPoint /* local_end_point */, 228 net::IPEndPoint /* local_end_point */,
192 net::IPEndPoint /* remote_end_point */, 229 net::IPEndPoint /* remote_end_point */,
193 base::DictionaryValue /* options */) 230 base::DictionaryValue /* options */)
194 231
195 IPC_MESSAGE_CONTROL1( 232 IPC_MESSAGE_CONTROL1(
196 CastHostMsg_Delete, 233 CastHostMsg_Delete,
197 int32 /* channel_id */) 234 int32 /* channel_id */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698