OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 bool enable_connection_racing, | 171 bool enable_connection_racing, |
172 bool enable_non_blocking_io, | 172 bool enable_non_blocking_io, |
173 bool disable_disk_cache, | 173 bool disable_disk_cache, |
174 bool prefer_aes, | 174 bool prefer_aes, |
175 int max_number_of_lossy_connections, | 175 int max_number_of_lossy_connections, |
176 float packet_loss_threshold, | 176 float packet_loss_threshold, |
177 int max_recent_disabled_reasons, | 177 int max_recent_disabled_reasons, |
178 int threshold_timeouts_with_streams_open, | 178 int threshold_timeouts_with_streams_open, |
179 int threshold_public_resets_post_handshake, | 179 int threshold_public_resets_post_handshake, |
180 int socket_receive_buffer_size, | 180 int socket_receive_buffer_size, |
| 181 bool delay_tcp_race, |
181 int max_server_configs_stored_in_properties, | 182 int max_server_configs_stored_in_properties, |
182 bool close_sessions_on_ip_change, | 183 bool close_sessions_on_ip_change, |
183 bool disable_quic_on_timeout_with_open_streams, | 184 bool disable_quic_on_timeout_with_open_streams, |
184 int idle_connection_timeout_seconds, | 185 int idle_connection_timeout_seconds, |
185 bool migrate_sessions_on_network_change, | 186 bool migrate_sessions_on_network_change, |
186 bool migrate_sessions_early, | 187 bool migrate_sessions_early, |
187 const QuicTagVector& connection_options, | 188 const QuicTagVector& connection_options, |
188 bool enable_token_binding); | 189 bool enable_token_binding); |
189 ~QuicStreamFactory() override; | 190 ~QuicStreamFactory() override; |
190 | 191 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 void set_quic_server_info_factory( | 339 void set_quic_server_info_factory( |
339 QuicServerInfoFactory* quic_server_info_factory); | 340 QuicServerInfoFactory* quic_server_info_factory); |
340 | 341 |
341 bool enable_connection_racing() const { return enable_connection_racing_; } | 342 bool enable_connection_racing() const { return enable_connection_racing_; } |
342 void set_enable_connection_racing(bool enable_connection_racing) { | 343 void set_enable_connection_racing(bool enable_connection_racing) { |
343 enable_connection_racing_ = enable_connection_racing; | 344 enable_connection_racing_ = enable_connection_racing; |
344 } | 345 } |
345 | 346 |
346 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } | 347 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } |
347 | 348 |
| 349 bool delay_tcp_race() const { return delay_tcp_race_; } |
| 350 |
348 private: | 351 private: |
349 class Job; | 352 class Job; |
350 friend class test::QuicStreamFactoryPeer; | 353 friend class test::QuicStreamFactoryPeer; |
351 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad); | 354 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad); |
352 | 355 |
353 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; | 356 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; |
354 typedef std::map<QuicChromiumClientSession*, QuicSessionKey> SessionIdMap; | 357 typedef std::map<QuicChromiumClientSession*, QuicSessionKey> SessionIdMap; |
355 typedef std::set<QuicSessionKey> AliasSet; | 358 typedef std::set<QuicSessionKey> AliasSet; |
356 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap; | 359 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap; |
357 typedef std::set<QuicChromiumClientSession*> SessionSet; | 360 typedef std::set<QuicChromiumClientSession*> SessionSet; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // determine good threshold values. | 531 // determine good threshold values. |
529 int max_public_resets_post_handshake_; | 532 int max_public_resets_post_handshake_; |
530 int max_timeouts_with_open_streams_; | 533 int max_timeouts_with_open_streams_; |
531 // Thresholds if greater than zero, determine when to | 534 // Thresholds if greater than zero, determine when to |
532 int threshold_timeouts_with_open_streams_; | 535 int threshold_timeouts_with_open_streams_; |
533 int threshold_public_resets_post_handshake_; | 536 int threshold_public_resets_post_handshake_; |
534 | 537 |
535 // Size of the UDP receive buffer. | 538 // Size of the UDP receive buffer. |
536 int socket_receive_buffer_size_; | 539 int socket_receive_buffer_size_; |
537 | 540 |
| 541 // Set if we do want to delay TCP connection when it is racing with QUIC. |
| 542 bool delay_tcp_race_; |
| 543 |
538 // If more than |yield_after_packets_| packets have been read or more than | 544 // If more than |yield_after_packets_| packets have been read or more than |
539 // |yield_after_duration_| time has passed, then | 545 // |yield_after_duration_| time has passed, then |
540 // QuicChromiumPacketReader::StartReading() yields by doing a PostTask(). | 546 // QuicChromiumPacketReader::StartReading() yields by doing a PostTask(). |
541 int yield_after_packets_; | 547 int yield_after_packets_; |
542 QuicTime::Delta yield_after_duration_; | 548 QuicTime::Delta yield_after_duration_; |
543 | 549 |
544 // Set if all sessions should be closed when any local IP address changes. | 550 // Set if all sessions should be closed when any local IP address changes. |
545 const bool close_sessions_on_ip_change_; | 551 const bool close_sessions_on_ip_change_; |
546 | 552 |
547 // Set if migration should be attempted on active sessions when primary | 553 // Set if migration should be attempted on active sessions when primary |
(...skipping 30 matching lines...) Expand all Loading... |
578 base::TaskRunner* task_runner_; | 584 base::TaskRunner* task_runner_; |
579 | 585 |
580 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 586 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
581 | 587 |
582 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 588 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
583 }; | 589 }; |
584 | 590 |
585 } // namespace net | 591 } // namespace net |
586 | 592 |
587 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 593 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |