OLD | NEW |
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 Loading... |
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 |
OLD | NEW |