| 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 CHROME_BROWSER_IO_THREAD_H_ | 5 #ifndef CHROME_BROWSER_IO_THREAD_H_ |
| 6 #define CHROME_BROWSER_IO_THREAD_H_ | 6 #define CHROME_BROWSER_IO_THREAD_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <unordered_set> | |
| 15 #include <vector> | 14 #include <vector> |
| 16 | 15 |
| 17 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 17 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 22 #include "base/prefs/pref_member.h" | 21 #include "base/prefs/pref_member.h" |
| 23 #include "base/strings/string_piece.h" | 22 #include "base/strings/string_piece.h" |
| 24 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 Optional<int> quic_socket_receive_buffer_size; | 232 Optional<int> quic_socket_receive_buffer_size; |
| 234 Optional<bool> quic_delay_tcp_race; | 233 Optional<bool> quic_delay_tcp_race; |
| 235 Optional<size_t> quic_max_packet_length; | 234 Optional<size_t> quic_max_packet_length; |
| 236 net::QuicTagVector quic_connection_options; | 235 net::QuicTagVector quic_connection_options; |
| 237 Optional<std::string> quic_user_agent_id; | 236 Optional<std::string> quic_user_agent_id; |
| 238 Optional<net::QuicVersionVector> quic_supported_versions; | 237 Optional<net::QuicVersionVector> quic_supported_versions; |
| 239 Optional<net::HostPortPair> origin_to_force_quic_on; | 238 Optional<net::HostPortPair> origin_to_force_quic_on; |
| 240 Optional<bool> quic_close_sessions_on_ip_change; | 239 Optional<bool> quic_close_sessions_on_ip_change; |
| 241 Optional<int> quic_idle_connection_timeout_seconds; | 240 Optional<int> quic_idle_connection_timeout_seconds; |
| 242 Optional<bool> quic_disable_preconnect_if_0rtt; | 241 Optional<bool> quic_disable_preconnect_if_0rtt; |
| 243 std::unordered_set<std::string> quic_host_whitelist; | |
| 244 bool enable_user_alternate_protocol_ports; | 242 bool enable_user_alternate_protocol_ports; |
| 245 // NetErrorTabHelper uses |dns_probe_service| to send DNS probes when a | 243 // NetErrorTabHelper uses |dns_probe_service| to send DNS probes when a |
| 246 // main frame load fails with a DNS error in order to provide more useful | 244 // main frame load fails with a DNS error in order to provide more useful |
| 247 // information to the renderer so it can show a more specific error page. | 245 // information to the renderer so it can show a more specific error page. |
| 248 scoped_ptr<chrome_browser_net::DnsProbeService> dns_probe_service; | 246 scoped_ptr<chrome_browser_net::DnsProbeService> dns_probe_service; |
| 249 }; | 247 }; |
| 250 | 248 |
| 251 // |net_log| must either outlive the IOThread or be NULL. | 249 // |net_log| must either outlive the IOThread or be NULL. |
| 252 IOThread(PrefService* local_state, | 250 IOThread(PrefService* local_state, |
| 253 policy::PolicyService* policy_service, | 251 policy::PolicyService* policy_service, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 // Returns the idle connection timeout for QUIC connections. Returns 0 if | 454 // Returns the idle connection timeout for QUIC connections. Returns 0 if |
| 457 // there is an error parsing any of the options, or if the default value | 455 // there is an error parsing any of the options, or if the default value |
| 458 // should be used. | 456 // should be used. |
| 459 static int GetQuicIdleConnectionTimeoutSeconds( | 457 static int GetQuicIdleConnectionTimeoutSeconds( |
| 460 const VariationParameters& quic_trial_params); | 458 const VariationParameters& quic_trial_params); |
| 461 | 459 |
| 462 // Returns true if PreConnect should be disabled if QUIC can do 0RTT. | 460 // Returns true if PreConnect should be disabled if QUIC can do 0RTT. |
| 463 static bool ShouldQuicDisablePreConnectIfZeroRtt( | 461 static bool ShouldQuicDisablePreConnectIfZeroRtt( |
| 464 const VariationParameters& quic_trial_params); | 462 const VariationParameters& quic_trial_params); |
| 465 | 463 |
| 466 // Returns the set of hosts to whitelist for QUIC. | |
| 467 static std::unordered_set<std::string> GetQuicHostWhitelist( | |
| 468 const base::CommandLine& command_line, | |
| 469 const VariationParameters& quic_trial_params); | |
| 470 | |
| 471 // Returns the maximum length for QUIC packets, based on any flags in | 464 // Returns the maximum length for QUIC packets, based on any flags in |
| 472 // |command_line| or the field trial. Returns 0 if there is an error | 465 // |command_line| or the field trial. Returns 0 if there is an error |
| 473 // parsing any of the options, or if the default value should be used. | 466 // parsing any of the options, or if the default value should be used. |
| 474 static size_t GetQuicMaxPacketLength( | 467 static size_t GetQuicMaxPacketLength( |
| 475 const base::CommandLine& command_line, | 468 const base::CommandLine& command_line, |
| 476 const VariationParameters& quic_trial_params); | 469 const VariationParameters& quic_trial_params); |
| 477 | 470 |
| 478 // Returns the QUIC versions specified by any flags in |command_line| | 471 // Returns the QUIC versions specified by any flags in |command_line| |
| 479 // or |quic_trial_params|. | 472 // or |quic_trial_params|. |
| 480 static net::QuicVersion GetQuicVersion( | 473 static net::QuicVersion GetQuicVersion( |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 bool is_quic_allowed_by_policy_; | 570 bool is_quic_allowed_by_policy_; |
| 578 | 571 |
| 579 const base::TimeTicks creation_time_; | 572 const base::TimeTicks creation_time_; |
| 580 | 573 |
| 581 base::WeakPtrFactory<IOThread> weak_factory_; | 574 base::WeakPtrFactory<IOThread> weak_factory_; |
| 582 | 575 |
| 583 DISALLOW_COPY_AND_ASSIGN(IOThread); | 576 DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 584 }; | 577 }; |
| 585 | 578 |
| 586 #endif // CHROME_BROWSER_IO_THREAD_H_ | 579 #endif // CHROME_BROWSER_IO_THREAD_H_ |
| OLD | NEW |