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

Unified Diff: ios/chrome/browser/ios_chrome_io_thread.h

Issue 1892123003: Add components/network_session_configurator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on https://crrev.com/1945513002. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ios_chrome_io_thread.h
diff --git a/ios/chrome/browser/ios_chrome_io_thread.h b/ios/chrome/browser/ios_chrome_io_thread.h
index dc45330ea70d45398d4ee11104918c77fe2be836..ed4d28d26c53f04ade869a65d3e2a68b72464228 100644
--- a/ios/chrome/browser/ios_chrome_io_thread.h
+++ b/ios/chrome/browser/ios_chrome_io_thread.h
@@ -18,7 +18,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "base/strings/string_piece.h"
#include "base/time/time.h"
#include "components/prefs/pref_member.h"
#include "components/ssl_config/ssl_config_service_manager.h"
@@ -43,7 +42,6 @@ class CTVerifier;
class HostResolver;
class HttpAuthHandlerFactory;
class HttpAuthPreferences;
-class HttpNetworkSession;
class HttpServerProperties;
class HttpTransactionFactory;
class HttpUserAgentSettings;
@@ -115,7 +113,6 @@ class IOSChromeIOThread : public web::WebThreadDelegate {
// pins.
std::unique_ptr<net::TransportSecurityState> transport_security_state;
std::unique_ptr<net::CTVerifier> cert_transparency_verifier;
- std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer;
scoped_refptr<net::SSLConfigService> ssl_config_service;
std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences;
std::unique_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory;
@@ -131,36 +128,6 @@ class IOSChromeIOThread : public web::WebThreadDelegate {
std::unique_ptr<net::CookieStore> system_cookie_store;
std::unique_ptr<net::HttpUserAgentSettings> http_user_agent_settings;
std::unique_ptr<net::NetworkQualityEstimator> network_quality_estimator;
- uint16_t testing_fixed_http_port;
- uint16_t testing_fixed_https_port;
- Optional<bool> enable_tcp_fast_open_for_ssl;
-
- Optional<bool> enable_spdy31;
- Optional<bool> enable_http2;
- Optional<bool> parse_alternative_services;
- Optional<bool> enable_alternative_service_with_different_host;
-
- Optional<bool> enable_npn;
-
- Optional<bool> enable_priority_dependencies;
-
- Optional<bool> enable_quic;
- Optional<bool> quic_always_require_handshake_confirmation;
- Optional<bool> quic_disable_connection_pooling;
- Optional<float> quic_load_server_info_timeout_srtt_multiplier;
- Optional<bool> quic_enable_connection_racing;
- Optional<bool> quic_enable_non_blocking_io;
- Optional<bool> quic_disable_disk_cache;
- Optional<bool> quic_prefer_aes;
- Optional<int> quic_max_number_of_lossy_connections;
- Optional<float> quic_packet_loss_threshold;
- Optional<int> quic_socket_receive_buffer_size;
- Optional<bool> quic_delay_tcp_race;
- Optional<size_t> quic_max_packet_length;
- net::QuicTagVector quic_connection_options;
- Optional<std::string> quic_user_agent_id;
- Optional<net::QuicVersionVector> quic_supported_versions;
- Optional<bool> quic_close_sessions_on_ip_change;
};
// |net_log| must either outlive the IOSChromeIOThread or be NULL.
@@ -189,14 +156,11 @@ class IOSChromeIOThread : public web::WebThreadDelegate {
// called on the IO thread.
void ClearHostCache();
- void InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params);
+ const net::HttpNetworkSession::Params& NetworkSessionParams() const;
base::TimeTicks creation_time() const;
private:
- // Map from name to value for all parameters associate with a field trial.
- typedef std::map<std::string, std::string> VariationParameters;
-
// Provide SystemURLRequestContextGetter with access to
// InitSystemRequestContext().
friend class SystemURLRequestContextGetter;
@@ -207,32 +171,6 @@ class IOSChromeIOThread : public web::WebThreadDelegate {
void Init() override;
void CleanUp() override;
- // Initializes |params| based on the settings in |globals|.
- static void InitializeNetworkSessionParamsFromGlobals(
- const Globals& globals,
- net::HttpNetworkSession::Params* params);
-
- void InitializeNetworkOptions();
-
- // Sets up SSL TCP FastOpen if enabled via field trials.
- void ConfigureSSLTCPFastOpen();
-
- // Configures available SPDY protocol versions in |globals| based on the SPDY
- // field trial group and parameters.
- // Must be called after ConfigureQuicGlobals.
- static void ConfigureSpdyGlobals(base::StringPiece quic_trial_group,
- const VariationParameters& quic_trial_params,
- Globals* globals);
-
- // Configures Alternative Services in |globals| based on the field trial
- // group.
- static void ConfigureAltSvcGlobals(base::StringPiece altsvc_trial_group,
- IOSChromeIOThread::Globals* globals);
-
- // Configures NPN in |globals| based on the field trial group.
- static void ConfigureNPNGlobals(base::StringPiece npn_trial_group,
- Globals* globals);
-
// Global state must be initialized on the IO thread, then this
// method must be invoked on the UI thread.
void InitSystemRequestContext();
@@ -250,105 +188,9 @@ class IOSChromeIOThread : public web::WebThreadDelegate {
void ChangedToOnTheRecordOnIOThread();
- // Configure whether we set HTTP/2 dependencies from the
- // net::RequestPriority.
- void ConfigurePriorityDependencies();
-
- // Configures QUIC options based on the QUIC field trial group.
- void ConfigureQuic();
-
- // Configures QUIC options in |globals| based on the flags in |command_line|
- // as well as the QUIC field trial group and parameters.
- // Must be called before ConfigureSpdyGlobals.
- static void ConfigureQuicGlobals(base::StringPiece quic_trial_group,
- const VariationParameters& quic_trial_params,
- Globals* globals);
-
- // Returns true if QUIC should be enabled as a result of a field trial.
- static bool ShouldEnableQuic(base::StringPiece quic_trial_group);
-
- // Returns true if QUIC should always require handshake confirmation during
- // the QUIC handshake.
- static bool ShouldQuicAlwaysRequireHandshakeConfirmation(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC should disable connection pooling.
- static bool ShouldQuicDisableConnectionPooling(
- const VariationParameters& quic_trial_params);
-
- // Returns the ratio of time to load QUIC sever information from disk cache to
- // 'smoothed RTT' based on field trial. Returns 0 if there is an error parsing
- // the field trial params, or if the default value should be used.
- static float GetQuicLoadServerInfoTimeoutSrttMultiplier(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC's connection racing should be enabled.
- static bool ShouldQuicEnableConnectionRacing(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC's should use non-blocking IO.
- static bool ShouldQuicEnableNonBlockingIO(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC shouldn't load QUIC server information from the disk
- // cache.
- static bool ShouldQuicDisableDiskCache(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC should prefer AES-GCN even without hardware support.
- static bool ShouldQuicPreferAes(const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC should enable alternative services for different host.
- static bool ShouldQuicEnableAlternativeServicesForDifferentHost(
- const VariationParameters& quic_trial_params);
-
- // Returns the maximum number of QUIC connections with high packet loss in a
- // row after which QUIC should be disabled. Returns 0 if the default value
- // should be used.
- static int GetQuicMaxNumberOfLossyConnections(
- const VariationParameters& quic_trial_params);
-
- // Returns the packet loss rate in fraction after which a QUIC connection is
- // closed and is considered as a lossy connection. Returns 0 if the default
- // value should be used.
- static float GetQuicPacketLossThreshold(
- const VariationParameters& quic_trial_params);
-
- // Returns the size of the QUIC receive buffer to use, or 0 if
- // the default should be used.
- static int GetQuicSocketReceiveBufferSize(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC should delay TCP connection when QUIC works.
- static bool ShouldQuicDelayTcpRace(
- const VariationParameters& quic_trial_params);
-
- // Returns true if QUIC should close sessions when any of the client's
- // IP addresses change.
- static bool ShouldQuicCloseSessionsOnIpChange(
- const VariationParameters& quic_trial_params);
-
- // Returns the maximum length for QUIC packets, based on any flags in the
- // field trial. Returns 0 if there is an error parsing any of the options,
- // or if the default value should be used.
- static size_t GetQuicMaxPacketLength(
- const VariationParameters& quic_trial_params);
-
- // Returns the QUIC versions specified by any flags in |quic_trial_params|.
- static net::QuicVersion GetQuicVersion(
- const VariationParameters& quic_trial_params);
-
- // Returns the QUIC version specified by |quic_version| or
- // QUIC_VERSION_UNSUPPORTED if |quic_version| is invalid.
- static net::QuicVersion ParseQuicVersion(const std::string& quic_version);
-
- // Returns the QUIC connection options specified by any flags in
- // |quic_trial_params|.
- static net::QuicTagVector GetQuicConnectionOptions(
- const VariationParameters& quic_trial_params);
-
static net::URLRequestContext* ConstructSystemRequestContext(
Globals* globals,
+ const net::HttpNetworkSession::Params& params,
net::NetLog* net_log);
// The NetLog is owned by the application context, to allow logging from other
@@ -365,6 +207,8 @@ class IOSChromeIOThread : public web::WebThreadDelegate {
Globals* globals_;
+ net::HttpNetworkSession::Params params_;
+
// Observer that logs network changes to the ChromeNetLog.
class LoggingNetworkChangeObserver;
std::unique_ptr<LoggingNetworkChangeObserver> network_change_observer_;
« no previous file with comments | « ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc ('k') | ios/chrome/browser/ios_chrome_io_thread.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698