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

Side by Side Diff: net/quic/core/quic_stream_sequencer.cc

Issue 2426603003: refactor only: Move around flag protection. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_crypto_stream.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/core/quic_stream_sequencer.h" 5 #include "net/quic/core/quic_stream_sequencer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 ignore_read_data_ = true; 192 ignore_read_data_ = true;
193 FlushBufferedFrames(); 193 FlushBufferedFrames();
194 } 194 }
195 195
196 void QuicStreamSequencer::ReleaseBuffer() { 196 void QuicStreamSequencer::ReleaseBuffer() {
197 buffered_frames_.ReleaseWholeBuffer(); 197 buffered_frames_.ReleaseWholeBuffer();
198 } 198 }
199 199
200 void QuicStreamSequencer::ReleaseBufferIfEmpty() { 200 void QuicStreamSequencer::ReleaseBufferIfEmpty() {
201 if (FLAGS_quic_release_crypto_stream_buffer && buffered_frames_.Empty()) { 201 if (buffered_frames_.Empty()) {
202 buffered_frames_.ReleaseWholeBuffer(); 202 buffered_frames_.ReleaseWholeBuffer();
203 } 203 }
204 } 204 }
205 205
206 void QuicStreamSequencer::FlushBufferedFrames() { 206 void QuicStreamSequencer::FlushBufferedFrames() {
207 DCHECK(ignore_read_data_); 207 DCHECK(ignore_read_data_);
208 size_t bytes_flushed = buffered_frames_.FlushBufferedFrames(); 208 size_t bytes_flushed = buffered_frames_.FlushBufferedFrames();
209 DVLOG(1) << "Flushing buffered data at offset " 209 DVLOG(1) << "Flushing buffered data at offset "
210 << buffered_frames_.BytesConsumed() << " length " << bytes_flushed 210 << buffered_frames_.BytesConsumed() << " length " << bytes_flushed
211 << " for stream " << stream_->id(); 211 << " for stream " << stream_->id();
(...skipping 15 matching lines...) Expand all
227 "\n bytes buffered: " + IntToString(NumBytesBuffered()) + 227 "\n bytes buffered: " + IntToString(NumBytesBuffered()) +
228 "\n bytes consumed: " + IntToString( NumBytesConsumed()) + 228 "\n bytes consumed: " + IntToString( NumBytesConsumed()) +
229 "\n has bytes to read: " + (HasBytesToRead() ? "true" : "false") + 229 "\n has bytes to read: " + (HasBytesToRead() ? "true" : "false") +
230 "\n frames received: " + IntToString(num_frames_received()) + 230 "\n frames received: " + IntToString(num_frames_received()) +
231 "\n close offset bytes: " + IntToString( close_offset_) + 231 "\n close offset bytes: " + IntToString( close_offset_) +
232 "\n is closed: " + (IsClosed() ? "true" : "false"); 232 "\n is closed: " + (IsClosed() ? "true" : "false");
233 // clang-format on 233 // clang-format on
234 } 234 }
235 235
236 } // namespace net 236 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698