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

Unified Diff: net/quic/quic_received_packet_manager.cc

Issue 2125303002: Use overloaded operators with QuicTime for addition, subtraction and scalar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126402784
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_protocol_test.cc ('k') | net/quic/quic_received_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_received_packet_manager.cc
diff --git a/net/quic/quic_received_packet_manager.cc b/net/quic/quic_received_packet_manager.cc
index 73226a1d245c473549d83580bca964427901323f..4ce6945ff2390018317dc25f4876dd1121365fd7 100644
--- a/net/quic/quic_received_packet_manager.cc
+++ b/net/quic/quic_received_packet_manager.cc
@@ -175,7 +175,7 @@ void QuicReceivedPacketManager::RecordPacketReceived(
max(stats_->max_sequence_reordering,
ack_frame_.largest_observed - packet_number);
int64_t reordering_time_us =
- receipt_time.Subtract(time_largest_observed_).ToMicroseconds();
+ (receipt_time - time_largest_observed_).ToMicroseconds();
stats_->max_time_reordering_us =
max(stats_->max_time_reordering_us, reordering_time_us);
}
@@ -231,10 +231,9 @@ const QuicFrame QuicReceivedPacketManager::GetUpdatedAckFrame(
ack_frame_.ack_delay_time = QuicTime::Delta::Infinite();
} else {
// Ensure the delta is zero if approximate now is "in the past".
- ack_frame_.ack_delay_time =
- approximate_now < time_largest_observed_
- ? QuicTime::Delta::Zero()
- : approximate_now.Subtract(time_largest_observed_);
+ ack_frame_.ack_delay_time = approximate_now < time_largest_observed_
+ ? QuicTime::Delta::Zero()
+ : approximate_now - time_largest_observed_;
}
// Clear all packet times if any are too far from largest observed.
« no previous file with comments | « net/quic/quic_protocol_test.cc ('k') | net/quic/quic_received_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698