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 #include "chrome/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 795 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
796 // is fixed. | 796 // is fixed. |
797 tracked_objects::ScopedTracker tracking_profile12_5( | 797 tracked_objects::ScopedTracker tracking_profile12_5( |
798 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 798 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
799 "466432 IOThread::InitAsync::QuicConfiguration")); | 799 "466432 IOThread::InitAsync::QuicConfiguration")); |
800 ConfigureQuic(command_line); | 800 ConfigureQuic(command_line); |
801 if (command_line.HasSwitch( | 801 if (command_line.HasSwitch( |
802 switches::kEnableUserAlternateProtocolPorts)) { | 802 switches::kEnableUserAlternateProtocolPorts)) { |
803 globals_->enable_user_alternate_protocol_ports = true; | 803 globals_->enable_user_alternate_protocol_ports = true; |
804 } | 804 } |
| 805 globals_->enable_brotli.set(ShouldEnableBrotli(command_line)); |
805 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 806 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
806 // is fixed. | 807 // is fixed. |
807 tracked_objects::ScopedTracker tracking_profile13( | 808 tracked_objects::ScopedTracker tracking_profile13( |
808 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 809 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
809 "466432 IOThread::InitAsync::InitializeNetworkOptions")); | 810 "466432 IOThread::InitAsync::InitializeNetworkOptions")); |
810 InitializeNetworkOptions(command_line); | 811 InitializeNetworkOptions(command_line); |
811 | 812 |
812 TRACE_EVENT_BEGIN0("startup", | 813 TRACE_EVENT_BEGIN0("startup", |
813 "IOThread::Init:ProxyScriptFetcherRequestContext"); | 814 "IOThread::Init:ProxyScriptFetcherRequestContext"); |
814 globals_->proxy_script_fetcher_context.reset( | 815 globals_->proxy_script_fetcher_context.reset( |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 params->next_protos = globals.next_protos; | 1070 params->next_protos = globals.next_protos; |
1070 globals.trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); | 1071 globals.trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); |
1071 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; | 1072 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; |
1072 globals.use_alternative_services.CopyToIfSet( | 1073 globals.use_alternative_services.CopyToIfSet( |
1073 ¶ms->use_alternative_services); | 1074 ¶ms->use_alternative_services); |
1074 globals.alternative_service_probability_threshold.CopyToIfSet( | 1075 globals.alternative_service_probability_threshold.CopyToIfSet( |
1075 ¶ms->alternative_service_probability_threshold); | 1076 ¶ms->alternative_service_probability_threshold); |
1076 | 1077 |
1077 globals.enable_npn.CopyToIfSet(¶ms->enable_npn); | 1078 globals.enable_npn.CopyToIfSet(¶ms->enable_npn); |
1078 | 1079 |
| 1080 globals.enable_brotli.CopyToIfSet(¶ms->enable_brotli); |
| 1081 |
1079 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1082 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
1080 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); | 1083 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); |
1081 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1084 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
1082 ¶ms->quic_always_require_handshake_confirmation); | 1085 ¶ms->quic_always_require_handshake_confirmation); |
1083 globals.quic_disable_connection_pooling.CopyToIfSet( | 1086 globals.quic_disable_connection_pooling.CopyToIfSet( |
1084 ¶ms->quic_disable_connection_pooling); | 1087 ¶ms->quic_disable_connection_pooling); |
1085 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( | 1088 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( |
1086 ¶ms->quic_load_server_info_timeout_srtt_multiplier); | 1089 ¶ms->quic_load_server_info_timeout_srtt_multiplier); |
1087 globals.quic_enable_connection_racing.CopyToIfSet( | 1090 globals.quic_enable_connection_racing.CopyToIfSet( |
1088 ¶ms->quic_enable_connection_racing); | 1091 ¶ms->quic_enable_connection_racing); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 if (command_line.HasSwitch(switches::kOriginToForceQuicOn)) { | 1280 if (command_line.HasSwitch(switches::kOriginToForceQuicOn)) { |
1278 net::HostPortPair quic_origin = | 1281 net::HostPortPair quic_origin = |
1279 net::HostPortPair::FromString( | 1282 net::HostPortPair::FromString( |
1280 command_line.GetSwitchValueASCII(switches::kOriginToForceQuicOn)); | 1283 command_line.GetSwitchValueASCII(switches::kOriginToForceQuicOn)); |
1281 if (!quic_origin.IsEmpty()) { | 1284 if (!quic_origin.IsEmpty()) { |
1282 globals->origin_to_force_quic_on.set(quic_origin); | 1285 globals->origin_to_force_quic_on.set(quic_origin); |
1283 } | 1286 } |
1284 } | 1287 } |
1285 } | 1288 } |
1286 | 1289 |
| 1290 bool IOThread::ShouldEnableBrotli(const base::CommandLine& command_line) { |
| 1291 if (command_line.HasSwitch(switches::kDisableBrotli)) |
| 1292 return false; |
| 1293 return command_line.HasSwitch(switches::kEnableBrotli); |
| 1294 } |
| 1295 |
1287 bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line, | 1296 bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line, |
1288 base::StringPiece quic_trial_group, | 1297 base::StringPiece quic_trial_group, |
1289 bool quic_allowed_by_policy) { | 1298 bool quic_allowed_by_policy) { |
1290 if (command_line.HasSwitch(switches::kDisableQuic) || !quic_allowed_by_policy) | 1299 if (command_line.HasSwitch(switches::kDisableQuic) || !quic_allowed_by_policy) |
1291 return false; | 1300 return false; |
1292 | 1301 |
1293 if (command_line.HasSwitch(switches::kEnableQuic)) | 1302 if (command_line.HasSwitch(switches::kEnableQuic)) |
1294 return true; | 1303 return true; |
1295 | 1304 |
1296 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || | 1305 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1663 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1655 | 1664 |
1656 context->set_job_factory( | 1665 context->set_job_factory( |
1657 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1666 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1658 | 1667 |
1659 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1668 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1660 // system URLRequestContext too. There's no reason this should be tied to a | 1669 // system URLRequestContext too. There's no reason this should be tied to a |
1661 // profile. | 1670 // profile. |
1662 return context; | 1671 return context; |
1663 } | 1672 } |
OLD | NEW |