Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: net/quic/chromium/quic_stream_factory.h

Issue 2789093003: Mark QUIC broken when the network blackholes after the handshake (Closed)
Patch Set: Address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Sets |session_|. 138 // Sets |session_|.
139 void SetSession(QuicChromiumClientSession* session); 139 void SetSession(QuicChromiumClientSession* session);
140 140
141 const QuicServerId& server_id() const { return server_id_; } 141 const QuicServerId& server_id() const { return server_id_; }
142 142
143 const NetLogWithSource& net_log() const { return net_log_; } 143 const NetLogWithSource& net_log() const { return net_log_; }
144 144
145 private: 145 private:
146 QuicStreamFactory* factory_; 146 QuicStreamFactory* factory_;
147 HttpServerProperties* http_server_properties_; 147 HttpServerProperties* http_server_properties_;
148 bool mark_quic_broken_when_network_suspected_;
148 QuicServerId server_id_; 149 QuicServerId server_id_;
149 NetLogWithSource net_log_; 150 NetLogWithSource net_log_;
150 CompletionCallback callback_; 151 CompletionCallback callback_;
151 base::WeakPtr<QuicChromiumClientSession> session_; 152 base::WeakPtr<QuicChromiumClientSession> session_;
152 153
153 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest); 154 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest);
154 }; 155 };
155 156
156 // A factory for creating new QuicHttpStreams on top of a pool of 157 // A factory for creating new QuicHttpStreams on top of a pool of
157 // QuicChromiumClientSessions. 158 // QuicChromiumClientSessions.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 float load_server_info_timeout_srtt_multiplier, 214 float load_server_info_timeout_srtt_multiplier,
214 bool enable_connection_racing, 215 bool enable_connection_racing,
215 bool enable_non_blocking_io, 216 bool enable_non_blocking_io,
216 bool disable_disk_cache, 217 bool disable_disk_cache,
217 bool prefer_aes, 218 bool prefer_aes,
218 int socket_receive_buffer_size, 219 int socket_receive_buffer_size,
219 bool delay_tcp_race, 220 bool delay_tcp_race,
220 int max_server_configs_stored_in_properties, 221 int max_server_configs_stored_in_properties,
221 bool close_sessions_on_ip_change, 222 bool close_sessions_on_ip_change,
222 bool disable_quic_on_timeout_with_open_streams, 223 bool disable_quic_on_timeout_with_open_streams,
224 bool mark_quic_broken_when_network_suspected,
223 int idle_connection_timeout_seconds, 225 int idle_connection_timeout_seconds,
224 int reduced_ping_timeout_seconds, 226 int reduced_ping_timeout_seconds,
225 int packet_reader_yield_after_duration_milliseconds, 227 int packet_reader_yield_after_duration_milliseconds,
226 bool migrate_sessions_on_network_change, 228 bool migrate_sessions_on_network_change,
227 bool migrate_sessions_early, 229 bool migrate_sessions_early,
228 bool allow_server_migration, 230 bool allow_server_migration,
229 bool force_hol_blocking, 231 bool force_hol_blocking,
230 bool race_cert_verification, 232 bool race_cert_verification,
231 bool do_not_fragment, 233 bool do_not_fragment,
232 bool estimate_initial_rtt, 234 bool estimate_initial_rtt,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 371
370 void set_require_confirmation(bool require_confirmation); 372 void set_require_confirmation(bool require_confirmation);
371 373
372 bool ZeroRTTEnabledFor(const QuicServerId& server_id); 374 bool ZeroRTTEnabledFor(const QuicServerId& server_id);
373 375
374 // It returns the amount of time waiting job should be delayed. 376 // It returns the amount of time waiting job should be delayed.
375 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); 377 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id);
376 378
377 QuicChromiumConnectionHelper* helper() { return helper_.get(); } 379 QuicChromiumConnectionHelper* helper() { return helper_.get(); }
378 380
379 QuicChromiumAlarmFactory* alarm_factory() { return alarm_factory_.get(); } 381 QuicAlarmFactory* alarm_factory() { return alarm_factory_.get(); }
380 382
381 bool has_quic_server_info_factory() const { 383 bool has_quic_server_info_factory() const {
382 return quic_server_info_factory_.get() != nullptr; 384 return quic_server_info_factory_.get() != nullptr;
383 } 385 }
384 386
385 QuicServerInfoFactory* quic_server_info_factory() const { 387 QuicServerInfoFactory* quic_server_info_factory() const {
386 return quic_server_info_factory_.get(); 388 return quic_server_info_factory_.get();
387 } 389 }
388 390
389 void set_quic_server_info_factory( 391 void set_quic_server_info_factory(
390 QuicServerInfoFactory* quic_server_info_factory); 392 QuicServerInfoFactory* quic_server_info_factory);
391 393
392 void set_server_push_delegate(ServerPushDelegate* push_delegate) { 394 void set_server_push_delegate(ServerPushDelegate* push_delegate) {
393 push_delegate_ = push_delegate; 395 push_delegate_ = push_delegate;
394 } 396 }
395 397
396 bool enable_connection_racing() const { return enable_connection_racing_; } 398 bool enable_connection_racing() const { return enable_connection_racing_; }
397 void set_enable_connection_racing(bool enable_connection_racing) { 399 void set_enable_connection_racing(bool enable_connection_racing) {
398 enable_connection_racing_ = enable_connection_racing; 400 enable_connection_racing_ = enable_connection_racing;
399 } 401 }
400 402
401 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } 403 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; }
402 404
403 bool delay_tcp_race() const { return delay_tcp_race_; } 405 bool delay_tcp_race() const { return delay_tcp_race_; }
404 406
405 bool migrate_sessions_on_network_change() const { 407 bool migrate_sessions_on_network_change() const {
406 return migrate_sessions_on_network_change_; 408 return migrate_sessions_on_network_change_;
407 } 409 }
408 410
411 bool mark_quic_broken_when_network_suspected() const {
412 return mark_quic_broken_when_network_suspected_;
413 }
414
409 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name 415 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name
410 // used by the parent MemoryAllocatorDump in the memory dump hierarchy. 416 // used by the parent MemoryAllocatorDump in the memory dump hierarchy.
411 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, 417 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd,
412 const std::string& parent_absolute_name) const; 418 const std::string& parent_absolute_name) const;
413 419
414 private: 420 private:
415 class Job; 421 class Job;
416 class CertVerifierJob; 422 class CertVerifierJob;
417 friend class test::QuicStreamFactoryPeer; 423 friend class test::QuicStreamFactoryPeer;
418 424
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 551
546 // Factory which is used to create socket performance watcher. A new watcher 552 // Factory which is used to create socket performance watcher. A new watcher
547 // is created for every QUIC connection. 553 // is created for every QUIC connection.
548 // |socket_performance_watcher_factory_| may be null. 554 // |socket_performance_watcher_factory_| may be null.
549 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; 555 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_;
550 556
551 // The helper used for all connections. 557 // The helper used for all connections.
552 std::unique_ptr<QuicChromiumConnectionHelper> helper_; 558 std::unique_ptr<QuicChromiumConnectionHelper> helper_;
553 559
554 // The alarm factory used for all connections. 560 // The alarm factory used for all connections.
555 std::unique_ptr<QuicChromiumAlarmFactory> alarm_factory_; 561 std::unique_ptr<QuicAlarmFactory> alarm_factory_;
556 562
557 // Contains owning pointers to all sessions that currently exist. 563 // Contains owning pointers to all sessions that currently exist.
558 SessionIdMap all_sessions_; 564 SessionIdMap all_sessions_;
559 // Contains non-owning pointers to currently active session 565 // Contains non-owning pointers to currently active session
560 // (not going away session, once they're implemented). 566 // (not going away session, once they're implemented).
561 SessionMap active_sessions_; 567 SessionMap active_sessions_;
562 // Map from session to set of aliases that this session is known by. 568 // Map from session to set of aliases that this session is known by.
563 SessionAliasMap session_aliases_; 569 SessionAliasMap session_aliases_;
564 // Map from IP address to sessions which are connected to this address. 570 // Map from IP address to sessions which are connected to this address.
565 IPAliasMap ip_aliases_; 571 IPAliasMap ip_aliases_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 // Set if we do not want to load server config from the disk cache. 610 // Set if we do not want to load server config from the disk cache.
605 bool disable_disk_cache_; 611 bool disable_disk_cache_;
606 612
607 // Set if AES-GCM should be preferred, even if there is no hardware support. 613 // Set if AES-GCM should be preferred, even if there is no hardware support.
608 bool prefer_aes_; 614 bool prefer_aes_;
609 615
610 // True if QUIC should be disabled when there are timeouts with open 616 // True if QUIC should be disabled when there are timeouts with open
611 // streams. 617 // streams.
612 bool disable_quic_on_timeout_with_open_streams_; 618 bool disable_quic_on_timeout_with_open_streams_;
613 619
620 // True if QUIC should be marked as broken when a stream is closed with
621 // a possibly network-caused error.
622 bool mark_quic_broken_when_network_suspected_;
623
614 // Number of times in a row that QUIC has been disabled. 624 // Number of times in a row that QUIC has been disabled.
615 int consecutive_disabled_count_; 625 int consecutive_disabled_count_;
616 bool need_to_evaluate_consecutive_disabled_count_; 626 bool need_to_evaluate_consecutive_disabled_count_;
617 627
618 // Size of the UDP receive buffer. 628 // Size of the UDP receive buffer.
619 int socket_receive_buffer_size_; 629 int socket_receive_buffer_size_;
620 630
621 // Set if we do want to delay TCP connection when it is racing with QUIC. 631 // Set if we do want to delay TCP connection when it is racing with QUIC.
622 bool delay_tcp_race_; 632 bool delay_tcp_race_;
623 633
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 const scoped_refptr<SSLConfigService> ssl_config_service_; 688 const scoped_refptr<SSLConfigService> ssl_config_service_;
679 689
680 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 690 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
681 691
682 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 692 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
683 }; 693 };
684 694
685 } // namespace net 695 } // namespace net
686 696
687 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ 697 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698