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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool negotiated() const { return negotiated_; } | 68 bool negotiated() const { return negotiated_; } |
69 | 69 |
70 protected: | 70 protected: |
71 void set_negotiated(bool negotiated) { negotiated_ = negotiated; } | 71 void set_negotiated(bool negotiated) { negotiated_ = negotiated; } |
72 | 72 |
73 private: | 73 private: |
74 bool negotiated_; | 74 bool negotiated_; |
75 }; | 75 }; |
76 | 76 |
77 class NET_EXPORT_PRIVATE QuicNegotiableUint32 : public QuicNegotiableValue { | 77 class NET_EXPORT_PRIVATE QuicNegotiableUint32 : public QuicNegotiableValue { |
| 78 // TODO(fayang): some negotiated values use uint32 as bool (e.g., silent |
| 79 // close). Consider adding a QuicNegotiableBool type. |
78 public: | 80 public: |
79 // Default and max values default to 0. | 81 // Default and max values default to 0. |
80 QuicNegotiableUint32(QuicTag name, QuicConfigPresence presence); | 82 QuicNegotiableUint32(QuicTag name, QuicConfigPresence presence); |
81 ~QuicNegotiableUint32() override; | 83 ~QuicNegotiableUint32() override; |
82 | 84 |
83 // Sets the maximum possible value that can be achieved after negotiation and | 85 // Sets the maximum possible value that can be achieved after negotiation and |
84 // also the default values to be assumed if PRESENCE_OPTIONAL and the *HLO msg | 86 // also the default values to be assumed if PRESENCE_OPTIONAL and the *HLO msg |
85 // doesn't contain a value corresponding to |name_|. |max| is serialised via | 87 // doesn't contain a value corresponding to |name_|. |max| is serialised via |
86 // ToHandshakeMessage call if |negotiated_| is false. | 88 // ToHandshakeMessage call if |negotiated_| is false. |
87 void set(uint32_t max, uint32_t default_value); | 89 void set(uint32_t max, uint32_t default_value); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 322 |
321 uint32_t ReceivedInitialSessionFlowControlWindowBytes() const; | 323 uint32_t ReceivedInitialSessionFlowControlWindowBytes() const; |
322 | 324 |
323 // Sets socket receive buffer to transmit to the peer. | 325 // Sets socket receive buffer to transmit to the peer. |
324 void SetSocketReceiveBufferToSend(uint32_t window_bytes); | 326 void SetSocketReceiveBufferToSend(uint32_t window_bytes); |
325 | 327 |
326 bool HasReceivedSocketReceiveBuffer() const; | 328 bool HasReceivedSocketReceiveBuffer() const; |
327 | 329 |
328 uint32_t ReceivedSocketReceiveBuffer() const; | 330 uint32_t ReceivedSocketReceiveBuffer() const; |
329 | 331 |
| 332 void SetMultipathEnabled(bool multipath_enabled); |
| 333 |
| 334 bool MultipathEnabled() const; |
| 335 |
330 bool negotiated() const; | 336 bool negotiated() const; |
331 | 337 |
332 // ToHandshakeMessage serialises the settings in this object as a series of | 338 // ToHandshakeMessage serialises the settings in this object as a series of |
333 // tags /value pairs and adds them to |out|. | 339 // tags /value pairs and adds them to |out|. |
334 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; | 340 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; |
335 | 341 |
336 // Calls ProcessPeerHello on each negotiable parameter. On failure returns | 342 // Calls ProcessPeerHello on each negotiable parameter. On failure returns |
337 // the corresponding QuicErrorCode and sets detailed error in |error_details|. | 343 // the corresponding QuicErrorCode and sets detailed error in |error_details|. |
338 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, | 344 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, |
339 HelloType hello_type, | 345 HelloType hello_type, |
(...skipping 26 matching lines...) Expand all Loading... |
366 // Initial round trip time estimate in microseconds. | 372 // Initial round trip time estimate in microseconds. |
367 QuicFixedUint32 initial_round_trip_time_us_; | 373 QuicFixedUint32 initial_round_trip_time_us_; |
368 | 374 |
369 // Initial stream flow control receive window in bytes. | 375 // Initial stream flow control receive window in bytes. |
370 QuicFixedUint32 initial_stream_flow_control_window_bytes_; | 376 QuicFixedUint32 initial_stream_flow_control_window_bytes_; |
371 // Initial session flow control receive window in bytes. | 377 // Initial session flow control receive window in bytes. |
372 QuicFixedUint32 initial_session_flow_control_window_bytes_; | 378 QuicFixedUint32 initial_session_flow_control_window_bytes_; |
373 | 379 |
374 // Socket receive buffer in bytes. | 380 // Socket receive buffer in bytes. |
375 QuicFixedUint32 socket_receive_buffer_; | 381 QuicFixedUint32 socket_receive_buffer_; |
| 382 |
| 383 // Whether to support multipath for this connection. |
| 384 QuicNegotiableUint32 multipath_enabled_; |
376 }; | 385 }; |
377 | 386 |
378 } // namespace net | 387 } // namespace net |
379 | 388 |
380 #endif // NET_QUIC_QUIC_CONFIG_H_ | 389 #endif // NET_QUIC_QUIC_CONFIG_H_ |
OLD | NEW |