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

Unified Diff: net/quic/quic_packet_generator.cc

Issue 1525303003: Remove QuicPacketGenerator::OnSerializedPacket with functionality in QuicPacketCreator. No functio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110008813
Patch Set: get newly added files from upstream 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator.cc
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index c5d5f4a18e3f02f293b764388fbd6a64d0343cd6..d5d272f1adb7ae3c522ef2c98fcc7de3ae27ddd2 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -21,7 +21,7 @@ QuicPacketGenerator::QuicPacketGenerator(QuicConnectionId connection_id,
QuicRandom* random_generator,
DelegateInterface* delegate)
: delegate_(delegate),
- packet_creator_(connection_id, framer, random_generator, this),
+ packet_creator_(connection_id, framer, random_generator, delegate),
batch_mode_(false),
should_send_ack_(false),
should_send_stop_waiting_(false),
@@ -132,11 +132,9 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(
// A stream frame is created and added.
size_t bytes_consumed = frame.stream_frame->frame_length;
-
if (listener != nullptr) {
- ack_listeners_.push_back(AckListenerWrapper(listener, bytes_consumed));
+ packet_creator_.AddAckListener(listener, bytes_consumed);
}
-
total_bytes_consumed += bytes_consumed;
fin_consumed = fin && total_bytes_consumed == iov.total_length;
DCHECK(total_bytes_consumed == iov.total_length ||
@@ -192,7 +190,7 @@ void QuicPacketGenerator::GenerateMtuDiscoveryPacket(
SetMaxPacketLength(target_mtu, /*force=*/true);
const bool success = packet_creator_.AddPaddedSavedFrame(frame);
if (listener != nullptr) {
- ack_listeners_.push_back(AckListenerWrapper(listener, 0));
+ packet_creator_.AddAckListener(listener, 0);
}
packet_creator_.Flush();
// The only reason AddFrame can fail is that the packet is too full to fit in
@@ -376,35 +374,6 @@ void QuicPacketGenerator::SetEncrypter(EncryptionLevel level,
packet_creator_.SetEncrypter(level, encrypter);
}
-void QuicPacketGenerator::OnSerializedPacket(
- SerializedPacket* serialized_packet) {
- if (serialized_packet->packet == nullptr) {
- LOG(DFATAL) << "Failed to SerializePacket. fec_policy:" << fec_send_policy()
- << " should_fec_protect_:"
- << packet_creator_.should_fec_protect_next_packet();
- delegate_->CloseConnection(QUIC_FAILED_TO_SERIALIZE_PACKET, false);
- return;
- }
-
- // There may be AckListeners interested in this packet.
- serialized_packet->listeners.swap(ack_listeners_);
- ack_listeners_.clear();
-
- delegate_->OnSerializedPacket(*serialized_packet);
- packet_creator_.MaybeSendFecPacketAndCloseGroup(/*force_send_fec=*/false,
- /*is_fec_timeout=*/false);
-
- // Maximum packet size may be only enacted while no packet is currently being
- // constructed, so here we have a good opportunity to actually change it.
- if (packet_creator_.CanSetMaxPacketLength()) {
- packet_creator_.SetMaxPacketLength(max_packet_length_);
- }
-}
-
-void QuicPacketGenerator::OnResetFecGroup() {
- delegate_->OnResetFecGroup();
-}
-
void QuicPacketGenerator::SetCurrentPath(
QuicPathId path_id,
QuicPacketNumber least_packet_awaited_by_peer,
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698