OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_headers_stream.h" | 5 #include "net/quic/core/quic_headers_stream.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 307 } |
308 | 308 |
309 void OnReceiveCompressedFrame(SpdyStreamId stream_id, | 309 void OnReceiveCompressedFrame(SpdyStreamId stream_id, |
310 SpdyFrameType type, | 310 SpdyFrameType type, |
311 size_t frame_len) override { | 311 size_t frame_len) override { |
312 if (stream_->IsConnected()) { | 312 if (stream_->IsConnected()) { |
313 stream_->OnCompressedFrameSize(frame_len); | 313 stream_->OnCompressedFrameSize(frame_len); |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
| 317 void set_max_uncompressed_header_bytes( |
| 318 size_t set_max_uncompressed_header_bytes) { |
| 319 header_list_.set_max_uncompressed_header_bytes( |
| 320 set_max_uncompressed_header_bytes); |
| 321 } |
| 322 |
317 private: | 323 private: |
318 void CloseConnection(const string& details) { | 324 void CloseConnection(const string& details) { |
319 if (stream_->IsConnected()) { | 325 if (stream_->IsConnected()) { |
320 stream_->CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA, | 326 stream_->CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA, |
321 details); | 327 details); |
322 } | 328 } |
323 } | 329 } |
324 | 330 |
325 private: | 331 private: |
326 QuicHeadersStream* stream_; | 332 QuicHeadersStream* stream_; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 cur_max_timestamp_ = std::max(timestamp, cur_max_timestamp_); | 465 cur_max_timestamp_ = std::max(timestamp, cur_max_timestamp_); |
460 if (spdy_framer_.ProcessInput(static_cast<char*>(iov.iov_base), | 466 if (spdy_framer_.ProcessInput(static_cast<char*>(iov.iov_base), |
461 iov.iov_len) != iov.iov_len) { | 467 iov.iov_len) != iov.iov_len) { |
462 // Error processing data. | 468 // Error processing data. |
463 return; | 469 return; |
464 } | 470 } |
465 sequencer()->MarkConsumed(iov.iov_len); | 471 sequencer()->MarkConsumed(iov.iov_len); |
466 } | 472 } |
467 } | 473 } |
468 | 474 |
| 475 void QuicHeadersStream::set_max_uncompressed_header_bytes( |
| 476 size_t set_max_uncompressed_header_bytes) { |
| 477 spdy_framer_visitor_->set_max_uncompressed_header_bytes( |
| 478 set_max_uncompressed_header_bytes); |
| 479 } |
| 480 |
469 void QuicHeadersStream::OnHeaders(SpdyStreamId stream_id, | 481 void QuicHeadersStream::OnHeaders(SpdyStreamId stream_id, |
470 bool has_priority, | 482 bool has_priority, |
471 SpdyPriority priority, | 483 SpdyPriority priority, |
472 bool fin) { | 484 bool fin) { |
473 if (has_priority) { | 485 if (has_priority) { |
474 if (session()->perspective() == Perspective::IS_CLIENT) { | 486 if (session()->perspective() == Perspective::IS_CLIENT) { |
475 CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA, | 487 CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA, |
476 "Server must not send priorities."); | 488 "Server must not send priorities."); |
477 return; | 489 return; |
478 } | 490 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 return true; | 655 return true; |
644 } | 656 } |
645 frame_len_ -= len; | 657 frame_len_ -= len; |
646 // Ignore fin_ while there is more data coming, if frame_len_ > 0. | 658 // Ignore fin_ while there is more data coming, if frame_len_ > 0. |
647 spdy_session_->OnStreamFrameData(stream_id, data, len, | 659 spdy_session_->OnStreamFrameData(stream_id, data, len, |
648 frame_len_ > 0 ? false : fin_); | 660 frame_len_ > 0 ? false : fin_); |
649 return true; | 661 return true; |
650 } | 662 } |
651 | 663 |
652 } // namespace net | 664 } // namespace net |
OLD | NEW |