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_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_CHROMIUM_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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class CTPolicyEnforcer; | 54 class CTPolicyEnforcer; |
55 class CertVerifier; | 55 class CertVerifier; |
56 class ChannelIDService; | 56 class ChannelIDService; |
57 class ClientSocketFactory; | 57 class ClientSocketFactory; |
58 class CTVerifier; | 58 class CTVerifier; |
59 class HostResolver; | 59 class HostResolver; |
60 class HttpServerProperties; | 60 class HttpServerProperties; |
61 class NetLog; | 61 class NetLog; |
62 class ProxyDelegate; | 62 class ProxyDelegate; |
63 class QuicClock; | 63 class QuicClock; |
64 class QuicChromiumAlarmFactory; | 64 class QuicAlarmFactory; |
65 class QuicChromiumConnectionHelper; | 65 class QuicChromiumConnectionHelper; |
66 class QuicCryptoClientStreamFactory; | 66 class QuicCryptoClientStreamFactory; |
67 class QuicRandom; | 67 class QuicRandom; |
68 class QuicServerInfo; | 68 class QuicServerInfo; |
69 class QuicServerInfoFactory; | 69 class QuicServerInfoFactory; |
70 class QuicStreamFactory; | 70 class QuicStreamFactory; |
71 class SocketPerformanceWatcherFactory; | 71 class SocketPerformanceWatcherFactory; |
72 class TransportSecurityState; | 72 class TransportSecurityState; |
73 class BidirectionalStreamImpl; | 73 class BidirectionalStreamImpl; |
74 | 74 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bool disable_connection_pooling, | 212 bool disable_connection_pooling, |
213 float load_server_info_timeout_srtt_multiplier, | 213 float load_server_info_timeout_srtt_multiplier, |
214 bool enable_connection_racing, | 214 bool enable_connection_racing, |
215 bool enable_non_blocking_io, | 215 bool enable_non_blocking_io, |
216 bool disable_disk_cache, | 216 bool disable_disk_cache, |
217 bool prefer_aes, | 217 bool prefer_aes, |
218 int socket_receive_buffer_size, | 218 int socket_receive_buffer_size, |
219 bool delay_tcp_race, | 219 bool delay_tcp_race, |
220 int max_server_configs_stored_in_properties, | 220 int max_server_configs_stored_in_properties, |
221 bool close_sessions_on_ip_change, | 221 bool close_sessions_on_ip_change, |
| 222 bool mark_quic_broken_when_network_blackholes, |
222 int idle_connection_timeout_seconds, | 223 int idle_connection_timeout_seconds, |
223 int reduced_ping_timeout_seconds, | 224 int reduced_ping_timeout_seconds, |
224 int packet_reader_yield_after_duration_milliseconds, | 225 int packet_reader_yield_after_duration_milliseconds, |
225 bool migrate_sessions_on_network_change, | 226 bool migrate_sessions_on_network_change, |
226 bool migrate_sessions_early, | 227 bool migrate_sessions_early, |
227 bool allow_server_migration, | 228 bool allow_server_migration, |
228 bool force_hol_blocking, | 229 bool force_hol_blocking, |
229 bool race_cert_verification, | 230 bool race_cert_verification, |
230 bool do_not_fragment, | 231 bool do_not_fragment, |
231 bool estimate_initial_rtt, | 232 bool estimate_initial_rtt, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Called by a session when it becomes idle. | 264 // Called by a session when it becomes idle. |
264 void OnIdleSession(QuicChromiumClientSession* session); | 265 void OnIdleSession(QuicChromiumClientSession* session); |
265 | 266 |
266 // Called by a session when it is going away and no more streams should be | 267 // Called by a session when it is going away and no more streams should be |
267 // created on it. | 268 // created on it. |
268 void OnSessionGoingAway(QuicChromiumClientSession* session); | 269 void OnSessionGoingAway(QuicChromiumClientSession* session); |
269 | 270 |
270 // Called by a session after it shuts down. | 271 // Called by a session after it shuts down. |
271 void OnSessionClosed(QuicChromiumClientSession* session); | 272 void OnSessionClosed(QuicChromiumClientSession* session); |
272 | 273 |
273 // Called by a session when it times out with open streams. | 274 // Called by a session when it blackholes after the handshake is confirmed. |
274 void OnTimeoutWithOpenStreams(); | 275 void OnBlackholeAfterHandshakeConfirmed(QuicChromiumClientSession* session); |
275 | 276 |
276 // Cancels a pending request. | 277 // Cancels a pending request. |
277 void CancelRequest(QuicStreamRequest* request); | 278 void CancelRequest(QuicStreamRequest* request); |
278 | 279 |
279 // Closes all current sessions with specified network and QUIC error codes. | 280 // Closes all current sessions with specified network and QUIC error codes. |
280 void CloseAllSessions(int error, QuicErrorCode quic_error); | 281 void CloseAllSessions(int error, QuicErrorCode quic_error); |
281 | 282 |
282 std::unique_ptr<base::Value> QuicStreamFactoryInfoToValue() const; | 283 std::unique_ptr<base::Value> QuicStreamFactoryInfoToValue() const; |
283 | 284 |
284 // Delete cached state objects in |crypto_config_|. If |origin_filter| is not | 285 // Delete cached state objects in |crypto_config_|. If |origin_filter| is not |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 366 |
366 void set_require_confirmation(bool require_confirmation); | 367 void set_require_confirmation(bool require_confirmation); |
367 | 368 |
368 bool ZeroRTTEnabledFor(const QuicServerId& server_id); | 369 bool ZeroRTTEnabledFor(const QuicServerId& server_id); |
369 | 370 |
370 // It returns the amount of time waiting job should be delayed. | 371 // It returns the amount of time waiting job should be delayed. |
371 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); | 372 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); |
372 | 373 |
373 QuicChromiumConnectionHelper* helper() { return helper_.get(); } | 374 QuicChromiumConnectionHelper* helper() { return helper_.get(); } |
374 | 375 |
375 QuicChromiumAlarmFactory* alarm_factory() { return alarm_factory_.get(); } | 376 QuicAlarmFactory* alarm_factory() { return alarm_factory_.get(); } |
376 | 377 |
377 bool has_quic_server_info_factory() const { | 378 bool has_quic_server_info_factory() const { |
378 return quic_server_info_factory_.get() != nullptr; | 379 return quic_server_info_factory_.get() != nullptr; |
379 } | 380 } |
380 | 381 |
381 QuicServerInfoFactory* quic_server_info_factory() const { | 382 QuicServerInfoFactory* quic_server_info_factory() const { |
382 return quic_server_info_factory_.get(); | 383 return quic_server_info_factory_.get(); |
383 } | 384 } |
384 | 385 |
385 void set_quic_server_info_factory( | 386 void set_quic_server_info_factory( |
386 QuicServerInfoFactory* quic_server_info_factory); | 387 QuicServerInfoFactory* quic_server_info_factory); |
387 | 388 |
388 void set_server_push_delegate(ServerPushDelegate* push_delegate) { | 389 void set_server_push_delegate(ServerPushDelegate* push_delegate) { |
389 push_delegate_ = push_delegate; | 390 push_delegate_ = push_delegate; |
390 } | 391 } |
391 | 392 |
392 bool enable_connection_racing() const { return enable_connection_racing_; } | 393 bool enable_connection_racing() const { return enable_connection_racing_; } |
393 void set_enable_connection_racing(bool enable_connection_racing) { | 394 void set_enable_connection_racing(bool enable_connection_racing) { |
394 enable_connection_racing_ = enable_connection_racing; | 395 enable_connection_racing_ = enable_connection_racing; |
395 } | 396 } |
396 | 397 |
397 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } | 398 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } |
398 | 399 |
399 bool delay_tcp_race() const { return delay_tcp_race_; } | 400 bool delay_tcp_race() const { return delay_tcp_race_; } |
400 | 401 |
401 bool migrate_sessions_on_network_change() const { | 402 bool migrate_sessions_on_network_change() const { |
402 return migrate_sessions_on_network_change_; | 403 return migrate_sessions_on_network_change_; |
403 } | 404 } |
404 | 405 |
| 406 bool mark_quic_broken_when_network_blackholes() const { |
| 407 return mark_quic_broken_when_network_blackholes_; |
| 408 } |
| 409 |
405 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name | 410 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name |
406 // used by the parent MemoryAllocatorDump in the memory dump hierarchy. | 411 // used by the parent MemoryAllocatorDump in the memory dump hierarchy. |
407 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, | 412 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, |
408 const std::string& parent_absolute_name) const; | 413 const std::string& parent_absolute_name) const; |
409 | 414 |
410 private: | 415 private: |
411 class Job; | 416 class Job; |
412 class CertVerifierJob; | 417 class CertVerifierJob; |
413 friend class test::QuicStreamFactoryPeer; | 418 friend class test::QuicStreamFactoryPeer; |
414 | 419 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 533 |
529 // Factory which is used to create socket performance watcher. A new watcher | 534 // Factory which is used to create socket performance watcher. A new watcher |
530 // is created for every QUIC connection. | 535 // is created for every QUIC connection. |
531 // |socket_performance_watcher_factory_| may be null. | 536 // |socket_performance_watcher_factory_| may be null. |
532 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; | 537 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; |
533 | 538 |
534 // The helper used for all connections. | 539 // The helper used for all connections. |
535 std::unique_ptr<QuicChromiumConnectionHelper> helper_; | 540 std::unique_ptr<QuicChromiumConnectionHelper> helper_; |
536 | 541 |
537 // The alarm factory used for all connections. | 542 // The alarm factory used for all connections. |
538 std::unique_ptr<QuicChromiumAlarmFactory> alarm_factory_; | 543 std::unique_ptr<QuicAlarmFactory> alarm_factory_; |
539 | 544 |
540 // Contains owning pointers to all sessions that currently exist. | 545 // Contains owning pointers to all sessions that currently exist. |
541 SessionIdMap all_sessions_; | 546 SessionIdMap all_sessions_; |
542 // Contains non-owning pointers to currently active session | 547 // Contains non-owning pointers to currently active session |
543 // (not going away session, once they're implemented). | 548 // (not going away session, once they're implemented). |
544 SessionMap active_sessions_; | 549 SessionMap active_sessions_; |
545 // Map from session to set of aliases that this session is known by. | 550 // Map from session to set of aliases that this session is known by. |
546 SessionAliasMap session_aliases_; | 551 SessionAliasMap session_aliases_; |
547 // Map from IP address to sessions which are connected to this address. | 552 // Map from IP address to sessions which are connected to this address. |
548 IPAliasMap ip_aliases_; | 553 IPAliasMap ip_aliases_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 588 |
584 // Set if experimental non-blocking IO should be used on windows sockets. | 589 // Set if experimental non-blocking IO should be used on windows sockets. |
585 bool enable_non_blocking_io_; | 590 bool enable_non_blocking_io_; |
586 | 591 |
587 // Set if we do not want to load server config from the disk cache. | 592 // Set if we do not want to load server config from the disk cache. |
588 bool disable_disk_cache_; | 593 bool disable_disk_cache_; |
589 | 594 |
590 // Set if AES-GCM should be preferred, even if there is no hardware support. | 595 // Set if AES-GCM should be preferred, even if there is no hardware support. |
591 bool prefer_aes_; | 596 bool prefer_aes_; |
592 | 597 |
| 598 // True if QUIC should be marked as broken when a connection blackholes after |
| 599 // the handshake is confirmed. |
| 600 bool mark_quic_broken_when_network_blackholes_; |
| 601 |
593 // Size of the UDP receive buffer. | 602 // Size of the UDP receive buffer. |
594 int socket_receive_buffer_size_; | 603 int socket_receive_buffer_size_; |
595 | 604 |
596 // Set if we do want to delay TCP connection when it is racing with QUIC. | 605 // Set if we do want to delay TCP connection when it is racing with QUIC. |
597 bool delay_tcp_race_; | 606 bool delay_tcp_race_; |
598 | 607 |
599 // PING timeout for connections. | 608 // PING timeout for connections. |
600 QuicTime::Delta ping_timeout_; | 609 QuicTime::Delta ping_timeout_; |
601 QuicTime::Delta reduced_ping_timeout_; | 610 QuicTime::Delta reduced_ping_timeout_; |
602 | 611 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 const scoped_refptr<SSLConfigService> ssl_config_service_; | 659 const scoped_refptr<SSLConfigService> ssl_config_service_; |
651 | 660 |
652 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 661 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
653 | 662 |
654 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 663 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
655 }; | 664 }; |
656 | 665 |
657 } // namespace net | 666 } // namespace net |
658 | 667 |
659 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 668 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |