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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 int threshold_timeouts_with_streams_open, | 185 int threshold_timeouts_with_streams_open, |
186 int threshold_public_resets_post_handshake, | 186 int threshold_public_resets_post_handshake, |
187 int socket_receive_buffer_size, | 187 int socket_receive_buffer_size, |
188 bool delay_tcp_race, | 188 bool delay_tcp_race, |
189 int max_server_configs_stored_in_properties, | 189 int max_server_configs_stored_in_properties, |
190 bool close_sessions_on_ip_change, | 190 bool close_sessions_on_ip_change, |
191 bool disable_quic_on_timeout_with_open_streams, | 191 bool disable_quic_on_timeout_with_open_streams, |
192 int idle_connection_timeout_seconds, | 192 int idle_connection_timeout_seconds, |
193 bool migrate_sessions_on_network_change, | 193 bool migrate_sessions_on_network_change, |
194 bool migrate_sessions_early, | 194 bool migrate_sessions_early, |
| 195 bool allow_server_migration, |
195 bool force_hol_blocking, | 196 bool force_hol_blocking, |
196 const QuicTagVector& connection_options, | 197 const QuicTagVector& connection_options, |
197 bool enable_token_binding); | 198 bool enable_token_binding); |
198 ~QuicStreamFactory() override; | 199 ~QuicStreamFactory() override; |
199 | 200 |
200 // Returns true if there is an existing session for |server_id| or if the | 201 // Returns true if there is an existing session for |server_id| or if the |
201 // request can be pooled to an existing session to the IP address of | 202 // request can be pooled to an existing session to the IP address of |
202 // |destination|. | 203 // |destination|. |
203 bool CanUseExistingSession(const QuicServerId& server_id, | 204 bool CanUseExistingSession(const QuicServerId& server_id, |
204 const HostPortPair& destination); | 205 const HostPortPair& destination); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 const BoundNetLog& bound_net_log); | 291 const BoundNetLog& bound_net_log); |
291 | 292 |
292 // Method that initiates migration of |session| if |session| is | 293 // Method that initiates migration of |session| if |session| is |
293 // active and if there is an alternate network than the one to which | 294 // active and if there is an alternate network than the one to which |
294 // |session| is currently bound. If not null, |packet| is sent on | 295 // |session| is currently bound. If not null, |packet| is sent on |
295 // the new network, else a PING frame is sent. | 296 // the new network, else a PING frame is sent. |
296 void MaybeMigrateSingleSession(QuicChromiumClientSession* session, | 297 void MaybeMigrateSingleSession(QuicChromiumClientSession* session, |
297 MigrationCause migration_cause, | 298 MigrationCause migration_cause, |
298 scoped_refptr<StringIOBuffer> packet); | 299 scoped_refptr<StringIOBuffer> packet); |
299 | 300 |
300 // Method that migrates |session| over to using |new_network|. If | 301 // Migrates |session| over to using |network|. If |network| is |
301 // not null, |packet| is sent on the new network, else a PING frame | 302 // kInvalidNetworkHandle, default network is used. If |packet| is |
302 // is sent. Returns ERR_QUIC_PROTOCOL_ERROR if migration fails. | 303 // not null, it is sent on the new network, else a PING frame is |
303 void MigrateSessionToNetwork(QuicChromiumClientSession* session, | 304 // sent. |
304 NetworkChangeNotifier::NetworkHandle new_network, | 305 void MigrateSessionToNewNetwork(QuicChromiumClientSession* session, |
305 const BoundNetLog& bound_net_log, | 306 NetworkChangeNotifier::NetworkHandle network, |
306 scoped_refptr<StringIOBuffer> packet); | 307 const BoundNetLog& bound_net_log, |
| 308 scoped_refptr<StringIOBuffer> packet); |
| 309 |
| 310 // Migrates |session| over to using |peer_address|. Causes a PING frame |
| 311 // to be sent to the new peer address. |
| 312 void MigrateSessionToNewPeerAddress(QuicChromiumClientSession* session, |
| 313 IPEndPoint peer_address, |
| 314 const BoundNetLog& bound_net_log); |
307 | 315 |
308 // NetworkChangeNotifier::IPAddressObserver methods: | 316 // NetworkChangeNotifier::IPAddressObserver methods: |
309 | 317 |
310 // Until the servers support roaming, close all connections when the local | 318 // Until the servers support roaming, close all connections when the local |
311 // IP address changes. | 319 // IP address changes. |
312 void OnIPAddressChanged() override; | 320 void OnIPAddressChanged() override; |
313 | 321 |
314 // NetworkChangeNotifier::NetworkObserver methods: | 322 // NetworkChangeNotifier::NetworkObserver methods: |
315 void OnNetworkConnected( | 323 void OnNetworkConnected( |
316 NetworkChangeNotifier::NetworkHandle network) override; | 324 NetworkChangeNotifier::NetworkHandle network) override; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 448 |
441 void ProcessGoingAwaySession(QuicChromiumClientSession* session, | 449 void ProcessGoingAwaySession(QuicChromiumClientSession* session, |
442 const QuicServerId& server_id, | 450 const QuicServerId& server_id, |
443 bool was_session_active); | 451 bool was_session_active); |
444 | 452 |
445 // Collect stats from recent connections, possibly disabling Quic. | 453 // Collect stats from recent connections, possibly disabling Quic. |
446 void MaybeDisableQuic(QuicChromiumClientSession* session); | 454 void MaybeDisableQuic(QuicChromiumClientSession* session); |
447 | 455 |
448 void MaybeDisableQuic(uint16_t port); | 456 void MaybeDisableQuic(uint16_t port); |
449 | 457 |
| 458 // Internal method that migrates |session| over to using |
| 459 // |peer_address| and |network|. If |network| is kInvalidNetworkHandle, |
| 460 // default network is used. If |packet| is not null, it is sent |
| 461 // on the new network, else a PING frame is sent. |
| 462 void MigrateSession(QuicChromiumClientSession* session, |
| 463 IPEndPoint peer_address, |
| 464 NetworkChangeNotifier::NetworkHandle network, |
| 465 const BoundNetLog& bound_net_log, |
| 466 scoped_refptr<StringIOBuffer> packet); |
| 467 |
450 bool require_confirmation_; | 468 bool require_confirmation_; |
451 NetLog* net_log_; | 469 NetLog* net_log_; |
452 HostResolver* host_resolver_; | 470 HostResolver* host_resolver_; |
453 ClientSocketFactory* client_socket_factory_; | 471 ClientSocketFactory* client_socket_factory_; |
454 HttpServerProperties* http_server_properties_; | 472 HttpServerProperties* http_server_properties_; |
455 TransportSecurityState* transport_security_state_; | 473 TransportSecurityState* transport_security_state_; |
456 CTVerifier* cert_transparency_verifier_; | 474 CTVerifier* cert_transparency_verifier_; |
457 std::unique_ptr<QuicServerInfoFactory> quic_server_info_factory_; | 475 std::unique_ptr<QuicServerInfoFactory> quic_server_info_factory_; |
458 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; | 476 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; |
459 QuicRandom* random_generator_; | 477 QuicRandom* random_generator_; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 const bool close_sessions_on_ip_change_; | 584 const bool close_sessions_on_ip_change_; |
567 | 585 |
568 // Set if migration should be attempted on active sessions when primary | 586 // Set if migration should be attempted on active sessions when primary |
569 // interface changes. | 587 // interface changes. |
570 const bool migrate_sessions_on_network_change_; | 588 const bool migrate_sessions_on_network_change_; |
571 | 589 |
572 // Set if early migration should be attempted when the connection | 590 // Set if early migration should be attempted when the connection |
573 // experiences poor connectivity. | 591 // experiences poor connectivity. |
574 const bool migrate_sessions_early_; | 592 const bool migrate_sessions_early_; |
575 | 593 |
| 594 // If set, allows migration of connection to server-specified alternate |
| 595 // server address. |
| 596 const bool allow_server_migration_; |
| 597 |
576 // If set, force HOL blocking. For measurement purposes. | 598 // If set, force HOL blocking. For measurement purposes. |
577 const bool force_hol_blocking_; | 599 const bool force_hol_blocking_; |
578 | 600 |
579 // Each profile will (probably) have a unique port_seed_ value. This value | 601 // Each profile will (probably) have a unique port_seed_ value. This value |
580 // is used to help seed a pseudo-random number generator (PortSuggester) so | 602 // is used to help seed a pseudo-random number generator (PortSuggester) so |
581 // that we consistently (within this profile) suggest the same ephemeral | 603 // that we consistently (within this profile) suggest the same ephemeral |
582 // port when we re-connect to any given server/port. The differences between | 604 // port when we re-connect to any given server/port. The differences between |
583 // profiles (probablistically) prevent two profiles from colliding in their | 605 // profiles (probablistically) prevent two profiles from colliding in their |
584 // ephemeral port requests. | 606 // ephemeral port requests. |
585 uint64_t port_seed_; | 607 uint64_t port_seed_; |
(...skipping 18 matching lines...) Expand all Loading... |
604 const scoped_refptr<SSLConfigService> ssl_config_service_; | 626 const scoped_refptr<SSLConfigService> ssl_config_service_; |
605 | 627 |
606 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 628 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
607 | 629 |
608 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 630 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
609 }; | 631 }; |
610 | 632 |
611 } // namespace net | 633 } // namespace net |
612 | 634 |
613 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 635 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |