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

Unified Diff: net/quic/quic_framer.cc

Issue 2130103002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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_flow_controller.cc ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.cc
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index 889e0705f185e0182e39b757559f9586271c7696..007a94724ad7dc62562912045b5368764af26405 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -1595,7 +1595,7 @@ bool QuicFramer::ProcessTimestampsInAckFrame(QuicDataReader* reader,
ack_frame->received_packet_times.reserve(num_received_packets);
ack_frame->received_packet_times.push_back(
- std::make_pair(seq_num, creation_time_.Add(last_timestamp_)));
+ std::make_pair(seq_num, creation_time_ + last_timestamp_));
for (uint8_t i = 1; i < num_received_packets; ++i) {
if (!reader->ReadBytes(&delta_from_largest_observed,
@@ -1614,10 +1614,10 @@ bool QuicFramer::ProcessTimestampsInAckFrame(QuicDataReader* reader,
return false;
}
- last_timestamp_ = last_timestamp_.Add(
- QuicTime::Delta::FromMicroseconds(incremental_time_delta_us));
+ last_timestamp_ = last_timestamp_ + QuicTime::Delta::FromMicroseconds(
+ incremental_time_delta_us);
ack_frame->received_packet_times.push_back(
- std::make_pair(seq_num, creation_time_.Add(last_timestamp_)));
+ std::make_pair(seq_num, creation_time_ + last_timestamp_));
}
}
return true;
@@ -2447,9 +2447,9 @@ bool QuicFramer::AppendTimestampToAckFrame(const QuicAckFrame& frame,
// Use the lowest 4 bytes of the time delta from the creation_time_.
const uint64_t time_epoch_delta_us = UINT64_C(1) << 32;
- uint32_t time_delta_us = static_cast<uint32_t>(
- it->second.Subtract(creation_time_).ToMicroseconds() &
- (time_epoch_delta_us - 1));
+ uint32_t time_delta_us =
+ static_cast<uint32_t>((it->second - creation_time_).ToMicroseconds() &
+ (time_epoch_delta_us - 1));
if (!writer->WriteBytes(&time_delta_us, sizeof(time_delta_us))) {
return false;
}
@@ -2469,8 +2469,7 @@ bool QuicFramer::AppendTimestampToAckFrame(const QuicAckFrame& frame,
return false;
}
- uint64_t frame_time_delta_us =
- it->second.Subtract(prev_time).ToMicroseconds();
+ uint64_t frame_time_delta_us = (it->second - prev_time).ToMicroseconds();
prev_time = it->second;
if (!writer->WriteUFloat16(frame_time_delta_us)) {
return false;
« no previous file with comments | « net/quic/quic_flow_controller.cc ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698