| OLD | NEW |
| 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/core/quic_config.h" | 5 #include "net/quic/core/quic_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "net/quic/core/crypto/crypto_handshake_message.h" | 9 #include "net/quic/core/crypto/crypto_handshake_message.h" |
| 10 #include "net/quic/core/crypto/crypto_protocol.h" | 10 #include "net/quic/core/crypto/crypto_protocol.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 client_connection_options_(kCLOP, PRESENCE_OPTIONAL), | 330 client_connection_options_(kCLOP, PRESENCE_OPTIONAL), |
| 331 idle_network_timeout_seconds_(kICSL, PRESENCE_REQUIRED), | 331 idle_network_timeout_seconds_(kICSL, PRESENCE_REQUIRED), |
| 332 silent_close_(kSCLS, PRESENCE_OPTIONAL), | 332 silent_close_(kSCLS, PRESENCE_OPTIONAL), |
| 333 max_streams_per_connection_(kMSPC, PRESENCE_OPTIONAL), | 333 max_streams_per_connection_(kMSPC, PRESENCE_OPTIONAL), |
| 334 max_incoming_dynamic_streams_(kMIDS, PRESENCE_OPTIONAL), | 334 max_incoming_dynamic_streams_(kMIDS, PRESENCE_OPTIONAL), |
| 335 bytes_for_connection_id_(kTCID, PRESENCE_OPTIONAL), | 335 bytes_for_connection_id_(kTCID, PRESENCE_OPTIONAL), |
| 336 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL), | 336 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL), |
| 337 initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL), | 337 initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL), |
| 338 initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL), | 338 initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL), |
| 339 socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL), | 339 socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL), |
| 340 multipath_enabled_(kMPTH, PRESENCE_OPTIONAL), | |
| 341 connection_migration_disabled_(kNCMR, PRESENCE_OPTIONAL), | 340 connection_migration_disabled_(kNCMR, PRESENCE_OPTIONAL), |
| 342 alternate_server_address_(kASAD, PRESENCE_OPTIONAL), | 341 alternate_server_address_(kASAD, PRESENCE_OPTIONAL), |
| 343 force_hol_blocking_(kFHL2, PRESENCE_OPTIONAL), | 342 force_hol_blocking_(kFHL2, PRESENCE_OPTIONAL), |
| 344 support_max_header_list_size_(kSMHL, PRESENCE_OPTIONAL) { | 343 support_max_header_list_size_(kSMHL, PRESENCE_OPTIONAL) { |
| 345 SetDefaults(); | 344 SetDefaults(); |
| 346 } | 345 } |
| 347 | 346 |
| 348 QuicConfig::QuicConfig(const QuicConfig& other) = default; | 347 QuicConfig::QuicConfig(const QuicConfig& other) = default; |
| 349 | 348 |
| 350 QuicConfig::~QuicConfig() {} | 349 QuicConfig::~QuicConfig() {} |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 546 } |
| 548 | 547 |
| 549 bool QuicConfig::HasReceivedSocketReceiveBuffer() const { | 548 bool QuicConfig::HasReceivedSocketReceiveBuffer() const { |
| 550 return socket_receive_buffer_.HasReceivedValue(); | 549 return socket_receive_buffer_.HasReceivedValue(); |
| 551 } | 550 } |
| 552 | 551 |
| 553 uint32_t QuicConfig::ReceivedSocketReceiveBuffer() const { | 552 uint32_t QuicConfig::ReceivedSocketReceiveBuffer() const { |
| 554 return socket_receive_buffer_.GetReceivedValue(); | 553 return socket_receive_buffer_.GetReceivedValue(); |
| 555 } | 554 } |
| 556 | 555 |
| 557 void QuicConfig::SetMultipathEnabled(bool multipath_enabled) { | |
| 558 uint32_t value = multipath_enabled ? 1 : 0; | |
| 559 multipath_enabled_.set(value, value); | |
| 560 } | |
| 561 | |
| 562 bool QuicConfig::MultipathEnabled() const { | |
| 563 return multipath_enabled_.GetUint32() > 0; | |
| 564 } | |
| 565 | |
| 566 void QuicConfig::SetDisableConnectionMigration() { | 556 void QuicConfig::SetDisableConnectionMigration() { |
| 567 connection_migration_disabled_.SetSendValue(1); | 557 connection_migration_disabled_.SetSendValue(1); |
| 568 } | 558 } |
| 569 | 559 |
| 570 bool QuicConfig::DisableConnectionMigration() const { | 560 bool QuicConfig::DisableConnectionMigration() const { |
| 571 return connection_migration_disabled_.HasReceivedValue(); | 561 return connection_migration_disabled_.HasReceivedValue(); |
| 572 } | 562 } |
| 573 | 563 |
| 574 void QuicConfig::SetAlternateServerAddressToSend( | 564 void QuicConfig::SetAlternateServerAddressToSend( |
| 575 const QuicSocketAddress& alternate_server_address) { | 565 const QuicSocketAddress& alternate_server_address) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 error_details); | 699 error_details); |
| 710 } | 700 } |
| 711 if (error == QUIC_NO_ERROR) { | 701 if (error == QUIC_NO_ERROR) { |
| 712 error = support_max_header_list_size_.ProcessPeerHello( | 702 error = support_max_header_list_size_.ProcessPeerHello( |
| 713 peer_hello, hello_type, error_details); | 703 peer_hello, hello_type, error_details); |
| 714 } | 704 } |
| 715 return error; | 705 return error; |
| 716 } | 706 } |
| 717 | 707 |
| 718 } // namespace net | 708 } // namespace net |
| OLD | NEW |