| 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 #ifndef NET_QUIC_QUIC_CONFIG_H_ | 5 #ifndef NET_QUIC_QUIC_CONFIG_H_ |
| 6 #define NET_QUIC_QUIC_CONFIG_H_ | 6 #define NET_QUIC_QUIC_CONFIG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 void set_max_idle_time_before_crypto_handshake( | 297 void set_max_idle_time_before_crypto_handshake( |
| 298 QuicTime::Delta max_idle_time_before_crypto_handshake) { | 298 QuicTime::Delta max_idle_time_before_crypto_handshake) { |
| 299 max_idle_time_before_crypto_handshake_ = | 299 max_idle_time_before_crypto_handshake_ = |
| 300 max_idle_time_before_crypto_handshake; | 300 max_idle_time_before_crypto_handshake; |
| 301 } | 301 } |
| 302 | 302 |
| 303 QuicTime::Delta max_idle_time_before_crypto_handshake() const { | 303 QuicTime::Delta max_idle_time_before_crypto_handshake() const { |
| 304 return max_idle_time_before_crypto_handshake_; | 304 return max_idle_time_before_crypto_handshake_; |
| 305 } | 305 } |
| 306 | 306 |
| 307 void set_max_undecryptable_packets(size_t max_undecryptable_packets) { |
| 308 max_undecryptable_packets_ = max_undecryptable_packets; |
| 309 } |
| 310 |
| 311 size_t max_undecryptable_packets() const { |
| 312 return max_undecryptable_packets_; |
| 313 } |
| 314 |
| 307 // Sets the peer's default initial congestion window in packets. | 315 // Sets the peer's default initial congestion window in packets. |
| 308 void SetInitialCongestionWindowToSend(size_t initial_window); | 316 void SetInitialCongestionWindowToSend(size_t initial_window); |
| 309 | 317 |
| 310 bool HasReceivedInitialCongestionWindow() const; | 318 bool HasReceivedInitialCongestionWindow() const; |
| 311 | 319 |
| 312 uint32 ReceivedInitialCongestionWindow() const; | 320 uint32 ReceivedInitialCongestionWindow() const; |
| 313 | 321 |
| 314 // Sets an estimated initial round trip time in us. | 322 // Sets an estimated initial round trip time in us. |
| 315 void SetInitialRoundTripTimeUsToSend(size_t rtt_us); | 323 void SetInitialRoundTripTimeUsToSend(size_t rtt_us); |
| 316 | 324 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 void SetSocketReceiveBufferToSend(uint32 window_bytes); | 363 void SetSocketReceiveBufferToSend(uint32 window_bytes); |
| 356 | 364 |
| 357 uint32 GetSocketReceiveBufferToSend() const; | 365 uint32 GetSocketReceiveBufferToSend() const; |
| 358 | 366 |
| 359 bool HasReceivedSocketReceiveBuffer() const; | 367 bool HasReceivedSocketReceiveBuffer() const; |
| 360 | 368 |
| 361 uint32 ReceivedSocketReceiveBuffer() const; | 369 uint32 ReceivedSocketReceiveBuffer() const; |
| 362 | 370 |
| 363 bool negotiated() const; | 371 bool negotiated() const; |
| 364 | 372 |
| 365 // SetDefaults sets the members to sensible, default values. | |
| 366 void SetDefaults(); | |
| 367 | |
| 368 // ToHandshakeMessage serialises the settings in this object as a series of | 373 // ToHandshakeMessage serialises the settings in this object as a series of |
| 369 // tags /value pairs and adds them to |out|. | 374 // tags /value pairs and adds them to |out|. |
| 370 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; | 375 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; |
| 371 | 376 |
| 372 // Calls ProcessPeerHello on each negotiable parameter. On failure returns | 377 // Calls ProcessPeerHello on each negotiable parameter. On failure returns |
| 373 // the corresponding QuicErrorCode and sets detailed error in |error_details|. | 378 // the corresponding QuicErrorCode and sets detailed error in |error_details|. |
| 374 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, | 379 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, |
| 375 HelloType hello_type, | 380 HelloType hello_type, |
| 376 std::string* error_details); | 381 std::string* error_details); |
| 377 | 382 |
| 378 private: | 383 private: |
| 379 friend class test::QuicConfigPeer; | 384 friend class test::QuicConfigPeer; |
| 380 | 385 |
| 386 // SetDefaults sets the members to sensible, default values. |
| 387 void SetDefaults(); |
| 388 |
| 381 // Configurations options that are not negotiated. | 389 // Configurations options that are not negotiated. |
| 382 // Maximum time the session can be alive before crypto handshake is finished. | 390 // Maximum time the session can be alive before crypto handshake is finished. |
| 383 QuicTime::Delta max_time_before_crypto_handshake_; | 391 QuicTime::Delta max_time_before_crypto_handshake_; |
| 384 // Maximum idle time before the crypto handshake has completed. | 392 // Maximum idle time before the crypto handshake has completed. |
| 385 QuicTime::Delta max_idle_time_before_crypto_handshake_; | 393 QuicTime::Delta max_idle_time_before_crypto_handshake_; |
| 394 // Maximum number of undecryptable packets stored before CHLO/SHLO. |
| 395 size_t max_undecryptable_packets_; |
| 386 | 396 |
| 387 // Congestion control feedback type. | 397 // Congestion control feedback type. |
| 388 QuicNegotiableTag congestion_feedback_; | 398 QuicNegotiableTag congestion_feedback_; |
| 389 // Connection options. | 399 // Connection options. |
| 390 QuicFixedTagVector connection_options_; | 400 QuicFixedTagVector connection_options_; |
| 391 // Idle connection state lifetime | 401 // Idle connection state lifetime |
| 392 QuicNegotiableUint32 idle_connection_state_lifetime_seconds_; | 402 QuicNegotiableUint32 idle_connection_state_lifetime_seconds_; |
| 393 // Keepalive timeout, or 0 to turn off keepalive probes | 403 // Keepalive timeout, or 0 to turn off keepalive probes |
| 394 QuicNegotiableUint32 keepalive_timeout_seconds_; | 404 QuicNegotiableUint32 keepalive_timeout_seconds_; |
| 395 // Maximum number of streams that the connection can support. | 405 // Maximum number of streams that the connection can support. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 408 // Initial session flow control receive window in bytes. | 418 // Initial session flow control receive window in bytes. |
| 409 QuicFixedUint32 initial_session_flow_control_window_bytes_; | 419 QuicFixedUint32 initial_session_flow_control_window_bytes_; |
| 410 | 420 |
| 411 // Socket receive buffer in bytes. | 421 // Socket receive buffer in bytes. |
| 412 QuicFixedUint32 socket_receive_buffer_; | 422 QuicFixedUint32 socket_receive_buffer_; |
| 413 }; | 423 }; |
| 414 | 424 |
| 415 } // namespace net | 425 } // namespace net |
| 416 | 426 |
| 417 #endif // NET_QUIC_QUIC_CONFIG_H_ | 427 #endif // NET_QUIC_QUIC_CONFIG_H_ |
| OLD | NEW |