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

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

Issue 2328633004: lazy allocation and early release memory in QuicStreamSequencerBuffer. Protected by --quic_reduce_s… (Closed)
Patch Set: Created 4 years, 3 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_stream_sequencer_buffer_test.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/reliable_quic_stream.h" 5 #include "net/quic/core/reliable_quic_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/core/iovector.h" 8 #include "net/quic/core/iovector.h"
9 #include "net/quic/core/quic_bug_tracker.h" 9 #include "net/quic/core/quic_bug_tracker.h"
10 #include "net/quic/core/quic_flags.h" 10 #include "net/quic/core/quic_flags.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 ack_notifier_delegate); 346 ack_notifier_delegate);
347 } 347 }
348 348
349 void ReliableQuicStream::CloseReadSide() { 349 void ReliableQuicStream::CloseReadSide() {
350 if (read_side_closed_) { 350 if (read_side_closed_) {
351 return; 351 return;
352 } 352 }
353 DVLOG(1) << ENDPOINT << "Done reading from stream " << id(); 353 DVLOG(1) << ENDPOINT << "Done reading from stream " << id();
354 354
355 read_side_closed_ = true; 355 read_side_closed_ = true;
356 sequencer_.ReleaseBuffer();
357
356 if (write_side_closed_) { 358 if (write_side_closed_) {
357 DVLOG(1) << ENDPOINT << "Closing stream: " << id(); 359 DVLOG(1) << ENDPOINT << "Closing stream: " << id();
358 session_->CloseStream(id()); 360 session_->CloseStream(id());
359 } 361 }
360 } 362 }
361 363
362 void ReliableQuicStream::CloseWriteSide() { 364 void ReliableQuicStream::CloseWriteSide() {
363 if (write_side_closed_) { 365 if (write_side_closed_) {
364 return; 366 return;
365 } 367 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 464 }
463 } 465 }
464 466
465 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { 467 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) {
466 if (flow_controller_.UpdateSendWindowOffset(new_window)) { 468 if (flow_controller_.UpdateSendWindowOffset(new_window)) {
467 OnCanWrite(); 469 OnCanWrite();
468 } 470 }
469 } 471 }
470 472
471 } // namespace net 473 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_stream_sequencer_buffer_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698