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

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

Issue 15074007: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | 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/reliable_quic_stream.h" 5 #include "net/quic/reliable_quic_stream.h"
6 6
7 #include "net/quic/quic_session.h" 7 #include "net/quic/quic_session.h"
8 #include "net/quic/quic_spdy_decompressor.h" 8 #include "net/quic/quic_spdy_decompressor.h"
9 9
10 using base::StringPiece; 10 using base::StringPiece;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (headers_decompressed_ && decompressed_headers_.empty()) { 358 if (headers_decompressed_ && decompressed_headers_.empty()) {
359 sequencer_.FlushBufferedFrames(); 359 sequencer_.FlushBufferedFrames();
360 } 360 }
361 } 361 }
362 362
363 bool ReliableQuicStream::OnDecompressedData(StringPiece data) { 363 bool ReliableQuicStream::OnDecompressedData(StringPiece data) {
364 data.AppendToString(&decompressed_headers_); 364 data.AppendToString(&decompressed_headers_);
365 return true; 365 return true;
366 } 366 }
367 367
368 void ReliableQuicStream::OnDecompressionError() {
369 session_->connection()->SendConnectionClose(QUIC_DECOMPRESSION_FAILURE);
370 }
371
372
368 void ReliableQuicStream::CloseWriteSide() { 373 void ReliableQuicStream::CloseWriteSide() {
369 if (write_side_closed_) { 374 if (write_side_closed_) {
370 return; 375 return;
371 } 376 }
372 DLOG(INFO) << "Done writing to stream " << id(); 377 DLOG(INFO) << "Done writing to stream " << id();
373 378
374 write_side_closed_ = true; 379 write_side_closed_ = true;
375 if (read_side_closed_) { 380 if (read_side_closed_) {
376 DLOG(INFO) << "Closing stream: " << id(); 381 DLOG(INFO) << "Closing stream: " << id();
377 session_->CloseStream(id()); 382 session_->CloseStream(id());
378 } 383 }
379 } 384 }
380 385
381 void ReliableQuicStream::OnClose() { 386 void ReliableQuicStream::OnClose() {
382 CloseReadSide(); 387 CloseReadSide();
383 CloseWriteSide(); 388 CloseWriteSide();
384 389
385 if (visitor_) { 390 if (visitor_) {
386 Visitor* visitor = visitor_; 391 Visitor* visitor = visitor_;
387 // Calling Visitor::OnClose() may result the destruction of the visitor, 392 // Calling Visitor::OnClose() may result the destruction of the visitor,
388 // so we need to ensure we don't call it again. 393 // so we need to ensure we don't call it again.
389 visitor_ = NULL; 394 visitor_ = NULL;
390 visitor->OnClose(this); 395 visitor->OnClose(this);
391 } 396 }
392 } 397 }
393 398
394 } // namespace net 399 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/quic/test_tools/crypto_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698