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

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

Issue 1248683002: Revert of relnote: Protect against a QUIC crash bug but logging a DFATAL and (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_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.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 (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_generator.h" 5 #include "net/quic/quic_packet_generator.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/quic/quic_ack_notifier.h" 9 #include "net/quic/quic_ack_notifier.h"
10 #include "net/quic/quic_fec_group.h" 10 #include "net/quic/quic_fec_group.h"
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 if (success && debug_delegate_) { 450 if (success && debug_delegate_) {
451 debug_delegate_->OnFrameAddedToPacket(frame); 451 debug_delegate_->OnFrameAddedToPacket(frame);
452 } 452 }
453 return success; 453 return success;
454 } 454 }
455 455
456 void QuicPacketGenerator::SerializeAndSendPacket() { 456 void QuicPacketGenerator::SerializeAndSendPacket() {
457 char buffer[kMaxPacketSize]; 457 char buffer[kMaxPacketSize];
458 SerializedPacket serialized_packet = 458 SerializedPacket serialized_packet =
459 packet_creator_.SerializePacket(buffer, kMaxPacketSize); 459 packet_creator_.SerializePacket(buffer, kMaxPacketSize);
460 if (serialized_packet.packet == nullptr) { 460 DCHECK(serialized_packet.packet);
461 LOG(DFATAL) << "Failed to SerializePacket. fec_policy:" << fec_send_policy_
462 << " should_fec_protect_:" << should_fec_protect_;
463 delegate_->CloseConnection(QUIC_FAILED_TO_SERIALIZE_PACKET, false);
464 return;
465 }
466 461
467 // There may be AckNotifiers interested in this packet. 462 // There may be AckNotifiers interested in this packet.
468 serialized_packet.notifiers.swap(ack_notifiers_); 463 serialized_packet.notifiers.swap(ack_notifiers_);
469 ack_notifiers_.clear(); 464 ack_notifiers_.clear();
470 465
471 delegate_->OnSerializedPacket(serialized_packet); 466 delegate_->OnSerializedPacket(serialized_packet);
472 MaybeSendFecPacketAndCloseGroup(/*force=*/false, /*is_fec_timeout=*/false); 467 MaybeSendFecPacketAndCloseGroup(/*force=*/false, /*is_fec_timeout=*/false);
473 468
474 // Maximum packet size may be only enacted while no packet is currently being 469 // Maximum packet size may be only enacted while no packet is currently being
475 // constructed, so here we have a good opportunity to actually change it. 470 // constructed, so here we have a good opportunity to actually change it.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) { 545 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) {
551 packet_creator_.set_encryption_level(level); 546 packet_creator_.set_encryption_level(level);
552 } 547 }
553 548
554 void QuicPacketGenerator::SetEncrypter(EncryptionLevel level, 549 void QuicPacketGenerator::SetEncrypter(EncryptionLevel level,
555 QuicEncrypter* encrypter) { 550 QuicEncrypter* encrypter) {
556 packet_creator_.SetEncrypter(level, encrypter); 551 packet_creator_.SetEncrypter(level, encrypter);
557 } 552 }
558 553
559 } // namespace net 554 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698