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

Side by Side Diff: media/cast/net/pacing/paced_sender.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/logging/logging_defines.h ('k') | media/cast/receiver/frame_receiver.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/net/pacing/paced_sender.h" 5 #include "media/cast/net/pacing/paced_sender.h"
6 6
7 #include "base/big_endian.h" 7 #include "base/big_endian.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/debug/dump_without_crashing.h" 9 #include "base/debug/dump_without_crashing.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/numerics/safe_conversions.h"
11 12
12 namespace media { 13 namespace media {
13 namespace cast { 14 namespace cast {
14 15
15 namespace { 16 namespace {
16 17
17 static const int64_t kPacingIntervalMs = 10; 18 static const int64_t kPacingIntervalMs = 10;
18 // Each frame will be split into no more than kPacingMaxBurstsPerFrame 19 // Each frame will be split into no more than kPacingMaxBurstsPerFrame
19 // bursts of packets. 20 // bursts of packets.
20 static const size_t kPacingMaxBurstsPerFrame = 3; 21 static const size_t kPacingMaxBurstsPerFrame = 3;
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 event.rtp_timestamp = last_logged_video_rtp_timestamp_ = 348 event.rtp_timestamp = last_logged_video_rtp_timestamp_ =
348 last_logged_video_rtp_timestamp_.Expand(truncated_rtp_timestamp); 349 last_logged_video_rtp_timestamp_.Expand(truncated_rtp_timestamp);
349 event.media_type = VIDEO_EVENT; 350 event.media_type = VIDEO_EVENT;
350 } else { 351 } else {
351 DVLOG(3) << "Got unknown ssrc " << ssrc << " when logging packet event"; 352 DVLOG(3) << "Got unknown ssrc " << ssrc << " when logging packet event";
352 return; 353 return;
353 } 354 }
354 success &= reader.Skip(2); 355 success &= reader.Skip(2);
355 success &= reader.ReadU16(&event.packet_id); 356 success &= reader.ReadU16(&event.packet_id);
356 success &= reader.ReadU16(&event.max_packet_id); 357 success &= reader.ReadU16(&event.max_packet_id);
357 event.size = packet.size(); 358 event.size = base::checked_cast<uint32_t>(packet.size());
358 DCHECK(success); 359 DCHECK(success);
359 } 360 }
360 361
361 } // namespace cast 362 } // namespace cast
362 } // namespace media 363 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/logging/logging_defines.h ('k') | media/cast/receiver/frame_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698