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

Unified Diff: net/tools/quic/test_tools/packet_dropping_test_writer.cc

Issue 1660533002: Landing Recent QUIC changes until 01/26/2016 18:14 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/tools/quic/test_tools/packet_dropping_test_writer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/packet_dropping_test_writer.cc
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.cc b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
index 50c0aa6b3a934fb53bb3842064afa2821d7b1b0a..36b886da1ac38b5f3103c6e72245547bd800357f 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.cc
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.cc
@@ -74,7 +74,8 @@ WriteResult PacketDroppingTestWriter::WritePacket(
const char* buffer,
size_t buf_len,
const net::IPAddressNumber& self_address,
- const net::IPEndPoint& peer_address) {
+ const net::IPEndPoint& peer_address,
+ PerPacketOptions* options) {
++num_calls_to_write_;
ReleaseOldPackets();
@@ -121,8 +122,13 @@ WriteResult PacketDroppingTestWriter::WritePacket(
? send_time.Add(bandwidth_delay)
: delayed_packets_.back().send_time.Add(bandwidth_delay);
}
+ std::unique_ptr<PerPacketOptions> delayed_options;
+ if (options != nullptr) {
+ delayed_options.reset(options->Clone());
+ }
delayed_packets_.push_back(
- DelayedWrite(buffer, buf_len, self_address, peer_address, send_time));
+ DelayedWrite(buffer, buf_len, self_address, peer_address,
+ std::move(delayed_options), send_time));
cur_buffer_size_ += buf_len;
// Set the alarm if it's not yet set.
@@ -134,7 +140,7 @@ WriteResult PacketDroppingTestWriter::WritePacket(
}
return QuicPacketWriterWrapper::WritePacket(buffer, buf_len, self_address,
- peer_address);
+ peer_address, options);
}
bool PacketDroppingTestWriter::IsWriteBlocked() const {
@@ -172,9 +178,9 @@ QuicTime PacketDroppingTestWriter::ReleaseNextPacket() {
DVLOG(1) << "Releasing packet. " << (delayed_packets_.size() - 1)
<< " remaining.";
// Grab the next one off the queue and send it.
- QuicPacketWriterWrapper::WritePacket(iter->buffer.data(),
- iter->buffer.length(),
- iter->self_address, iter->peer_address);
+ QuicPacketWriterWrapper::WritePacket(
+ iter->buffer.data(), iter->buffer.length(), iter->self_address,
+ iter->peer_address, iter->options.get());
DCHECK_GE(cur_buffer_size_, iter->buffer.length());
cur_buffer_size_ -= iter->buffer.length();
delayed_packets_.erase(iter);
@@ -206,12 +212,25 @@ PacketDroppingTestWriter::DelayedWrite::DelayedWrite(
size_t buf_len,
const net::IPAddressNumber& self_address,
const net::IPEndPoint& peer_address,
+ std::unique_ptr<PerPacketOptions> options,
QuicTime send_time)
: buffer(buffer, buf_len),
self_address(self_address),
peer_address(peer_address),
+ options(std::move(options)),
send_time(send_time) {}
+// TODO(rtenneti): on windows RValue reference gives errors.
+PacketDroppingTestWriter::DelayedWrite::DelayedWrite(
+ PacketDroppingTestWriter::DelayedWrite&& other) = default;
+
+// TODO(rtenneti): on windows RValue reference gives errors.
+// IPAddressNumber has no move assignment operator.
+//
+// PacketDroppingTestWriter::DelayedWrite&
+// PacketDroppingTestWriter::DelayedWrite::operator=(
+// PacketDroppingTestWriter::DelayedWrite&& other) = default;
+
PacketDroppingTestWriter::DelayedWrite::~DelayedWrite() {}
} // namespace test
« no previous file with comments | « net/tools/quic/test_tools/packet_dropping_test_writer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698