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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 279 |
280 QuicTime::Delta IdleConnectionStateLifetime() const; | 280 QuicTime::Delta IdleConnectionStateLifetime() const; |
281 | 281 |
282 QuicTime::Delta KeepaliveTimeout() const; | 282 QuicTime::Delta KeepaliveTimeout() const; |
283 | 283 |
284 void SetMaxStreamsPerConnection(size_t max_streams, size_t default_streams); | 284 void SetMaxStreamsPerConnection(size_t max_streams, size_t default_streams); |
285 | 285 |
286 uint32 MaxStreamsPerConnection() const; | 286 uint32 MaxStreamsPerConnection() const; |
287 | 287 |
288 void set_max_time_before_crypto_handshake( | 288 void set_max_time_before_crypto_handshake( |
289 QuicTime::Delta max_time_before_crypto_handshake); | 289 QuicTime::Delta max_time_before_crypto_handshake) { |
| 290 max_time_before_crypto_handshake_ = max_time_before_crypto_handshake; |
| 291 } |
290 | 292 |
291 QuicTime::Delta max_time_before_crypto_handshake() const; | 293 QuicTime::Delta max_time_before_crypto_handshake() const { |
| 294 return max_time_before_crypto_handshake_; |
| 295 } |
| 296 |
| 297 void set_max_idle_time_before_crypto_handshake( |
| 298 QuicTime::Delta max_idle_time_before_crypto_handshake) { |
| 299 max_idle_time_before_crypto_handshake_ = |
| 300 max_idle_time_before_crypto_handshake; |
| 301 } |
| 302 |
| 303 QuicTime::Delta max_idle_time_before_crypto_handshake() const { |
| 304 return max_idle_time_before_crypto_handshake_; |
| 305 } |
292 | 306 |
293 // Sets the peer's default initial congestion window in packets. | 307 // Sets the peer's default initial congestion window in packets. |
294 void SetInitialCongestionWindowToSend(size_t initial_window); | 308 void SetInitialCongestionWindowToSend(size_t initial_window); |
295 | 309 |
296 bool HasReceivedInitialCongestionWindow() const; | 310 bool HasReceivedInitialCongestionWindow() const; |
297 | 311 |
298 uint32 ReceivedInitialCongestionWindow() const; | 312 uint32 ReceivedInitialCongestionWindow() const; |
299 | 313 |
300 // Sets an estimated initial round trip time in us. | 314 // Sets an estimated initial round trip time in us. |
301 void SetInitialRoundTripTimeUsToSend(size_t rtt_us); | 315 void SetInitialRoundTripTimeUsToSend(size_t rtt_us); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 353 |
340 // Sets socket receive buffer to transmit to the peer. | 354 // Sets socket receive buffer to transmit to the peer. |
341 void SetSocketReceiveBufferToSend(uint32 window_bytes); | 355 void SetSocketReceiveBufferToSend(uint32 window_bytes); |
342 | 356 |
343 uint32 GetSocketReceiveBufferToSend() const; | 357 uint32 GetSocketReceiveBufferToSend() const; |
344 | 358 |
345 bool HasReceivedSocketReceiveBuffer() const; | 359 bool HasReceivedSocketReceiveBuffer() const; |
346 | 360 |
347 uint32 ReceivedSocketReceiveBuffer() const; | 361 uint32 ReceivedSocketReceiveBuffer() const; |
348 | 362 |
349 bool negotiated(); | 363 bool negotiated() const; |
350 | 364 |
351 // SetDefaults sets the members to sensible, default values. | 365 // SetDefaults sets the members to sensible, default values. |
352 void SetDefaults(); | 366 void SetDefaults(); |
353 | 367 |
354 // ToHandshakeMessage serialises the settings in this object as a series of | 368 // ToHandshakeMessage serialises the settings in this object as a series of |
355 // tags /value pairs and adds them to |out|. | 369 // tags /value pairs and adds them to |out|. |
356 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; | 370 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; |
357 | 371 |
358 // Calls ProcessPeerHello on each negotiable parameter. On failure returns | 372 // Calls ProcessPeerHello on each negotiable parameter. On failure returns |
359 // the corresponding QuicErrorCode and sets detailed error in |error_details|. | 373 // the corresponding QuicErrorCode and sets detailed error in |error_details|. |
360 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, | 374 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, |
361 HelloType hello_type, | 375 HelloType hello_type, |
362 std::string* error_details); | 376 std::string* error_details); |
363 | 377 |
364 private: | 378 private: |
365 friend class test::QuicConfigPeer; | 379 friend class test::QuicConfigPeer; |
366 | 380 |
| 381 // Configurations options that are not negotiated. |
| 382 // Maximum time the session can be alive before crypto handshake is finished. |
| 383 QuicTime::Delta max_time_before_crypto_handshake_; |
| 384 // Maximum idle time before the crypto handshake has completed. |
| 385 QuicTime::Delta max_idle_time_before_crypto_handshake_; |
| 386 |
367 // Congestion control feedback type. | 387 // Congestion control feedback type. |
368 QuicNegotiableTag congestion_feedback_; | 388 QuicNegotiableTag congestion_feedback_; |
369 // Connection options. | 389 // Connection options. |
370 QuicFixedTagVector connection_options_; | 390 QuicFixedTagVector connection_options_; |
371 // Idle connection state lifetime | 391 // Idle connection state lifetime |
372 QuicNegotiableUint32 idle_connection_state_lifetime_seconds_; | 392 QuicNegotiableUint32 idle_connection_state_lifetime_seconds_; |
373 // Keepalive timeout, or 0 to turn off keepalive probes | 393 // Keepalive timeout, or 0 to turn off keepalive probes |
374 QuicNegotiableUint32 keepalive_timeout_seconds_; | 394 QuicNegotiableUint32 keepalive_timeout_seconds_; |
375 // Maximum number of streams that the connection can support. | 395 // Maximum number of streams that the connection can support. |
376 QuicNegotiableUint32 max_streams_per_connection_; | 396 QuicNegotiableUint32 max_streams_per_connection_; |
377 // Maximum time till the session can be alive before crypto handshake is | |
378 // finished. (Not negotiated). | |
379 QuicTime::Delta max_time_before_crypto_handshake_; | |
380 // Initial congestion window in packets. | 397 // Initial congestion window in packets. |
381 QuicFixedUint32 initial_congestion_window_; | 398 QuicFixedUint32 initial_congestion_window_; |
382 // Initial round trip time estimate in microseconds. | 399 // Initial round trip time estimate in microseconds. |
383 QuicFixedUint32 initial_round_trip_time_us_; | 400 QuicFixedUint32 initial_round_trip_time_us_; |
384 | 401 |
385 // TODO(rjshade): Remove when removing QUIC_VERSION_19. | 402 // TODO(rjshade): Remove when removing QUIC_VERSION_19. |
386 // Initial flow control receive window in bytes. | 403 // Initial flow control receive window in bytes. |
387 QuicFixedUint32 initial_flow_control_window_bytes_; | 404 QuicFixedUint32 initial_flow_control_window_bytes_; |
388 | 405 |
389 // Initial stream flow control receive window in bytes. | 406 // Initial stream flow control receive window in bytes. |
390 QuicFixedUint32 initial_stream_flow_control_window_bytes_; | 407 QuicFixedUint32 initial_stream_flow_control_window_bytes_; |
391 // Initial session flow control receive window in bytes. | 408 // Initial session flow control receive window in bytes. |
392 QuicFixedUint32 initial_session_flow_control_window_bytes_; | 409 QuicFixedUint32 initial_session_flow_control_window_bytes_; |
393 | 410 |
394 // Socket receive buffer in bytes. | 411 // Socket receive buffer in bytes. |
395 QuicFixedUint32 socket_receive_buffer_; | 412 QuicFixedUint32 socket_receive_buffer_; |
396 }; | 413 }; |
397 | 414 |
398 } // namespace net | 415 } // namespace net |
399 | 416 |
400 #endif // NET_QUIC_QUIC_CONFIG_H_ | 417 #endif // NET_QUIC_QUIC_CONFIG_H_ |
OLD | NEW |