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

Unified Diff: net/quic/quic_headers_stream.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_framer_test.cc ('k') | net/quic/quic_protocol_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_headers_stream.cc
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index 72c3ac9bbefd189fae366cf501f64a5943cb0b53..7cee686211a0a48a44dd87405a436824fac252d0 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -35,14 +35,14 @@ class HeaderTableDebugVisitor : public HpackHeaderTable::DebugVisitorInterface {
int64_t OnNewEntry(const HpackEntry& entry) override {
DVLOG(1) << entry.GetDebugString();
- return clock_->ApproximateNow().Subtract(QuicTime::Zero()).ToMicroseconds();
+ return (clock_->ApproximateNow() - QuicTime::Zero()).ToMicroseconds();
}
void OnUseEntry(const HpackEntry& entry) override {
const QuicTime::Delta elapsed(
- clock_->ApproximateNow()
- .Subtract(QuicTime::Delta::FromMicroseconds(entry.time_added()))
- .Subtract(QuicTime::Zero()));
+ clock_->ApproximateNow() -
+ QuicTime::Delta::FromMicroseconds(entry.time_added()) -
+ QuicTime::Zero());
DVLOG(1) << entry.GetDebugString() << " " << elapsed.ToMilliseconds()
<< " ms";
headers_stream_hpack_visitor_->OnUseEntry(elapsed);
@@ -405,7 +405,7 @@ void QuicHeadersStream::OnControlFrameHeaderData(SpdyStreamId stream_id,
// headers from lower numbered streams actually came off the
// wire after headers for the current stream, hence there was
// HOL blocking.
- QuicTime::Delta delta(prev_max_timestamp_.Subtract(cur_max_timestamp_));
+ QuicTime::Delta delta = prev_max_timestamp_ - cur_max_timestamp_;
DVLOG(1) << "stream " << stream_id
<< ": Net.QuicSession.HeadersHOLBlockedTime "
<< delta.ToMilliseconds();
@@ -452,7 +452,7 @@ void QuicHeadersStream::OnHeaderList(const QuicHeaderList& header_list) {
// headers from lower numbered streams actually came off the
// wire after headers for the current stream, hence there was
// HOL blocking.
- QuicTime::Delta delta = prev_max_timestamp_.Subtract(cur_max_timestamp_);
+ QuicTime::Delta delta = prev_max_timestamp_ - cur_max_timestamp_;
DVLOG(1) << "stream " << stream_id_
<< ": Net.QuicSession.HeadersHOLBlockedTime "
<< delta.ToMilliseconds();
« no previous file with comments | « net/quic/quic_framer_test.cc ('k') | net/quic/quic_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698