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

Side by Side Diff: net/quic/quic_packet_creator.cc

Issue 1217273003: QUIC - debugging code to find crash in net::QuicPacket::FecProtectedData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « net/quic/quic_framer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/quic/quic_packet_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // packet sizes are properly used. 456 // packet sizes are properly used.
457 scoped_ptr<char[]> large_buffer; 457 scoped_ptr<char[]> large_buffer;
458 if (packet_size_ <= kMaxPacketSize) { 458 if (packet_size_ <= kMaxPacketSize) {
459 packet.reset( 459 packet.reset(
460 framer_->BuildDataPacket(header, queued_frames_, buffer, packet_size_)); 460 framer_->BuildDataPacket(header, queued_frames_, buffer, packet_size_));
461 } else { 461 } else {
462 large_buffer.reset(new char[packet_size_]); 462 large_buffer.reset(new char[packet_size_]);
463 packet.reset(framer_->BuildDataPacket(header, queued_frames_, 463 packet.reset(framer_->BuildDataPacket(header, queued_frames_,
464 large_buffer.get(), packet_size_)); 464 large_buffer.get(), packet_size_));
465 } 465 }
466 LOG_IF(DFATAL, packet == nullptr) << "Failed to serialize "
467 << queued_frames_.size() << " frames.";
468
466 OnBuiltFecProtectedPayload(header, packet->FecProtectedData()); 469 OnBuiltFecProtectedPayload(header, packet->FecProtectedData());
467 470
468 LOG_IF(DFATAL, packet == nullptr) << "Failed to serialize "
469 << queued_frames_.size() << " frames.";
470 // Because of possible truncation, we can't be confident that our 471 // Because of possible truncation, we can't be confident that our
471 // packet size calculation worked correctly. 472 // packet size calculation worked correctly.
472 if (!possibly_truncated_by_length) { 473 if (!possibly_truncated_by_length) {
473 DCHECK_EQ(packet_size_, packet->length()); 474 DCHECK_EQ(packet_size_, packet->length());
474 } 475 }
475 // Immediately encrypt the packet, to ensure we don't encrypt the same packet 476 // Immediately encrypt the packet, to ensure we don't encrypt the same packet
476 // sequence number multiple times. 477 // sequence number multiple times.
477 QuicEncryptedPacket* encrypted = 478 QuicEncryptedPacket* encrypted =
478 framer_->EncryptPayload(encryption_level_, sequence_number_, *packet, 479 framer_->EncryptPayload(encryption_level_, sequence_number_, *packet,
479 encrypted_buffer, encrypted_buffer_len); 480 encrypted_buffer, encrypted_buffer_len);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 // Don't pad full packets. 625 // Don't pad full packets.
625 return; 626 return;
626 } 627 }
627 628
628 QuicPaddingFrame padding; 629 QuicPaddingFrame padding;
629 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr); 630 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr);
630 DCHECK(success); 631 DCHECK(success);
631 } 632 }
632 633
633 } // namespace net 634 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_framer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698