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

Unified Diff: net/quic/core/quic_stream_sequencer_buffer.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_stream_sequencer.cc ('k') | net/quic/core/quic_stream_sequencer_buffer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_stream_sequencer_buffer.cc
diff --git a/net/quic/core/quic_stream_sequencer_buffer.cc b/net/quic/core/quic_stream_sequencer_buffer.cc
index db4abf98e1677589cc232a54299b97cf010adfd6..6b3ee9d96aae51db637e8676d81a4993223d54a3 100644
--- a/net/quic/core/quic_stream_sequencer_buffer.cc
+++ b/net/quic/core/quic_stream_sequencer_buffer.cc
@@ -12,7 +12,6 @@
#include "net/quic/core/quic_flags.h"
using base::StringPrintf;
-using std::min;
using std::string;
namespace net {
@@ -209,7 +208,8 @@ QuicErrorCode QuicStreamSequencerBuffer::OnStreamData(
blocks_[write_block_num] = new BufferBlock();
}
- const size_t bytes_to_copy = min<size_t>(bytes_avail, source_remaining);
+ const size_t bytes_to_copy =
+ std::min<size_t>(bytes_avail, source_remaining);
char* dest = blocks_[write_block_num]->buffer + write_block_offset;
DVLOG(1) << "Write at offset: " << offset << " length: " << bytes_to_copy;
@@ -290,10 +290,10 @@ QuicErrorCode QuicStreamSequencerBuffer::Readv(const iovec* dest_iov,
size_t block_idx = NextBlockToRead();
size_t start_offset_in_block = ReadOffset();
size_t block_capacity = GetBlockCapacity(block_idx);
- size_t bytes_available_in_block =
- min<size_t>(ReadableBytes(), block_capacity - start_offset_in_block);
+ size_t bytes_available_in_block = std::min<size_t>(
+ ReadableBytes(), block_capacity - start_offset_in_block);
size_t bytes_to_copy =
- min<size_t>(bytes_available_in_block, dest_remaining);
+ std::min<size_t>(bytes_available_in_block, dest_remaining);
DCHECK_GT(bytes_to_copy, 0UL);
if (blocks_[block_idx] == nullptr || dest == nullptr) {
*error_details = StringPrintf(
@@ -408,7 +408,7 @@ bool QuicStreamSequencerBuffer::GetReadableRegion(iovec* iov,
size_t start_block_idx = NextBlockToRead();
iov->iov_base = blocks_[start_block_idx]->buffer + ReadOffset();
- size_t readable_bytes_in_block = min<size_t>(
+ size_t readable_bytes_in_block = std::min<size_t>(
GetBlockCapacity(start_block_idx) - ReadOffset(), ReadableBytes());
size_t region_len = 0;
auto iter = frame_arrival_time_map_.begin();
@@ -447,9 +447,9 @@ bool QuicStreamSequencerBuffer::MarkConsumed(size_t bytes_used) {
while (bytes_to_consume > 0) {
size_t block_idx = NextBlockToRead();
size_t offset_in_block = ReadOffset();
- size_t bytes_available = min<size_t>(
+ size_t bytes_available = std::min<size_t>(
ReadableBytes(), GetBlockCapacity(block_idx) - offset_in_block);
- size_t bytes_read = min<size_t>(bytes_to_consume, bytes_available);
+ size_t bytes_read = std::min<size_t>(bytes_to_consume, bytes_available);
total_bytes_read_ += bytes_read;
num_bytes_buffered_ -= bytes_read;
bytes_to_consume -= bytes_read;
« no previous file with comments | « net/quic/core/quic_stream_sequencer.cc ('k') | net/quic/core/quic_stream_sequencer_buffer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698