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

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

Issue 1246793002: 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 DCHECK(serialized_packet.packet); 460 if (serialized_packet.packet == nullptr) {
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 }
461 466
462 // There may be AckNotifiers interested in this packet. 467 // There may be AckNotifiers interested in this packet.
463 serialized_packet.notifiers.swap(ack_notifiers_); 468 serialized_packet.notifiers.swap(ack_notifiers_);
464 ack_notifiers_.clear(); 469 ack_notifiers_.clear();
465 470
466 delegate_->OnSerializedPacket(serialized_packet); 471 delegate_->OnSerializedPacket(serialized_packet);
467 MaybeSendFecPacketAndCloseGroup(/*force=*/false, /*is_fec_timeout=*/false); 472 MaybeSendFecPacketAndCloseGroup(/*force=*/false, /*is_fec_timeout=*/false);
468 473
469 // Maximum packet size may be only enacted while no packet is currently being 474 // Maximum packet size may be only enacted while no packet is currently being
470 // constructed, so here we have a good opportunity to actually change it. 475 // constructed, so here we have a good opportunity to actually change it.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) { 550 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) {
546 packet_creator_.set_encryption_level(level); 551 packet_creator_.set_encryption_level(level);
547 } 552 }
548 553
549 void QuicPacketGenerator::SetEncrypter(EncryptionLevel level, 554 void QuicPacketGenerator::SetEncrypter(EncryptionLevel level,
550 QuicEncrypter* encrypter) { 555 QuicEncrypter* encrypter) {
551 packet_creator_.SetEncrypter(level, encrypter); 556 packet_creator_.SetEncrypter(level, encrypter);
552 } 557 }
553 558
554 } // namespace net 559 } // 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