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

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

Issue 2130153002: Clean up max_frame_size related constants, move storage of setting to the framer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a typo in net/spdy/spdy_protocol.h. Created 4 years, 5 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 | « no previous file | net/quic/quic_headers_stream_test.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_headers_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698