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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 bool enable_non_blocking_io, | 140 bool enable_non_blocking_io, |
141 bool disable_disk_cache, | 141 bool disable_disk_cache, |
142 bool prefer_aes, | 142 bool prefer_aes, |
143 int max_number_of_lossy_connections, | 143 int max_number_of_lossy_connections, |
144 float packet_loss_threshold, | 144 float packet_loss_threshold, |
145 int max_recent_disabled_reasons, | 145 int max_recent_disabled_reasons, |
146 int threshold_timeouts_with_streams_open, | 146 int threshold_timeouts_with_streams_open, |
147 int threshold_public_resets_post_handshake, | 147 int threshold_public_resets_post_handshake, |
148 int socket_receive_buffer_size, | 148 int socket_receive_buffer_size, |
149 bool delay_tcp_race, | 149 bool delay_tcp_race, |
150 bool store_server_configs_in_properties, | 150 int max_server_configs_stored_in_properties, |
151 bool close_sessions_on_ip_change, | 151 bool close_sessions_on_ip_change, |
152 int idle_connection_timeout_seconds, | 152 int idle_connection_timeout_seconds, |
153 bool migrate_sessions_on_network_change, | 153 bool migrate_sessions_on_network_change, |
154 const QuicTagVector& connection_options); | 154 const QuicTagVector& connection_options); |
155 ~QuicStreamFactory() override; | 155 ~QuicStreamFactory() override; |
156 | 156 |
157 // Returns true if there is an existing session to |server_id| which can be | 157 // Returns true if there is an existing session to |server_id| which can be |
158 // used for request to |origin_host|. | 158 // used for request to |origin_host|. |
159 bool CanUseExistingSession(QuicServerId server_id, | 159 bool CanUseExistingSession(QuicServerId server_id, |
160 PrivacyMode privacy_mode, | 160 PrivacyMode privacy_mode, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 bool ZeroRTTEnabledFor(const QuicServerId& server_id); | 269 bool ZeroRTTEnabledFor(const QuicServerId& server_id); |
270 | 270 |
271 // It returns the amount of time waiting job should be delayed. | 271 // It returns the amount of time waiting job should be delayed. |
272 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); | 272 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); |
273 | 273 |
274 QuicConnectionHelper* helper() { return helper_.get(); } | 274 QuicConnectionHelper* helper() { return helper_.get(); } |
275 | 275 |
276 bool enable_port_selection() const { return enable_port_selection_; } | 276 bool enable_port_selection() const { return enable_port_selection_; } |
277 | 277 |
278 bool has_quic_server_info_factory() { | 278 bool has_quic_server_info_factory() { |
279 return !quic_server_info_factory_.get(); | 279 return quic_server_info_factory_.get() != nullptr; |
280 } | 280 } |
281 | 281 |
282 void set_quic_server_info_factory( | 282 void set_quic_server_info_factory( |
283 QuicServerInfoFactory* quic_server_info_factory); | 283 QuicServerInfoFactory* quic_server_info_factory); |
284 | 284 |
285 bool enable_connection_racing() const { return enable_connection_racing_; } | 285 bool enable_connection_racing() const { return enable_connection_racing_; } |
286 void set_enable_connection_racing(bool enable_connection_racing) { | 286 void set_enable_connection_racing(bool enable_connection_racing) { |
287 enable_connection_racing_ = enable_connection_racing; | 287 enable_connection_racing_ = enable_connection_racing; |
288 } | 288 } |
289 | 289 |
290 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } | 290 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } |
291 | 291 |
292 bool delay_tcp_race() const { return delay_tcp_race_; } | 292 bool delay_tcp_race() const { return delay_tcp_race_; } |
293 | 293 |
294 bool store_server_configs_in_properties() const { | |
295 return store_server_configs_in_properties_; | |
296 } | |
297 | |
298 private: | 294 private: |
299 class Job; | 295 class Job; |
300 friend class test::QuicStreamFactoryPeer; | 296 friend class test::QuicStreamFactoryPeer; |
301 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad); | 297 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad); |
302 | 298 |
303 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; | 299 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; |
304 typedef std::map<QuicChromiumClientSession*, QuicServerId> SessionIdMap; | 300 typedef std::map<QuicChromiumClientSession*, QuicServerId> SessionIdMap; |
305 typedef std::set<QuicServerId> AliasSet; | 301 typedef std::set<QuicServerId> AliasSet; |
306 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap; | 302 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap; |
307 typedef std::set<QuicChromiumClientSession*> SessionSet; | 303 typedef std::set<QuicChromiumClientSession*> SessionSet; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 471 |
476 // Set if we do want to delay TCP connection when it is racing with QUIC. | 472 // Set if we do want to delay TCP connection when it is racing with QUIC. |
477 bool delay_tcp_race_; | 473 bool delay_tcp_race_; |
478 | 474 |
479 // If more than |yield_after_packets_| packets have been read or more than | 475 // If more than |yield_after_packets_| packets have been read or more than |
480 // |yield_after_duration_| time has passed, then | 476 // |yield_after_duration_| time has passed, then |
481 // QuicPacketReader::StartReading() yields by doing a PostTask(). | 477 // QuicPacketReader::StartReading() yields by doing a PostTask(). |
482 int yield_after_packets_; | 478 int yield_after_packets_; |
483 QuicTime::Delta yield_after_duration_; | 479 QuicTime::Delta yield_after_duration_; |
484 | 480 |
485 // Set if server configs are to be stored in HttpServerProperties. | |
486 bool store_server_configs_in_properties_; | |
487 | |
488 // Set if all sessions should be closed when any local IP address changes. | 481 // Set if all sessions should be closed when any local IP address changes. |
489 const bool close_sessions_on_ip_change_; | 482 const bool close_sessions_on_ip_change_; |
490 | 483 |
491 // Set if migration should be attempted on active sessions when primary | 484 // Set if migration should be attempted on active sessions when primary |
492 // interface changes. | 485 // interface changes. |
493 const bool migrate_sessions_on_network_change_; | 486 const bool migrate_sessions_on_network_change_; |
494 | 487 |
495 // Each profile will (probably) have a unique port_seed_ value. This value | 488 // Each profile will (probably) have a unique port_seed_ value. This value |
496 // is used to help seed a pseudo-random number generator (PortSuggester) so | 489 // is used to help seed a pseudo-random number generator (PortSuggester) so |
497 // that we consistently (within this profile) suggest the same ephemeral | 490 // that we consistently (within this profile) suggest the same ephemeral |
(...skipping 13 matching lines...) Expand all Loading... |
511 base::TaskRunner* task_runner_; | 504 base::TaskRunner* task_runner_; |
512 | 505 |
513 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 506 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
514 | 507 |
515 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 508 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
516 }; | 509 }; |
517 | 510 |
518 } // namespace net | 511 } // namespace net |
519 | 512 |
520 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 513 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |