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

Side by Side Diff: media/cast/receiver/frame_receiver.cc

Issue 1684793003: Add comments for struct members that were changed from size_t to uin32_t or uint64_t for IPC safety. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
« no previous file with comments | « media/cast/net/pacing/paced_sender.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "media/cast/receiver/frame_receiver.h" 5 #include "media/cast/receiver/frame_receiver.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/numerics/safe_conversions.h"
14 #include "media/cast/cast_config.h" 15 #include "media/cast/cast_config.h"
15 #include "media/cast/cast_defines.h" 16 #include "media/cast/cast_defines.h"
16 #include "media/cast/cast_environment.h" 17 #include "media/cast/cast_environment.h"
17 #include "media/cast/constants.h" 18 #include "media/cast/constants.h"
18 #include "media/cast/net/rtcp/rtcp_utility.h" 19 #include "media/cast/net/rtcp/rtcp_utility.h"
19 20
20 namespace { 21 namespace {
21 22
22 const int kMinSchedulingDelayMs = 1; 23 const int kMinSchedulingDelayMs = 1;
23 24
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 rtp_header.rtp_timestamp; 123 rtp_header.rtp_timestamp;
123 124
124 scoped_ptr<PacketEvent> receive_event(new PacketEvent()); 125 scoped_ptr<PacketEvent> receive_event(new PacketEvent());
125 receive_event->timestamp = now; 126 receive_event->timestamp = now;
126 receive_event->type = PACKET_RECEIVED; 127 receive_event->type = PACKET_RECEIVED;
127 receive_event->media_type = event_media_type_; 128 receive_event->media_type = event_media_type_;
128 receive_event->rtp_timestamp = rtp_header.rtp_timestamp; 129 receive_event->rtp_timestamp = rtp_header.rtp_timestamp;
129 receive_event->frame_id = rtp_header.frame_id; 130 receive_event->frame_id = rtp_header.frame_id;
130 receive_event->packet_id = rtp_header.packet_id; 131 receive_event->packet_id = rtp_header.packet_id;
131 receive_event->max_packet_id = rtp_header.max_packet_id; 132 receive_event->max_packet_id = rtp_header.max_packet_id;
132 receive_event->size = payload_size; 133 receive_event->size = base::checked_cast<uint32_t>(payload_size);
133 cast_environment_->logger()->DispatchPacketEvent(std::move(receive_event)); 134 cast_environment_->logger()->DispatchPacketEvent(std::move(receive_event));
134 135
135 bool duplicate = false; 136 bool duplicate = false;
136 const bool complete = 137 const bool complete =
137 framer_.InsertPacket(payload_data, payload_size, rtp_header, &duplicate); 138 framer_.InsertPacket(payload_data, payload_size, rtp_header, &duplicate);
138 139
139 // Duplicate packets are ignored. 140 // Duplicate packets are ignored.
140 if (duplicate) 141 if (duplicate)
141 return; 142 return;
142 143
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 const base::TimeTicks now = cast_environment_->Clock()->NowTicks(); 350 const base::TimeTicks now = cast_environment_->Clock()->NowTicks();
350 RtpReceiverStatistics stats = stats_.GetStatistics(); 351 RtpReceiverStatistics stats = stats_.GetStatistics();
351 transport_->SendRtcpFromRtpReceiver(rtcp_.local_ssrc(), rtcp_.remote_ssrc(), 352 transport_->SendRtcpFromRtpReceiver(rtcp_.local_ssrc(), rtcp_.remote_ssrc(),
352 CreateRtcpTimeData(now), NULL, 353 CreateRtcpTimeData(now), NULL,
353 base::TimeDelta(), NULL, &stats); 354 base::TimeDelta(), NULL, &stats);
354 ScheduleNextRtcpReport(); 355 ScheduleNextRtcpReport();
355 } 356 }
356 357
357 } // namespace cast 358 } // namespace cast
358 } // namespace media 359 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/pacing/paced_sender.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698