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