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/quic_headers_stream.h" | 5 #include "net/quic/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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 ack_listener); | 375 ack_listener); |
376 return frame.size(); | 376 return frame.size(); |
377 } | 377 } |
378 | 378 |
379 QuicConsumedData QuicHeadersStream::WritevStreamData( | 379 QuicConsumedData QuicHeadersStream::WritevStreamData( |
380 QuicStreamId id, | 380 QuicStreamId id, |
381 QuicIOVector iov, | 381 QuicIOVector iov, |
382 QuicStreamOffset offset, | 382 QuicStreamOffset offset, |
383 bool fin, | 383 bool fin, |
384 QuicAckListenerInterface* ack_notifier_delegate) { | 384 QuicAckListenerInterface* ack_notifier_delegate) { |
385 const size_t max_len = SpdyConstants::GetFrameMaximumSize(HTTP2) - | 385 const size_t max_len = kSpdyInitialFrameSizeLimit - |
386 SpdyConstants::GetDataFrameMinimumSize(HTTP2); | 386 SpdyConstants::GetDataFrameMinimumSize(HTTP2); |
387 | 387 |
388 QuicConsumedData result(0, false); | 388 QuicConsumedData result(0, false); |
389 size_t total_length = iov.total_length; | 389 size_t total_length = iov.total_length; |
390 | 390 |
391 // Encapsulate the data into HTTP/2 DATA frames. The outer loop | 391 // Encapsulate the data into HTTP/2 DATA frames. The outer loop |
392 // handles each element of the source iov, the inner loop handles | 392 // handles each element of the source iov, the inner loop handles |
393 // the possibility of fragmenting eacho of those into multiple DATA | 393 // the possibility of fragmenting eacho of those into multiple DATA |
394 // frames, as the DATA frames have a max size of 16KB. | 394 // frames, as the DATA frames have a max size of 16KB. |
395 for (int i = 0; i < iov.iov_count; i++) { | 395 for (int i = 0; i < iov.iov_count; i++) { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 return true; | 638 return true; |
639 } | 639 } |
640 frame_len_ -= len; | 640 frame_len_ -= len; |
641 // Ignore fin_ while there is more data coming, if frame_len_ > 0. | 641 // Ignore fin_ while there is more data coming, if frame_len_ > 0. |
642 spdy_session_->OnStreamFrameData(stream_id, data, len, | 642 spdy_session_->OnStreamFrameData(stream_id, data, len, |
643 frame_len_ > 0 ? false : fin_); | 643 frame_len_ > 0 ? false : fin_); |
644 return true; | 644 return true; |
645 } | 645 } |
646 | 646 |
647 } // namespace net | 647 } // namespace net |
OLD | NEW |