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

Side by Side Diff: chrome/browser/media/webrtc_rtp_dump_writer.cc

Issue 1485023003: Misc truncation fixes for gn builds with VS 2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes to four more components/content files 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
« no previous file with comments | « no previous file | chrome/test/chromedriver/key_converter_unittest.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 "chrome/browser/media/webrtc_rtp_dump_writer.h" 5 #include "chrome/browser/media/webrtc_rtp_dump_writer.h"
6 6
7 #include "base/big_endian.h" 7 #include "base/big_endian.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 WriteRtpDumpFileHeaderBigEndian(start_time_, dest_buffer); 299 WriteRtpDumpFileHeaderBigEndian(start_time_, dest_buffer);
300 } 300 }
301 301
302 size_t packet_dump_length = kPacketDumpHeaderSize + header_length; 302 size_t packet_dump_length = kPacketDumpHeaderSize + header_length;
303 303
304 // Flushes the buffer to disk if the buffer is full. 304 // Flushes the buffer to disk if the buffer is full.
305 if (dest_buffer->size() + packet_dump_length > dest_buffer->capacity()) 305 if (dest_buffer->size() + packet_dump_length > dest_buffer->capacity())
306 FlushBuffer(incoming, false, FlushDoneCallback()); 306 FlushBuffer(incoming, false, FlushDoneCallback());
307 307
308 WritePacketDumpHeaderBigEndian( 308 WritePacketDumpHeaderBigEndian(
309 start_time_, packet_dump_length, packet_length, dest_buffer); 309 start_time_, base::checked_cast<uint16>(packet_dump_length),
310 base::checked_cast<uint16>(packet_length), dest_buffer);
310 311
311 // Writes the actual RTP packet header. 312 // Writes the actual RTP packet header.
312 AppendToBuffer(packet_header, header_length, dest_buffer); 313 AppendToBuffer(packet_header, header_length, dest_buffer);
313 } 314 }
314 315
315 void WebRtcRtpDumpWriter::EndDump(RtpDumpType type, 316 void WebRtcRtpDumpWriter::EndDump(RtpDumpType type,
316 const EndDumpCallback& finished_callback) { 317 const EndDumpCallback& finished_callback) {
317 DCHECK(thread_checker_.CalledOnValidThread()); 318 DCHECK(thread_checker_.CalledOnValidThread());
318 DCHECK(type == RTP_DUMP_OUTGOING || incoming_file_thread_worker_ != NULL); 319 DCHECK(type == RTP_DUMP_OUTGOING || incoming_file_thread_worker_ != NULL);
319 DCHECK(type == RTP_DUMP_INCOMING || outgoing_file_thread_worker_ != NULL); 320 DCHECK(type == RTP_DUMP_INCOMING || outgoing_file_thread_worker_ != NULL);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 base::Bind(&WebRtcRtpDumpWriter::OnDumpEnded, 438 base::Bind(&WebRtcRtpDumpWriter::OnDumpEnded,
438 weak_ptr_factory_.GetWeakPtr(), 439 weak_ptr_factory_.GetWeakPtr(),
439 context, 440 context,
440 false)); 441 false));
441 return; 442 return;
442 } 443 }
443 444
444 // This object might be deleted after running the callback. 445 // This object might be deleted after running the callback.
445 context.callback.Run(context.incoming_succeeded, context.outgoing_succeeded); 446 context.callback.Run(context.incoming_succeeded, context.outgoing_succeeded);
446 } 447 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/chromedriver/key_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698