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

Unified Diff: net/quic/quic_ack_notifier_manager.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_ack_notifier_manager.h ('k') | net/quic/quic_ack_notifier_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_ack_notifier_manager.cc
diff --git a/net/quic/quic_ack_notifier_manager.cc b/net/quic/quic_ack_notifier_manager.cc
deleted file mode 100644
index 73e3c8e1c2ac87692fb8dc1e4256d95c67d7d9f8..0000000000000000000000000000000000000000
--- a/net/quic/quic_ack_notifier_manager.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/quic_ack_notifier_manager.h"
-
-#include <stddef.h>
-#include <list>
-#include <map>
-#include <utility>
-#include <vector>
-
-#include "base/stl_util.h"
-#include "net/quic/quic_ack_notifier.h"
-#include "net/quic/quic_flags.h"
-#include "net/quic/quic_protocol.h"
-
-namespace net {
-
-AckNotifierManager::AckNotifierManager() {}
-
-AckNotifierManager::~AckNotifierManager() {
- for (const auto& pair : ack_notifier_map_) {
- for (QuicAckNotifier* notifier : pair.second) {
- if (notifier->OnPacketAbandoned()) {
- delete notifier;
- }
- }
- }
-}
-
-void AckNotifierManager::OnPacketAcked(QuicPacketSequenceNumber sequence_number,
- QuicTime::Delta delta_largest_observed) {
- // Inform all the registered AckNotifiers of the new ACK.
- auto map_it = ack_notifier_map_.find(sequence_number);
- if (map_it == ack_notifier_map_.end()) {
- // No AckNotifier is interested in this sequence number.
- return;
- }
-
- // One or more AckNotifiers are registered as interested in this sequence
- // number. Iterate through them and call OnAck on each.
- for (QuicAckNotifier* ack_notifier : map_it->second) {
- if (ack_notifier->OnAck(delta_largest_observed)) {
- // If this has resulted in an empty AckNotifer, erase it.
- delete ack_notifier;
- }
- }
-
- // Remove the sequence number from the map as we have notified all the
- // registered AckNotifiers, and we won't see it again.
- ack_notifier_map_.erase(map_it);
-}
-
-void AckNotifierManager::OnPacketRetransmitted(
- QuicPacketSequenceNumber old_sequence_number,
- QuicPacketSequenceNumber new_sequence_number,
- int packet_payload_size) {
- auto map_it = ack_notifier_map_.find(old_sequence_number);
- if (map_it == ack_notifier_map_.end()) {
- // No AckNotifiers are interested in the old sequence number.
- return;
- }
-
- // Update the existing QuicAckNotifiers to the new sequence number.
- AckNotifierList& ack_notifier_list = map_it->second;
- for (QuicAckNotifier* ack_notifier : ack_notifier_list) {
- ack_notifier->OnPacketRetransmitted(packet_payload_size);
- }
-
- // The old sequence number is no longer of interest, copy the updated
- // AckNotifiers to the new sequence number before deleting the old.
- ack_notifier_map_[new_sequence_number] = ack_notifier_list;
- ack_notifier_map_.erase(map_it);
-}
-
-void AckNotifierManager::OnSerializedPacket(
- const SerializedPacket& serialized_packet) {
- if (FLAGS_quic_attach_ack_notifiers_to_packets) {
- // Inform each attached AckNotifier of the packet's serialization.
- AckNotifierList& notifier_list =
- ack_notifier_map_[serialized_packet.sequence_number];
- for (QuicAckNotifier* notifier : serialized_packet.notifiers) {
- if (notifier == nullptr) {
- LOG(DFATAL) << "AckNotifier should not be nullptr.";
- continue;
- }
- notifier->OnSerializedPacket();
-
- // Update the mapping in the other direction, from sequence number to
- // AckNotifier.
- notifier_list.push_back(notifier);
- }
- } else {
- // AckNotifiers can only be attached to retransmittable frames.
- RetransmittableFrames* frames = serialized_packet.retransmittable_frames;
- if (frames == nullptr) {
- return;
- }
-
- // For each frame in |serialized_packet|, inform any attached AckNotifiers
- // of the packet's sequence number.
- for (const QuicFrame& quic_frame : frames->frames()) {
- if (quic_frame.type != STREAM_FRAME ||
- quic_frame.stream_frame->notifier == nullptr) {
- continue;
- }
-
- QuicAckNotifier* notifier = quic_frame.stream_frame->notifier;
- notifier->OnSerializedPacket();
-
- // Update the mapping in the other direction, from sequence number to
- // AckNotifier.
- ack_notifier_map_[serialized_packet.sequence_number].push_back(notifier);
- }
- }
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_ack_notifier_manager.h ('k') | net/quic/quic_ack_notifier_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698