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

Unified Diff: net/quic/core/quic_packet_creator.cc

Issue 2524523002: Remove various 'using std::' statements from QUIC code and use (Closed)
Patch Set: Rebase Created 4 years 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/core/quic_multipath_sent_packet_manager.cc ('k') | net/quic/core/quic_packet_creator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_packet_creator.cc
diff --git a/net/quic/core/quic_packet_creator.cc b/net/quic/core/quic_packet_creator.cc
index 1240beac6ae2373bfc6d86969643d94db849f10d..9049c24c6496a22afcc9f1a654a6b9111659df06 100644
--- a/net/quic/core/quic_packet_creator.cc
+++ b/net/quic/core/quic_packet_creator.cc
@@ -15,12 +15,7 @@
#include "net/quic/core/quic_utils.h"
using base::StringPiece;
-using std::make_pair;
-using std::max;
-using std::min;
-using std::pair;
using std::string;
-using std::vector;
// If true, enforce that QUIC CHLOs fit in one packet.
bool FLAGS_quic_enforce_single_packet_chlo = true;
@@ -115,7 +110,7 @@ void QuicPacketCreator::UpdatePacketNumberLength(
DCHECK_LE(least_packet_awaited_by_peer, packet_.packet_number + 1);
const QuicPacketNumber current_delta =
packet_.packet_number + 1 - least_packet_awaited_by_peer;
- const uint64_t delta = max(current_delta, max_packets_in_flight);
+ const uint64_t delta = std::max(current_delta, max_packets_in_flight);
packet_.packet_number_length =
QuicFramer::GetMinSequenceNumberLength(delta * 4);
}
@@ -208,7 +203,8 @@ void QuicPacketCreator::CreateStreamFrame(QuicStreamId id,
const size_t data_size = iov.total_length - iov_offset;
size_t min_frame_size = QuicFramer::GetMinStreamFrameSize(
id, offset, /* last_frame_in_packet= */ true);
- size_t bytes_consumed = min<size_t>(BytesFree() - min_frame_size, data_size);
+ size_t bytes_consumed =
+ std::min<size_t>(BytesFree() - min_frame_size, data_size);
bool set_fin = fin && bytes_consumed == data_size; // Last frame.
UniqueStreamBuffer buffer =
@@ -236,7 +232,7 @@ void QuicPacketCreator::CopyToBuffer(QuicIOVector iov,
// Unroll the first iteration that handles iov_offset.
const size_t iov_available = iov.iov[iovnum].iov_len - iov_offset;
- size_t copy_len = min(length, iov_available);
+ size_t copy_len = std::min(length, iov_available);
// Try to prefetch the next iov if there is at least one more after the
// current. Otherwise, it looks like an irregular access that the hardware
@@ -266,7 +262,7 @@ void QuicPacketCreator::CopyToBuffer(QuicIOVector iov,
break;
}
src = static_cast<char*>(iov.iov[iovnum].iov_base);
- copy_len = min(length, iov.iov[iovnum].iov_len);
+ copy_len = std::min(length, iov.iov[iovnum].iov_len);
}
QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer.";
}
@@ -379,7 +375,7 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
const size_t available_size =
max_plaintext_size_ - writer.length() - min_frame_size;
const size_t bytes_consumed =
- min<size_t>(available_size, remaining_data_size);
+ std::min<size_t>(available_size, remaining_data_size);
const bool set_fin = fin && (bytes_consumed == remaining_data_size);
UniqueStreamBuffer stream_buffer =
@@ -442,7 +438,7 @@ size_t QuicPacketCreator::ExpansionOnNewFrame() const {
size_t QuicPacketCreator::BytesFree() {
DCHECK_GE(max_plaintext_size_, PacketSize());
return max_plaintext_size_ -
- min(max_plaintext_size_, PacketSize() + ExpansionOnNewFrame());
+ std::min(max_plaintext_size_, PacketSize() + ExpansionOnNewFrame());
}
size_t QuicPacketCreator::PacketSize() {
« no previous file with comments | « net/quic/core/quic_multipath_sent_packet_manager.cc ('k') | net/quic/core/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698