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

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

Issue 559373003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiler errors Created 6 years, 3 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 | « net/quic/quic_config.h ('k') | net/quic/quic_config_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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_config.h" 5 #include "net/quic/quic_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/quic/crypto/crypto_handshake_message.h" 10 #include "net/quic/crypto/crypto_handshake_message.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 546
547 bool QuicConfig::HasReceivedInitialRoundTripTimeUs() const { 547 bool QuicConfig::HasReceivedInitialRoundTripTimeUs() const {
548 return initial_round_trip_time_us_.HasReceivedValue(); 548 return initial_round_trip_time_us_.HasReceivedValue();
549 } 549 }
550 550
551 uint32 QuicConfig::ReceivedInitialRoundTripTimeUs() const { 551 uint32 QuicConfig::ReceivedInitialRoundTripTimeUs() const {
552 return initial_round_trip_time_us_.GetReceivedValue(); 552 return initial_round_trip_time_us_.GetReceivedValue();
553 } 553 }
554 554
555 bool QuicConfig::HasInitialRoundTripTimeUsToSend() const {
556 return initial_round_trip_time_us_.HasSendValue();
557 }
558
559 uint32 QuicConfig::GetInitialRoundTripTimeUsToSend() const {
560 return initial_round_trip_time_us_.GetSendValue();
561 }
562
555 void QuicConfig::SetInitialFlowControlWindowToSend(uint32 window_bytes) { 563 void QuicConfig::SetInitialFlowControlWindowToSend(uint32 window_bytes) {
556 if (window_bytes < kDefaultFlowControlSendWindow) { 564 if (window_bytes < kDefaultFlowControlSendWindow) {
557 LOG(DFATAL) << "Initial flow control receive window (" << window_bytes 565 LOG(DFATAL) << "Initial flow control receive window (" << window_bytes
558 << ") cannot be set lower than default (" 566 << ") cannot be set lower than default ("
559 << kDefaultFlowControlSendWindow << ")."; 567 << kDefaultFlowControlSendWindow << ").";
560 window_bytes = kDefaultFlowControlSendWindow; 568 window_bytes = kDefaultFlowControlSendWindow;
561 } 569 }
562 initial_flow_control_window_bytes_.SetSendValue(window_bytes); 570 initial_flow_control_window_bytes_.SetSendValue(window_bytes);
563 } 571 }
564 572
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 return congestion_feedback_.negotiated() && 649 return congestion_feedback_.negotiated() &&
642 idle_connection_state_lifetime_seconds_.negotiated() && 650 idle_connection_state_lifetime_seconds_.negotiated() &&
643 keepalive_timeout_seconds_.negotiated() && 651 keepalive_timeout_seconds_.negotiated() &&
644 max_streams_per_connection_.negotiated(); 652 max_streams_per_connection_.negotiated();
645 } 653 }
646 654
647 void QuicConfig::SetDefaults() { 655 void QuicConfig::SetDefaults() {
648 QuicTagVector congestion_feedback; 656 QuicTagVector congestion_feedback;
649 congestion_feedback.push_back(kQBIC); 657 congestion_feedback.push_back(kQBIC);
650 congestion_feedback_.set(congestion_feedback, kQBIC); 658 congestion_feedback_.set(congestion_feedback, kQBIC);
651 idle_connection_state_lifetime_seconds_.set(kDefaultTimeoutSecs, 659 idle_connection_state_lifetime_seconds_.set(kMaximumIdleTimeoutSecs,
652 kDefaultInitialTimeoutSecs); 660 kDefaultInitialTimeoutSecs);
653 // kKATO is optional. Return 0 if not negotiated. 661 // kKATO is optional. Return 0 if not negotiated.
654 keepalive_timeout_seconds_.set(0, 0); 662 keepalive_timeout_seconds_.set(0, 0);
655 max_streams_per_connection_.set(kDefaultMaxStreamsPerConnection, 663 set_max_streams_per_connection(kDefaultMaxStreamsPerConnection,
656 kDefaultMaxStreamsPerConnection); 664 kDefaultMaxStreamsPerConnection);
657 max_time_before_crypto_handshake_ = QuicTime::Delta::FromSeconds( 665 max_time_before_crypto_handshake_ = QuicTime::Delta::FromSeconds(
658 kDefaultMaxTimeForCryptoHandshakeSecs); 666 kDefaultMaxTimeForCryptoHandshakeSecs);
659 667
660 SetInitialFlowControlWindowToSend(kDefaultFlowControlSendWindow); 668 SetInitialFlowControlWindowToSend(kDefaultFlowControlSendWindow);
661 SetInitialStreamFlowControlWindowToSend(kDefaultFlowControlSendWindow); 669 SetInitialStreamFlowControlWindowToSend(kDefaultFlowControlSendWindow);
662 SetInitialSessionFlowControlWindowToSend(kDefaultFlowControlSendWindow); 670 SetInitialSessionFlowControlWindowToSend(kDefaultFlowControlSendWindow);
663 } 671 }
664 672
665 void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const { 673 void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
666 congestion_feedback_.ToHandshakeMessage(out); 674 congestion_feedback_.ToHandshakeMessage(out);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 peer_hello, hello_type, error_details); 737 peer_hello, hello_type, error_details);
730 } 738 }
731 if (error == QUIC_NO_ERROR) { 739 if (error == QUIC_NO_ERROR) {
732 error = connection_options_.ProcessPeerHello( 740 error = connection_options_.ProcessPeerHello(
733 peer_hello, hello_type, error_details); 741 peer_hello, hello_type, error_details);
734 } 742 }
735 return error; 743 return error;
736 } 744 }
737 745
738 } // namespace net 746 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_config.h ('k') | net/quic/quic_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698