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

Unified Diff: net/quic/quic_buffered_packet_store.cc

Issue 2099313003: Change QuicBufferedPacketStore to store QuicReceivedPackets instead of QuicEncrypterPackets, since … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@125727775
Patch Set: Created 4 years, 6 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_buffered_packet_store.h ('k') | net/quic/quic_buffered_packet_store_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_buffered_packet_store.cc
diff --git a/net/quic/quic_buffered_packet_store.cc b/net/quic/quic_buffered_packet_store.cc
index 75522771fdbc0a958ef9d54ba77a27f86ce4d43d..5d6b880568445a6864889c084308e1a26f5b62a4 100644
--- a/net/quic/quic_buffered_packet_store.cc
+++ b/net/quic/quic_buffered_packet_store.cc
@@ -8,6 +8,8 @@
#include "base/stl_util.h"
+using std::list;
+
namespace net {
typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket;
@@ -37,7 +39,7 @@ class ConnectionExpireAlarm : public QuicAlarm::Delegate {
} // namespace
-BufferedPacket::BufferedPacket(std::unique_ptr<QuicEncryptedPacket> packet,
+BufferedPacket::BufferedPacket(std::unique_ptr<QuicReceivedPacket> packet,
IPEndPoint server_address,
IPEndPoint client_address)
: packet(std::move(packet)),
@@ -61,7 +63,7 @@ BufferedPacketList::~BufferedPacketList() {}
QuicBufferedPacketStore::QuicBufferedPacketStore(
VisitorInterface* visitor,
- QuicClock* clock,
+ const QuicClock* clock,
QuicAlarmFactory* alarm_factory)
: connection_life_span_(
QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs)),
@@ -74,7 +76,7 @@ QuicBufferedPacketStore::~QuicBufferedPacketStore() {}
EnqueuePacketResult QuicBufferedPacketStore::EnqueuePacket(
QuicConnectionId connection_id,
- const QuicEncryptedPacket& packet,
+ const QuicReceivedPacket& packet,
IPEndPoint server_address,
IPEndPoint client_address) {
if (!ContainsKey(undecryptable_packets_, connection_id) &&
@@ -101,7 +103,7 @@ EnqueuePacketResult QuicBufferedPacketStore::EnqueuePacket(
queue.creation_time = clock_->ApproximateNow();
}
- BufferedPacket new_entry(std::unique_ptr<QuicEncryptedPacket>(packet.Clone()),
+ BufferedPacket new_entry(std::unique_ptr<QuicReceivedPacket>(packet.Clone()),
server_address, client_address);
queue.buffered_packets.push_back(std::move(new_entry));
@@ -112,9 +114,14 @@ EnqueuePacketResult QuicBufferedPacketStore::EnqueuePacket(
return SUCCESS;
}
-std::list<BufferedPacket> QuicBufferedPacketStore::DeliverPackets(
+bool QuicBufferedPacketStore::HasBufferedPackets(
+ QuicConnectionId connection_id) const {
+ return ContainsKey(undecryptable_packets_, connection_id);
+}
+
+list<BufferedPacket> QuicBufferedPacketStore::DeliverPackets(
QuicConnectionId connection_id) {
- std::list<BufferedPacket> packets_to_deliver;
+ list<BufferedPacket> packets_to_deliver;
auto it = undecryptable_packets_.find(connection_id);
if (it != undecryptable_packets_.end()) {
packets_to_deliver = std::move(it->second.buffered_packets);
« no previous file with comments | « net/quic/quic_buffered_packet_store.h ('k') | net/quic/quic_buffered_packet_store_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698